Answer the question
In order to leave comments, you need to log in
How to rewrite what is written by get_object() using the get() method - the task is that if there is no profile, then redirect to create a profile?
class MyProfile(DetailView):
template_name = 'profile.html'
def get_object(self):
return self.request.user.profile
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question