Reputation: 13
I use "django-registration" by James Bennett. To hook up it to my project I have to write in my main url file:
(r'^users/', include('registration.urls')),
So then all urls of this app will be start with "users/". It isn't bad. But for "login" I want to use just home directory "/".
How to do this without changing the "django-registration" source files? I tried to use "redirect_to" in my main url file:
url('users/login/$',
'django.views.generic.simple.redirect_to',
{'url': 'login/'}),
But it just adds "login/" to the end of "users/login/" and I get "user/login/login/.
Upvotes: 1
Views: 687
Reputation: 3008
{'url': '/login/'}),
Change 'login/' to '/login' to fix. Path starts with '/' means 'I will be added from home path, not current'.
Upvotes: 0
Reputation: 1975
Probably you should just add
(r'^login/', 'registration.views.name_of_login_view'),
to your project main urls.py.
Regarding your URL try using {'url': '/login/'} instead of {'url': 'login/'}
Upvotes: 1