{{{
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'plab_django_admin.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
}}}
having such a setup, after running a runserver command leads to:
{{{
ImportError: cannot import name patterns
}}}
According to [https://docs.djangoproject.com/en/1.10/releases/1.10
/#features-removed-in-1-10 Feature removed in 1.10]
{{{
django.conf.urls.patterns() is removed.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27016>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hi,
I think there's an issue with your setup where `django-admin.py` uses an
older version of Django (1.7 by the looks of it) but your project actually
uses a more recent (1.10) Django version.
When using Django 1.10, `django-admin.py startproject` will use correct
imports.
Can yo ucheck what `django-admin.py --version` returns? I'll mark this
ticket as `invalid` for now but please reopen it if it turns out my
analysis is incorrect.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/27016#comment:1>