Django - how to implement an example.com/username url system

前端 未结 3 656
离开以前
离开以前 2020-12-15 01:56

I am trying to implement on my website a simple and friendly address system.

What i\'m thinking about is when the user logged in, his username will be displayed in t

3条回答
  •  太阳男子
    2020-12-15 02:55

    It's almost perfect, but i have a bug. Let me explain. When i login (my login system is: django-allauth) on the http://127.0.0.1:8000/accounts/login/ i return to http://127.0.0.1:8000 with an error 404.

    I am not getting the http://127.0.0.1:8000/username/ with the template, when the login botton is clicked.

    The instalation of django-allauth require adding to the settings.py

    LOGIN_REDIRECT_URL = '/'

    How can i redirect to http://127.0.0.1:8000/username/ and show the correct template?

提交回复
热议问题