|
|
|
@@ -7,8 +7,7 @@ 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') |
|
|
|
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)) |
|
|
|
@@ -23,9 +22,9 @@ from .views import error_400, error_403, error_404, error_500 |
|
|
|
urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
|
|
|
|
|
|
|
urlpatterns += [ |
|
|
|
url(r'^wahl/', include('news.urls', |
|
|
|
namespace='wahl', |
|
|
|
app_name='news')), |
|
|
|
url(r'^regierung/', include('news.urls', |
|
|
|
namespace='regierung', |
|
|
|
app_name='news')), |
|
|
|
url(r'^meingoethopia/', include('meingoethopia.urls', |
|
|
|
namespace='meingoethopia', |
|
|
|
app_name='meingoethopia')), |
|
|
|
|