Include mainsite's urlpatterns

This commit is contained in:
Théophile Bastian 2017-09-21 19:01:47 +02:00
parent 10f29d8264
commit f8d6be1c25
2 changed files with 9 additions and 3 deletions

View file

@ -13,9 +13,13 @@ Including another URLconf
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.conf.urls import url, include
from django.contrib import admin
import mainsite.urls
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include(mainsite.urls.urlpatterns)),
]

View file

@ -1,7 +1,9 @@
from django.conf.urls import url
from .views import YearView
from . import views
app_name = 'manisite'
urlpatterns = [
url(r'^(?P<year>\d{4})-(?P<nYear>\d{4})/',
YearView.as_view(), name='year_view'),
views.YearView.as_view(), name='year_view'),
]