diff options
| author | Andrew Pinkham <code@andrewsforge.com> | 2015-04-13 12:17:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-14 12:48:17 -0400 |
| commit | 0b5abb03218ff0c575cee0c83e446bab81cbfadd (patch) | |
| tree | abd2839b3b08b70f0d6bee02fca1e8d1f4acfc24 /django | |
| parent | f8e8853b51476af1cc75a229dadc990c9ccf45ec (diff) | |
Fixed #24635 -- Updated deprecated urls.py examples in default project template.
Diffstat (limited to 'django')
| -rw-r--r-- | django/conf/project_template/project_name/urls.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/django/conf/project_template/project_name/urls.py b/django/conf/project_template/project_name/urls.py index 308d0b4d33..665085b17b 100644 --- a/django/conf/project_template/project_name/urls.py +++ b/django/conf/project_template/project_name/urls.py @@ -1,10 +1,21 @@ +"""{{ project_name }} URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +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. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) +""" from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ - # Examples: - # url(r'^$', '{{ project_name }}.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), - url(r'^admin/', include(admin.site.urls)), ] |
