Reputation: 25
class myapp():
def index(self):
return redirect(someusrl)
def productview(self):
return redirect(someusrl)
path('', myapp.index, name="home"),
path('product', myapp.productview, name="Product_page")
like this way
thanks in advance :)
Upvotes: 2
Views: 29
Reputation: 372
Why you are creating functions inside that class? Instead of this you should use django class-based views.
Here is the documentation :
https://docs.djangoproject.com/en/3.0/topics/class-based-views/
Upvotes: 1