server/src/metaeducation/urls.py
author durandn
Thu, 10 Mar 2016 13:32:18 +0100
changeset 15 8004d8fc9b38
parent 1 5f50937893ac
child 73 f64fb2da5a54
permissions -rw-r--r--
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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
"""metaeducation URL Configuration
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
The `urlpatterns` list routes URLs to views. For more information please see:
1
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
     4
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
0
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
Examples:
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
Function views
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    1. Add an import:  from my_app import views
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
Class-based views
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    1. Add an import:  from other_app.views import Home
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
Including another URLconf
1
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    13
    1. Add an import:  from blog import urls as blog_urls
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    14
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
0
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
"""
1
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    16
from django.conf.urls import include, url
0
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    23
from .views import ListRenkansView, NewRenkanView, EditRenkanView, ViewRenkanView, DeleteRenkanView
0
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
urlpatterns = [
1
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    27
    url(r'^$', RedirectView.as_view(url=reverse_lazy("front_list_renkans"))),
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    28
    url(r'^admin/', include(admin.site.urls)),
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    29
    url(r'^api/', include('renkanmanager.urls')),
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    32
    url(r'^front/new/$', NewRenkanView.as_view(), name='front_new_renkan'),
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    33
    url(r'^front/edit/(?P<renkan_guid>[\w-]+)/$', EditRenkanView.as_view(), name='front_edit_renkan'),
5f50937893ac Commit work on metaeducation
durandn
parents: 0
diff changeset
    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
71a42c20fc86 first project structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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()