0

I am new in django. I am trying to create a user specific page where after login the user land to somthing like mydomain.com/dashboard/. I am trying to implement the following solution Django - after login, redirect user to his custom page --> mysite.com/username Can anyone provide more detail like how to create models , call back , views and login page thanks

pankaj jha
  • 299
  • 5
  • 15

1 Answers1

1

User @login-required on every view that is user specific in views.py

Create a myapp/templates/registration/login.html

Setup urls.py in main to point to index in myapp.

Any attempt to access a page will redirect to login. After authenticated redirect to index.html

Django has a built in users model. You can use your superuser that you access admin dashboard with.

noes1s
  • 134
  • 7
  • The above answer is assuming a few things. based off of [The link you listed](https://stackoverflow.com/questions/4870619/django-after-login-redirect-user-to-his-custom-page-mysite-com-username/7061358), you have already set up the LOGIN_REDIRECT_URL in settings.py also, I advise running through a [Django Tutorial](https://docs.djangoproject.com/en/1.11/intro/tutorial01/). to get a feel for creating views in view.py and managing urls.py – noes1s Oct 16 '17 at 15:10