summaryrefslogtreecommitdiffstats
path: root/virtualenv/pffedportal
diff options
context:
space:
mode:
authorThomas NOEL <tnoel@entrouvert.com>2013-12-24 12:18:09 (GMT)
committerThomas NOEL <tnoel@entrouvert.com>2013-12-24 12:18:09 (GMT)
commit825561125b12418f6a1cc79ac185da78f051748a (patch)
treeab854d84515b7cff19101f63325f769b70109c1a /virtualenv/pffedportal
parent705fb7ca09e5586fe0ab0752e5ca1f77536a0b67 (diff)
downloadunivnautes-old-825561125b12418f6a1cc79ac185da78f051748a.zip
univnautes-old-825561125b12418f6a1cc79ac185da78f051748a.tar.gz
univnautes-old-825561125b12418f6a1cc79ac185da78f051748a.tar.bz2
urls.py for django 1.5 (cbv)
Diffstat (limited to 'virtualenv/pffedportal')
-rw-r--r--virtualenv/pffedportal/urls.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/virtualenv/pffedportal/urls.py b/virtualenv/pffedportal/urls.py
index 88f6f5b..725a1d9 100644
--- a/virtualenv/pffedportal/urls.py
+++ b/virtualenv/pffedportal/urls.py
@@ -1,5 +1,8 @@
-from django.conf.urls.defaults import *
-import settings
+from django.conf.urls import *
+from django.views.generic.base import RedirectView
+from django.views.generic import TemplateView
+
+from django.conf import settings
urlpatterns = patterns('',
url(r'^$', 'base.views.index'),
@@ -11,21 +14,13 @@ urlpatterns = patterns('',
)
urlpatterns += patterns('django.views.generic.simple',
- (r'^licences$', 'direct_to_template', {'template': 'licences.html'}),
- (r'^conditions$', 'direct_to_template', {'template': 'conditions.html'}),
+ (r'^licences$', TemplateView.as_view(template_name='licences.html')),
+ (r'^conditions$', TemplateView.as_view(template_name='conditions.html')),
)
if settings.EMAIL_RCPT and settings.EMAIL_HOST:
urlpatterns += patterns('', url(r'^mail$', 'base.views.mail'))
-if settings.STATIC_SERVE:
- urlpatterns += patterns('',
- url(
- regex = r'^media/(?P<path>.*)$',
- view = 'django.views.static.serve',
- kwargs = {'document_root': settings.MEDIA_ROOT}),
- )
-
if settings.DEBUG:
from django.contrib import admin
admin.autodiscover()
@@ -33,11 +28,8 @@ if settings.DEBUG:
(r'^admin/', include(admin.site.urls)),
)
-# fallback : go to index page
+# fallback: go to index page
urlpatterns += patterns('',
- url(
- regex = r'^.*$',
- view = 'django.views.generic.simple.redirect_to',
- kwargs = {'url': '/'})
+ url(r'^.*$', RedirectView.as_view(url='/')),
)