| author | durandn |
| Thu, 10 Mar 2016 13:32:18 +0100 | |
| changeset 15 | 8004d8fc9b38 |
| parent 1 | 5f50937893ac |
| child 73 | f64fb2da5a54 |
| permissions | -rw-r--r-- |
| 0 | 1 |
"""metaeducation URL Configuration |
2 |
||
3 |
The `urlpatterns` list routes URLs to views. For more information please see: |
|
| 1 | 4 |
https://docs.djangoproject.com/en/1.8/topics/http/urls/ |
| 0 | 5 |
Examples: |
6 |
Function views |
|
7 |
1. Add an import: from my_app import views |
|
8 |
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') |
|
9 |
Class-based views |
|
10 |
1. Add an import: from other_app.views import Home |
|
11 |
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') |
|
12 |
Including another URLconf |
|
| 1 | 13 |
1. Add an import: from blog import urls as blog_urls |
14 |
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) |
|
| 0 | 15 |
""" |
| 1 | 16 |
from django.conf.urls import include, url |
| 0 | 17 |
from django.contrib import admin |
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
18 |
from django.contrib.admin.views.decorators import staff_member_required |
|
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
19 |
from django.contrib.staticfiles.urls import staticfiles_urlpatterns |
| 1 | 20 |
from django.core.urlresolvers import reverse_lazy |
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
21 |
from django.views.generic import RedirectView |
|
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
22 |
|
| 1 | 23 |
from .views import ListRenkansView, NewRenkanView, EditRenkanView, ViewRenkanView, DeleteRenkanView |
| 0 | 24 |
|
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
25 |
|
| 0 | 26 |
urlpatterns = [ |
| 1 | 27 |
url(r'^$', RedirectView.as_view(url=reverse_lazy("front_list_renkans"))), |
28 |
url(r'^admin/', include(admin.site.urls)), |
|
29 |
url(r'^api/', include('renkanmanager.urls')), |
|
30 |
url(r'^accounts/', include('allauth.urls')), |
|
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
31 |
url(r'^front/list/$', staff_member_required(ListRenkansView.as_view()), name='front_list_renkans'), |
| 1 | 32 |
url(r'^front/new/$', NewRenkanView.as_view(), name='front_new_renkan'), |
33 |
url(r'^front/edit/(?P<renkan_guid>[\w-]+)/$', EditRenkanView.as_view(), name='front_edit_renkan'), |
|
34 |
url(r'^front/view/(?P<renkan_guid>[\w-]+)/$', ViewRenkanView.as_view(), name='front_view_renkan'), |
|
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
35 |
url(r'^front/delete/(?P<renkan_guid>[\w-]+)/$', staff_member_required(DeleteRenkanView.as_view()), name='front_delete_renkan') |
| 0 | 36 |
] |
|
15
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
37 |
|
|
8004d8fc9b38
Corrected settings to support deployment in a subdirectory + protected front_list and front_delete so only staff users can access it + added version display in front_list
durandn
parents:
1
diff
changeset
|
38 |
urlpatterns += staticfiles_urlpatterns() |