Exemplo n.º 1
0
urlpatterns = [
    url(r'^$', index, name='index'),
    url(r'^search/site/$', render, {'template_name': 'static/search_site.html'}, name='search_site'),
    url(r'^search/$', search, name='search'),
    url(r'^login/$', login, name='login'),
    url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),
    url(r'^promo/$', render, {'template_name': 'static/promo.html'}),
    url(r'^about/$', render, {'template_name': 'static/about.html'}),
    url(r'^sitemap/$', render, {'template_name': 'static/sitemap.html'}),
    url(r'^robots\.txt$', include('robots.urls')),
    url(r'^%s/' % settings.TELEGRAM_BOT_URL, telebot),
    url(r'^%s/' % settings.ADMIN_URL, include(admin.site.urls)),
]

urlpatterns += get_sitegate_urls()  # Цепляем URLы от sitegate,
urlpatterns += get_sitemessage_urls()  # Цепляем URLы от sitemessage,

# Используем собственные страницы ошибок.
handler403 = permission_denied
handler404 = page_not_found
handler500 = server_error


if settings.DEBUG:
    # Чтобы рабютала отладочная панель.
    import debug_toolbar
    urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls)),]
    # Чтобы статика раздавалась при runserver.
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 2
0
urlpatterns = patterns(
    '',
    url(r'^$', 'apps.views.index', name='index'),
    url(r'^login/$', 'apps.views.login', name='login'),
    url(r'^logout/$',
        'django.contrib.auth.views.logout', {'next_page': '/'},
        name='logout'),
    url(r'^promo/$', render, {'template_name': 'static/promo.html'}),
    url(r'^search/$', render, {'template_name': 'static/search.html'}),
    url(r'^about/$', render, {'template_name': 'static/about.html'}),
    url(r'^sitemap/$', render, {'template_name': 'static/sitemap.html'}),
    url(r'^%s/' % settings.ADMIN_URL, include(admin.site.urls)),
)

urlpatterns += get_sitegate_urls()  # Цепляем URLы от sitegate,

bootstrap_realms(urlpatterns)  # Инициализируем области

# Используем собственные страницы ошибок.
handler403 = permission_denied
handler404 = page_not_found
handler500 = server_error

if settings.DEBUG:
    # Чтобы рабютала отладочная панель.
    import debug_toolbar
    urlpatterns += patterns(
        '',
        url(r'^__debug__/', include(debug_toolbar.urls)),
    )
Exemplo n.º 3
0
from django.conf.urls import url
from pytest_djangoapp.compat import get_urlpatterns

from sitegate.toolbox import get_sitegate_urls
from .views import login, register, HttpResponse


urlpatterns = get_urlpatterns([
    url(r'entrance/', lambda r: None),
    url(r'^ok/$', lambda r: HttpResponse('ok'), name='ok'),
    url(r'^fail/$', lambda r: HttpResponse('fail'), name='fail'),
    url(r'^login/$', login, name='login'),
    url(r'^register/$', register, name='register'),
] + get_sitegate_urls())