Permalink
Browse files

Update example urls.py to match the one created by django-admin.py

  • Loading branch information...
mpdaugherty committed Oct 25, 2012
1 parent a44ce36 commit 4c493d6c64e0089105c2d0f73bdf64d14ebb4ebe
Showing with 7 additions and 7 deletions.
  1. +7 −7 chapter03.rst
View
@@ -96,22 +96,22 @@ When you executed ``django-admin.py startproject`` in the previous chapter, the
script created a URLconf for you automatically: the file ``urls.py``. By
default, it looks something like this::
- from django.conf.urls.defaults import *
+ from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
- # Example:
- # (r'^mysite/', include('mysite.foo.urls')),
+ # Examples:
+ # url(r'^$', 'mysite.views.home', name='home'),
+ # url(r'^mysite/', include('mysite.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 admin/doc line below to enable admin documentation:
+ # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
- # (r'^admin/', include(admin.site.urls)),
+ # url(r'^admin/', include(admin.site.urls)),
)
This default URLconf includes some commonly used Django features commented out,

1 comment on commit 4c493d6

@peeter3

This comment has been minimized.

Show comment Hide comment
@peeter3

peeter3 Nov 15, 2012

I would recommend keeping it whatever the default urls.py is for a recent version of Django; it's encouraging and less confusing to a new user, such as myself, to see a new installation match the documentation.

I would recommend keeping it whatever the default urls.py is for a recent version of Django; it's encouraging and less confusing to a new user, such as myself, to see a new installation match the documentation.

Please sign in to comment.