示例#1
0
def prefix_url(url):
    """
    Add url prefix defined in `settings.py` to url.
    """
    if not url or url == '/':
        return '/{}/'.format(URL_PREFIX.strip('/'))
    else:
        return '/{0}/{1}/'.format(URL_PREFIX.strip('/'), url.strip('/'))
示例#2
0
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

app_patterns = patterns('',
    url(r'^$', 'trendminer.views.home', name='home'),

    (r'^login/$', 'trendminer.views.login',
     {'template_name': 'login.html'}),

    (r'^logout/$', 'trendminer.views.logout',
     {'next_page': HOME_URL}),

    url(r'^analyse/$', 'trendminer.views.analyse', name='analyse'),
    url(r'^analyse/(?P<request_id>\d{4}(-\d{2}){2}_(\d{2}-){2}\d{2}_.*)' \
      r'/(?P<page>[1-9]\d*)/$', 'trendminer.views.analyse', name='results'),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)

if URL_PREFIX:
    urlpatterns = patterns('',
        ('^{}/'.format(URL_PREFIX.strip('/')), include(app_patterns)),
    )
else:
    urlpatterns = app_patterns