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
Asked
Active
Viewed 816 times
0
-
Here is you answer its been asked by another person too https://stackoverflow.com/questions/44492856/create-user-specific-redirect-after-login-in-django – I AM A Hacker Oct 14 '17 at 07:17
-
you are asking your homework, your question is too broad, pls edit it – Mauricio Cortazar Oct 14 '17 at 18:09
1 Answers
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