tags:

views:

329

answers:

1

My website, which was working before, suddenly started breaking with the error

"ImproperlyConfigured at / The included urlconf resume.urls doesn't have any patterns in it"

The project base is called resume. In settings.py I have set

ROOT_URLCONF = 'resume.urls'

Here's my resume.urls, which sits in the project root directory.

from django.conf.urls.defaults import *

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

urlpatterns = patterns('',
    # Example:
    # (r'^resume/', include('resume.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)),

    (r'^accounts/login/$', 'django.contrib.auth.views.login'),


    #(r'^employer/', include(students.urls)),

    (r'^ajax/', include('urls.ajax')),
    (r'^student/', include('students.urls')),
    (r'^club/(?P<object_id>\d+)/$', 'resume.students.views.club_detail'),
    (r'^company/(?P<object_id>\d+)/$', 'resume.students.views.company_detail'),
    (r'^program/(?P<object_id>\d+)/$', 'resume.students.views.program_detail'),
    (r'^course/(?P<object_id>\d+)/$', 'resume.students.views.course_detail'),
    (r'^career/(?P<object_id>\d+)/$', 'resume.students.views.career_detail'),

    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'C:/code/django/resume/media'}),

)

I have a folder called urls and a file ajax.py inside. (I also created a blank init.py in the same folder so that urls would be recognized.) This is ajax.py.

from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^star/(?P<object_id>\d+)$', 'resume.students.ajax-calls.star'),
)

Anyone know what's wrong? This is driving me crazy.

Thanks,

+2  A: 

Check your patterns for include statements that point to non-existent modules or modules that do not have a urlpatterns member. I see that you have an include('urls.ajax') which may not be correct. Should it be ajax.urls?

AdmiralNemo
I agree that's likely to be the problem.
Paul McMillan
I edited my original post to include the code from ajax.py. I also tried commenting the includes out--still no dice.
unsorted
You can't have a `urls.py` and a directory named `urls` in the same package. If you want to have `resume.urls` and `resume.urls.ajax`, then you will need to move all of the contents of `urls.py` into `urls/__init__.py` and delete the `urls.py` file.
AdmiralNemo
oh wow...okay, that makes sense. made the change you suggested and it works great. thanks for the help!!
unsorted