server/src/metaeducation/urls.py
changeset 1 5f50937893ac
parent 0 71a42c20fc86
child 15 8004d8fc9b38
--- a/server/src/metaeducation/urls.py	Mon Jan 25 17:28:14 2016 +0100
+++ b/server/src/metaeducation/urls.py	Tue Feb 16 15:43:00 2016 +0100
@@ -1,7 +1,7 @@
 """metaeducation URL Configuration
 
 The `urlpatterns` list routes URLs to views. For more information please see:
-    https://docs.djangoproject.com/en/1.9/topics/http/urls/
+    https://docs.djangoproject.com/en/1.8/topics/http/urls/
 Examples:
 Function views
     1. Add an import:  from my_app import views
@@ -10,12 +10,24 @@
     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. Import the include() function: from django.conf.urls import url, include
-    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
+    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 url
+from django.conf.urls import include, url
 from django.contrib import admin
+from django.views.generic import RedirectView
+from django.core.urlresolvers import reverse_lazy
+from django.contrib.auth.decorators import login_required
+from .views import ListRenkansView, NewRenkanView, EditRenkanView, ViewRenkanView, DeleteRenkanView
 
 urlpatterns = [
-    url(r'^admin/', admin.site.urls),
+    url(r'^$', RedirectView.as_view(url=reverse_lazy("front_list_renkans"))),
+    url(r'^admin/', include(admin.site.urls)),
+    url(r'^api/', include('renkanmanager.urls')),
+    url(r'^accounts/', include('allauth.urls')),
+    url(r'^front/list/$', ListRenkansView.as_view(), name='front_list_renkans'),
+    url(r'^front/new/$', NewRenkanView.as_view(), name='front_new_renkan'),
+    url(r'^front/edit/(?P<renkan_guid>[\w-]+)/$', EditRenkanView.as_view(), name='front_edit_renkan'),
+    url(r'^front/view/(?P<renkan_guid>[\w-]+)/$', ViewRenkanView.as_view(), name='front_view_renkan'),
+    url(r'^front/delete/(?P<renkan_guid>[\w-]+)/$', DeleteRenkanView.as_view(), name='front_delete_renkan')
 ]