Autokilled Autokilled - 1 year ago 957
Python Question

cannot import name patterns

Before I wrote in
, my code... everything worked perfectly. Now I have problems - can't go to my site. "cannot import name patterns"


from django.conf.urls import patterns, include, url

They said what error is somewhere here.

Answer Source

You don't need those imports. The only thing you need in your (to start) is:

from django.conf.urls.defaults import *

# This two if you want to enable the Django Admin: (recommended)
from django.contrib import admin

urlpatterns = patterns('',
    url(r'^admin/', include(,
    # ... your url patterns