tags:

views:

66

answers:

1

Hi all,

Why I get this error?


Page not found (404)

Using the URLconf defined in myproject.urls, Django tried these URL patterns, in this order:

  1. ^admin/doc/
  2. ^admin/

The current URL, , didn't match any of these.


I just uncomment the related lines in urls.py to enable admin and admindoc. They both work; but when I go to the root domain (e.g. example.com), I get this error.

my urls.py is like this:

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^myproject/', include('myproject.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)


Thanks in advance...

+1  A: 

That's because you don't have a URL defined for the root domain. Check our URLconf: it contains the two lines you listed, which means that you only have URLs defined for example.com/admin and example.com/admin/doc, but not just example.com.

mipadi