B
B
Boldy2014-12-06 11:21:02
Django
Boldy, 2014-12-06 11:21:02

Why is django redirecting request to wrong url?

urls:

admin.autodiscover()
urlpatterns = patterns('',
                       url(r'^admin/', include(admin.site.urls)),
                       url(r'^accounts/', include('accounts.urls')),
                       ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

accounts.urls
admin.autodiscover()
urlpatterns = patterns('',
                       url(r'^login/', 'django.contrib.auth.views.login', {'template_name': 'login.html'},),
                       )

In this form, accounts/login/ works correctly, but if added to the main urls, it
url(r'^/', include('site_info.urls')),
gives
The included urlconf '<module 'site_info.urls' from '/home/basil/pure-pro/pureproonline/site_info/urls.pyc'>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oscar Django, 2014-12-06
@Boldy


I guess instead
url(r'^$', include('site_info.urls')),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question