diff options
| author | Tim Graham <timograham@gmail.com> | 2015-12-09 11:27:16 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-09 11:46:33 -0500 |
| commit | 2c6624a67397afc0f72a36559b53fb693e473bbc (patch) | |
| tree | f73f041795992cd148b2e022ad026b8f79e6ad00 | |
| parent | f076cf07effe54af8a28f22431c3c76a8af61fc5 (diff) | |
[1.9.x] Fixed #25711 -- Updated the project template's include() example.
Referencing URLs by dotted path is a stronger convention than
importing the URLs.
Backport of 179fbab7e05946b59ec9815d6e9b1901826ed610 from master
| -rw-r--r-- | django/conf/project_template/project_name/urls.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/conf/project_template/project_name/urls.py b/django/conf/project_template/project_name/urls.py index 0fc13c9620..30ddffb876 100644 --- a/django/conf/project_template/project_name/urls.py +++ b/django/conf/project_template/project_name/urls.py @@ -10,9 +10,8 @@ Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf - 1. Add an import: from blog import urls as blog_urls - 2. Import the include() function: from django.conf.urls import url, include - 3. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin |
