Redirect error after logging in to Django 1.2

I get this error:

The requested admin page does not exist.

I have a URL /members/that is protected @login_required. When I don’t log in and find the URL /members/, I redirect to:

http://127.0.0.1:8000/admin/login/?next=/members/

When I enter my credentials and click "Sign In", I get this error (only when DEBUGthere is True, otherwise I get 404), and I'm still at:

http://127.0.0.1:8000/admin/login/?next=/members/

Some of the comments I found about this seem to be related to the order in which I add bits to mine urlpatterns, but that does not seem to make any difference.

Any other ideas?

My urls.pylooks something like this:

urlpatterns = patterns('',
    (r'^$', 'myproject.views.homepage', {}, 'homepage'),
    # some other stuff
)

urlpatterns += patterns('',
    (r'^members/', include('members.urls', namespace = u'members', app_name = u'members')),
)

urlpatterns += patterns('',
    (r'^admin/', include(admin.site.urls)), 
)

Let me know if there is anything else that could help me understand what is wrong!

+3
1

, URL- -? ?

, . -admin login_required views. - ?

, , . http://localhost:8000/admin/login/?next=/valid_url/ .

: .

+3

Source: https://habr.com/ru/post/1768027/


All Articles