Beispiel #1
0
from django.conf.urls import url

from moj_irat.views import HealthcheckView, PingJsonView

urlpatterns = [
    url(r'^ping.json$',
        PingJsonView.as_view(
            build_date_key='APP_BUILD_DATE',
            commit_id_key='APP_GIT_COMMIT',
            version_number_key='APP_BUILD_TAG',
            build_tag_key='JENKINS_TAG',
        ),
        name='ping_json'),
    url(r'^healthcheck.json$',
        HealthcheckView.as_view(),
        name='healthcheck_json'),
]
        r"^reset-password-done/$",
        auth_views.reset_password_done,
        {
            "template_name": "mtp_common/auth/reset-password-done.html",
            "cancel_url": reverse_lazy("bank_admin:dashboard"),
        },
        name="reset_password_done",
    ),
    url(r"^", include("bank_admin.urls", namespace="bank_admin")),
    url(r"^", include("feedback.urls")),
    url(r"^404.html$", lambda request: TemplateResponse(request, "mtp_common/errors/404.html", status=404)),
    url(r"^500.html$", lambda request: TemplateResponse(request, "mtp_common/errors/500.html", status=500)),
)

urlpatterns += [
    url(
        r"^ping.json$",
        PingJsonView.as_view(
            build_date_key="APP_BUILD_DATE", commit_id_key="APP_GIT_COMMIT", version_number_key="APP_BUILD_TAG"
        ),
        name="ping_json",
    ),
    url(r"^healthcheck.json$", HealthcheckView.as_view(), name="healthcheck_json"),
    url(r"^favicon.ico$", RedirectView.as_view(url=settings.STATIC_URL + "images/favicon.ico", permanent=True)),
    url(r"^robots.txt$", lambda request: HttpResponse("User-agent: *\nDisallow: /", content_type="text/plain")),
]

handler404 = "mtp_common.views.page_not_found"
handler500 = "mtp_common.views.server_error"
handler400 = "mtp_common.views.bad_request"
 def call_ping_json_view(self, **view_kwargs):
     view = PingJsonView.as_view(**view_kwargs)
     request = HttpRequest()
     request.method = 'GET'
     response = view(request)
     return response, json.loads(response.content.decode('utf-8'))
Beispiel #4
0
    url(r'^terms/$', CacheableTemplateView.as_view(template_name='terms.html'), name='terms'),
    url(r'^privacy/$', CacheableTemplateView.as_view(template_name='privacy.html'), name='privacy'),
    url(r'^cookies/$', CookiesView.as_view(), name='cookies'),
    url(r'^accessibility/$', CacheableTemplateView.as_view(template_name='accessibility.html'), name='accessibility'),

    url(r'^js-i18n.js$', cache_control(public=True, max_age=86400)(JavaScriptCatalog.as_view()), name='js-i18n'),

    url(r'^404.html$', lambda request: TemplateResponse(request, 'mtp_common/errors/404.html', status=404)),
    url(r'^500.html$', lambda request: TemplateResponse(request, 'mtp_common/errors/500.html', status=500)),
)

urlpatterns += [
    url(r'^ping.json$', PingJsonView.as_view(
        build_date_key='APP_BUILD_DATE',
        commit_id_key='APP_GIT_COMMIT',
        version_number_key='APP_BUILD_TAG',
    ), name='ping_json'),
    url(r'^healthcheck.json$', HealthcheckView.as_view(), name='healthcheck_json'),
    url(r'^metrics.txt$', metrics_view, name='prometheus_metrics'),

    url(r'^robots.txt$', robots_txt_view),
    url(r'^sitemap.xml$', SitemapXMLView.as_view(), name='sitemap_xml'),

    url(r'^favicon.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'images/favicon.ico', permanent=True)),
]

handler404 = 'mtp_common.views.page_not_found'
handler500 = 'mtp_common.views.server_error'
handler400 = 'mtp_common.views.bad_request'
    url(r'^', include('transaction.urls')),
    url(r'^', include('account.urls')),
    url(r'^', include('payment.urls')),
    url(r'^', include('credit.urls')),
    url(r'^', include('security.urls')),
    url(r'^', include('service.urls')),
    url(r'^', include('disbursement.urls')),
    url(r'^', include('core.urls')),
    url(r'^', include('notification.urls')),
    url(r'^performance-dashboard/$', PerformanceDashboardView.as_view(), name='performance_dashboard'),

    url(r'^oauth2/', include(('oauth2_provider.urls', 'oauth2_provider'), namespace='oauth2_provider')),
    url(r'^admin/', admin.site.urls),
    url(r'^admin/', include('django.conf.urls.i18n')),

    url(r'^ping.json$', PingJsonView.as_view(
        build_date_key='APP_BUILD_DATE',
        commit_id_key='APP_GIT_COMMIT',
        version_number_key='APP_BUILD_TAG',
    ), name='ping_json'),
    url(r'^healthcheck.json$', HealthcheckView.as_view(), name='healthcheck_json'),

    url(r'^favicon.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'images/favicon.ico', permanent=True)),
    url(r'^robots.txt$', lambda request: HttpResponse('User-agent: *\nDisallow: /', content_type='text/plain')),

    url(r'^404.html$', lambda request: HttpResponse(_('Page not found'),
                                                    content_type='text/plain', status=404)),
    url(r'^500.html$', lambda request: HttpResponse(_('Sorry, something went wrong'),
                                                    content_type='text/plain', status=500)),
]
Beispiel #6
0
 def call_ping_json_view(self, **view_kwargs):
     view = PingJsonView.as_view(**view_kwargs)
     request = HttpRequest()
     request.method = 'GET'
     response = view(request)
     return response, json.loads(response.content.decode('utf-8'))
handler500 = "make_a_plea.views.server_error"

urlpatterns = [
    url(r"^$", views.start, name="home"),
    url(r"^helping-you-plead-online/$", views.TranslatedView.as_view(template_name="ad_support.html"), name="ad_support"),
    url(r"^terms-and-conditions-and-privacy-policy/$", views.TranslatedView.as_view(template_name="terms.html"), name="terms"),
    url(r"^plea/", include("apps.plea.urls", )),
    url(r"^receipt/", include("apps.receipt.urls")),
    url(r"^feedback/", include("apps.feedback.urls")),
    url(r"^reports/", include("apps.reports.urls", namespace='reports')),
    url(r"^admin/", include(admin.site.urls)),
    url(r'^nested_admin/', include('nested_admin.urls')),
    url(r"^court-finder/$", CourtFinderView.as_view(), name="court_finder"),
    url(r"^change-language/$", views.set_language, name="set_language"),
    url(r"^set-a11y-testing/$", views.set_a11y_testing, name="set_a11y_testing"),
    url(r"^session-timeout/$", TemplateView.as_view(template_name="session_timeout.html"), name="session_timeout"),
    url(r"^", include("apps.monitoring.urls")),
    url(r"^test-template/$", views.test_template, name="test_template"),
    url(r"^test-email-attachment/$", views.test_email_attachment, name="test_email_attachment"),
    url(r"^test-resulting-email/$", views.test_resulting_email, name="test_resulting_email"),
    url(r'^healthcheck$', HealthcheckView.as_view(), name='healthcheck'),
    url(r'^ping.json$', PingJsonView.as_view(
        build_date_key="APP_BUILD_DATE",
        commit_id_key="APP_GIT_COMMIT",
        build_tag_key="APP_BUILD_TAG"
    ), name='ping_json'),
    url(r'^500.html$', TemplateView.as_view(template_name="500.html"), name='500_page'),
    url(r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'images/favicon.ico', permanent=True)),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin

from moj_irat.views import PingJsonView, HealthcheckView

urlpatterns = [
    url(r'^api/v1/', include('api.urls')),
    url(r'^ping.json$',
        PingJsonView.as_view(**settings.PING_JSON_KEYS),
        name='ping_json'),
    url(r'^healthcheck.json$',
        HealthcheckView.as_view(),
        name='healthcheck_json'),
]

if settings.ADMIN_ENABLED:
    urlpatterns.append(url(r'^admin/', admin.site.urls))
handler500 = "make_a_plea.views.server_error"

urlpatterns = [
    url(r"^$", views.start, name="home"),
    url(r"^helping-you-plead-online/$", views.TranslatedView.as_view(template_name="ad_support.html"), name="ad_support"),
    url(r"^terms-and-conditions-and-privacy-policy/$", views.TranslatedView.as_view(template_name="terms.html"), name="terms"),
    url(r"^plea/", include("apps.plea.urls", )),
    url(r"^receipt/", include("apps.receipt.urls")),
    url(r"^feedback/", include("apps.feedback.urls")),
    url(r"^reports/", include("apps.reports.urls", namespace='reports')),
    url(r"^admin/", include(admin.site.urls)),
    url(r'^nested_admin/', include('nested_admin.urls')),
    url(r"^court-finder/$", CourtFinderView.as_view(), name="court_finder"),
    url(r"^change-language/$", views.set_language, name="set_language"),
    url(r"^set-a11y-testing/$", views.set_a11y_testing, name="set_a11y_testing"),
    url(r"^session-timeout/$", TemplateView.as_view(template_name="session_timeout.html"), name="session_timeout"),
    url(r"^", include("apps.monitoring.urls")),
    url(r"^test-template/$", views.test_template, name="test_template"),
    url(r"^test-email-attachment/$", views.test_email_attachment, name="test_email_attachment"),
    url(r"^test-resulting-email/$", views.test_resulting_email, name="test_resulting_email"),
    url(r'^healthcheck$', HealthcheckView.as_view(), name='healthcheck'),
    url(r'^ping.json$', PingJsonView.as_view(
        build_date_key="APP_BUILD_DATE",
        commit_id_key="APP_GIT_COMMIT",
        build_tag_key="APP_BUILD_TAG"
    ), name='ping_json'),
    url(r'^500.html$', TemplateView.as_view(template_name="500.html"), name='500_page'),
    url(r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'images/favicon.ico', permanent=True)),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)