Migrate

Django changed the way that the urls.py was formatted between 1.7 and 1.8. It's pretty simple to update though -- just update the urlpatterns line and make sure to change the parenthesis to square brackets.

Before (Django 1.7 and below):


urlpatterns = patterns('',
    url(r'^$', 'collection.views.index', name='home'),
    url(r'^about/$',
        TemplateView.as_view(template_name='about.html'),
        name='about'),
)

After (Django 1.8 and higher):


from collection import views

urlpatterns = [
    url(r'^$', views.index, name='home'),
    url(r'^about/$',
        TemplateView.as_view(template_name='about.html'),
        name='about'),
]

Learn how to create your first web app and get on the path of a fun side project, a lifestyle business, or your first startup. Order Hello Web App today.

Get a free sample of all books by joining the email newsletter.

Get updates, extra information about development and resources, and free samples right to your inbox.