Referring to the Django Book, chapter 3:
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('',
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^mysite/', include('mysite.foo.urls')),
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# url(r'^admin/', include(admin.site.urls)),
)
What determines why one thing is included as a string, and another as regular variable? Why admin.site.urls
but not 'admin.site.urls'
? All other include
s are included as strings... I see no logical pattern here.
url(r'^$', view_but_not_as_string, name='home')
? – Lallans