urls.py 1.44 KB
Newer Older
1
from django.conf.urls import patterns, include, url
2
from django.conf.urls.i18n import i18n_patterns
Christophe Siraut's avatar
Christophe Siraut committed
3 4
from meetingpoll.models import Poll
from django.views.generic import TemplateView, ListView
chris's avatar
chris committed
5

6
# Enable the admin:
chris's avatar
chris committed
7 8
from django.contrib import admin
admin.autodiscover()
chris's avatar
chris committed
9

10 11
urlpatterns = patterns(
    '',
12
    url(r'^m/', include('meetingpoll.urls')),
13 14
    url(r'^accounts/', include('allauth.urls')),
    url(r'^i18n/', include('django.conf.urls.i18n')),
15 16
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Christophe Siraut's avatar
Christophe Siraut committed
17 18 19 20 21 22 23 24 25 26 27 28
    url(r'^$',
        ListView.as_view(
            queryset=Poll.objects.all(),
            template_name='index.html'),
        name='home'),
    url(r'^nuages/$',
        TemplateView.as_view(template_name='nuages.html'),
        name='documentation'),
    url(r'^languages/$',
        TemplateView.as_view(template_name='languages.html'),
        name='languages'),
    url(r'^accounts/profile/$', 'meetingpoll.views.profile', name='profile'),
Christophe Siraut's avatar
Christophe Siraut committed
29
    url(r'^(?P<poll_id>\w{4,6})/$',
30
        'meetingpoll.views.vote'),
chris's avatar
chris committed
31
)
chris's avatar
chris committed
32

33 34
urlpatterns += i18n_patterns(
    '',
Christophe Siraut's avatar
Christophe Siraut committed
35 36 37 38 39 40 41 42
    url(r'^nuages/$',
        TemplateView.as_view(template_name='nuages.html'),
        name='documentation_translated'),
    url(
        r'^$', ListView.as_view(
            queryset=Poll.objects.all(),
            template_name='index.html'),
        name='home_translated'),
43
)
Christophe Siraut's avatar
Christophe Siraut committed
44 45 46 47 48

try:
    from local_urls import *
except ImportError, e:
    pass