Exemplo n.º 1
0
    real_patterns += [
        url(
            r"^media/(?P<path>.*)$",
            django.views.static.serve,
            {"document_root": settings.MEDIA_ROOT},
        )
    ]

if settings.DEBUG and "debug_toolbar" in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    import debug_toolbar

    real_patterns += [url(r"^__debug__/", include(debug_toolbar.urls))]

if "wlhosted.integrations" in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    from wlhosted.integrations.views import CreateBillingView

    real_patterns += [
        url(r"^create/billing/$", CreateBillingView.as_view(), name="create-billing")
    ]


def get_url_prefix():
    if not settings.URL_PREFIX:
        return ""
    return re.escape(settings.URL_PREFIX.strip("/")) + "/"


urlpatterns = [url(get_url_prefix(), include(real_patterns))]
Exemplo n.º 2
0
        )
    ]

# Django debug toolbar integration
if settings.DEBUG and "debug_toolbar" in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    import debug_toolbar

    real_patterns += [path("__debug__/", include(debug_toolbar.urls))]

# Hosted Weblate integration
if "wlhosted.integrations" in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    from wlhosted.integrations.views import CreateBillingView

    real_patterns += [
        path("create/billing/", CreateBillingView.as_view(), name="create-billing")
    ]

# Django SAML2 Identity Provider
if "djangosaml2idp" in settings.INSTALLED_APPS:
    real_patterns += [
        path("idp/", include("djangosaml2idp.urls")),
    ]

# Handle URL prefix configuration
if not settings.URL_PREFIX:
    urlpatterns = real_patterns
else:
    urlpatterns = [path(settings.URL_PREFIX.strip("/") + "/", include(real_patterns))]
Exemplo n.º 3
0
        url(r'^media/(?P<path>.*)$', django.views.static.serve,
            {'document_root': settings.MEDIA_ROOT}),
    ]

if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    import debug_toolbar
    real_patterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]

if 'wlhosted' in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    from wlhosted.integrations.views import CreateBillingView
    real_patterns += [
        url(
            r'^create/billing/$',
            CreateBillingView.as_view(),
            name='create-billing',
        ),
    ]


def get_url_prefix():
    if not settings.URL_PREFIX:
        return ''
    return re.escape(settings.URL_PREFIX.strip('/')) + '/'


urlpatterns = [url(get_url_prefix(), include(real_patterns))]
Exemplo n.º 4
0
    ]

if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    import debug_toolbar
    real_patterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]

if 'wlhosted' in settings.INSTALLED_APPS:
    # pylint: disable=wrong-import-position
    from wlhosted.integrations.views import CreateBillingView
    real_patterns += [
        url(
            r'^create/billing/$',
            CreateBillingView.as_view(),
            name='create-billing',
        ),
    ]


def get_url_prefix():
    if not settings.URL_PREFIX:
        return ''
    return re.escape(settings.URL_PREFIX.strip('/')) + '/'


urlpatterns = [
    url(get_url_prefix(), include(real_patterns))
]