urls.py 1.45 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
5

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

urlpatterns = patterns('',
Christophe Siraut's avatar
Christophe Siraut committed
11
    url(r'^m/', include('meetingpoll.urls')),
Christophe Siraut's avatar
Christophe Siraut committed
12
    url(r'^accounts/', include('registration.backends.default.urls')),
Christophe Siraut's avatar
Christophe Siraut committed
13
    #url(r'^i18n/', include('django.conf.urls.i18n')),
14 15
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Christophe Siraut's avatar
Christophe Siraut committed
16 17 18 19 20 21 22 23 24 25 26 27
    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
28
    url(r'^(?P<poll_id>\w{4,6})/$',
29
        'meetingpoll.views.vote'),
30
)
christophe siraut's avatar
christophe siraut committed
31

32
urlpatterns += i18n_patterns('',
Christophe Siraut's avatar
Christophe Siraut committed
33 34 35 36 37 38 39 40
    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'),
41
)
Christophe Siraut's avatar
Christophe Siraut committed
42 43 44 45 46

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