Exemple #1
0
        # site/subdomain
        CredentialsAPIView.as_view(),
        name='api_credentials_organization'),
    url_direct(r'^api/notifications/(?P<template>%s)/' % ACCT_REGEX,
               NotificationDetailAPIView.as_view(),
               name='api_notification_send_test_email'),
    url_direct(r'^api/notifications/',
               NotificationAPIView.as_view(),
               name='api_notification_base'),
    url_direct(r'^api/proxy/recent/',
               RecentActivityAPIView.as_view(),
               name='api_recent_activity'),
    url_direct(r'^api/proxy/$',
               AppUpdateAPIView.as_view(),
               name='rules_api_app_detail'),
    url_direct(r'^api/', include('rules.urls.api.proxy')),
    url_direct(r'^api/themes/$',
               ThemePackageListAPIView.as_view(),
               name='pages_api_themes'),
    url_direct(r'^api/', include('pages.urls.api')),

    # Billing, Metrics, Profiles, Roles and Subscriptions
    url_prefixed(r'^api/', include('saas.urls.api.cart')),
    # `saas.urls.api.cart`: DELETE implements its own policy
    url_authenticated(r'^api/', include('saas.urls.api.legal')),
    url_self_provider(r'^api/', include('saas.urls.api.users')),
    url_direct(r'^api/', include('saas.urls.api.broker')),
    # api/charges/:charge/refund must be before api/charges/
    url_provider_only(r'^api/', include('saas.urls.api.provider.charges')),
    url_direct(r'^api/', include('saas.urls.api.provider.billing')),
    url_direct(r'^api/', include('saas.urls.api.provider.roles')),
Exemple #2
0
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic.base import RedirectView, TemplateView
from django.views.i18n import JavaScriptCatalog
from rules.urldecorators import include, url
from signup.compat import reverse_lazy
from signup.decorators import fail_authenticated
from signup.forms import NameEmailForm
from signup.views.auth import SignupView

from .forms import SignupWithCaptchaForm

urlpatterns = \
    static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + [
    url(r'^api/',
        include('signup.urls.api.contacts'),
        redirects=[fail_authenticated]),
    url(r'^api/',
        include('signup.urls.api.keys'),
        redirects=[fail_authenticated]),
    url(r'^api/',
        include('signup.urls.api.tokens'),
        redirects=[fail_authenticated]),
    url(r'^api/',
        include('signup.urls.api.users'),
        redirects=[fail_authenticated]),
    url(r'^api/',
        include('signup.urls.api.auth')),
    url(r'^contacts/',
        include('signup.urls.views.contacts'),
        redirects=[fail_authenticated]),
Exemple #3
0
        name='registration_activate_start'),
    url_prefixed(r'^recover/',
        PasswordResetView.as_view(), name='password_reset'),
    url_prefixed(r'^login/', SigninView.as_view(), name='login'),
    url_prefixed(r'^logout/', SignoutView.as_view(), name='logout'),
    url_prefixed(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/', #pylint: disable=line-too-long
        PasswordResetConfirmView.as_view(), name='password_reset_confirm'),

    # Redirects
    url(r'^billing/cart/',
        # XXX override because we want a login_required in front.
        login_required(OrganizationRedirectView.as_view(
                pattern_name='saas_organization_cart'),
                       login_url='registration_register'),
        name='saas_cart'),
    url_authenticated(r'^', include('saas.urls.redirects')),

    # Profiles
    url_authenticated(r'users/roles/accept/$',
        RoleImplicitGrantAcceptView.as_view(),
        name='saas_role_implicit_grant_accept'),
    url_authenticated(r'^', include('saas.urls.request')),
    url_active(r'^users/$',
        UserRedirectView.as_view(), name='accounts_profile'),
    url_self_provider(r'^users/(?P<user>%s)/roles/$' % USERNAME_PAT,
        UserAccessiblesView.as_view(), name='saas_user_product_list'),
    url_self_provider(r'^users/(?P<user>%s)/password/' % USERNAME_PAT,
        UserPasswordUpdateView.as_view(), name='password_change'),
    url_self_provider(r'^users/(?P<user>%s)/pubkey/' % USERNAME_PAT,
        UserPublicKeyUpdateView.as_view(), name='pubkey_update'),
    url_self_provider(r'^users/(?P<user>%s)/notifications/$' % USERNAME_PAT,
Exemple #4
0
admin.autodiscover()

from . import signals


def url_prefixed(regex, view, name=None, redirects=None):
    """
    Returns a urlpattern for public pages.
    """
    return url(r'^' + regex, view, name=name, redirects=redirects)


# admin doc and panel
try:
    urlpatterns = [
        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
        url(r'^admin/', admin.site.urls),
    ]
except ImproperlyConfigured:  # Django <= 1.9
    urlpatterns = [
        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
        url(r'^admin/', include(admin.site.urls)),
    ]

urlpatterns += \
    static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + [
    url(r'^__debug__/', include(debug_toolbar.urls)),
    url(r'^jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
    url_prefixed(r'register/$',
        PersonalRegistrationView.as_view(
            success_url=reverse_lazy('home')),
Exemple #5
0
# Copyright (c) 2020, DjaoDjin inc.
# see LICENSE.
"""
API URLs
"""
from rules.urldecorators import include, url
from pages.settings import PATH_RE

from ...api.campaigns import CampaignListAPIView

urlpatterns = [
    # URLs for content editors
    url(r'^content/',
        include('envconnect.urls.api.editors'),
        decorators=['envconnect.decorators.requires_content_manager']),
    # URLs for authenticated readers (upvote, downvote, etc.)
    url(r'^content/', include('answers.urls.api')),
    # URLs for unauthenticated readers (content tree)
    url(r'^content(?P<path>%s)/?' % PATH_RE,
        CampaignListAPIView.as_view(),
        name='api_campgains'),
    url(r'^content/', include('pages.urls.api.readers')),
    # URLs for assessments
    url(r'^', include('envconnect.urls.api.suppliers')),
]
Exemple #6
0
# Copyright (c) 2020, DjaoDjin inc.
# see LICENSE

from django.conf import settings
from django.views.generic import TemplateView
from multitier.urlresolvers import site_patterns
from rules.urldecorators import include, url

if settings.DEBUG:
    from django.views.defaults import server_error
    from ..views.errors import permission_denied, page_not_found
    urlpatterns = site_patterns(
        url(r'^403/$', permission_denied), url(r'^404/$', page_not_found),
        url(r'^500/$', server_error),
        url(r'^register/disabled/$',
            TemplateView.as_view(template_name='accounts/disabled.html')))
else:
    urlpatterns = []

urlpatterns += site_patterns(
    url(r'^', include('djaoapp.urls.api')),
    url(r'^', include('djaoapp.urls.views')),
)
Exemple #7
0
from django.views.static import serve as static_serve
from pages.settings import PATH_RE, SLUG_RE
from rules.urldecorators import include, url

from ..urlbuilders import url_prefixed, url_authenticated, url_direct
from ..views.redirects import AccountRedirectView, MyTSPRedirectView
from ..views.index import IndexView

if settings.DEBUG:  #pylint: disable=no-member
    from django.views.defaults import page_not_found, server_error
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    import debug_toolbar

    urlpatterns = staticfiles_urlpatterns()
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
        url(r'^envconnect%s(?P<path>.*)$' % settings.MEDIA_URL, static_serve,
            {'document_root': settings.MEDIA_ROOT}),
        url(r'^404/$', page_not_found),
        url(r'^500/$', server_error),
    ]
else:
    urlpatterns = [
        url(r'^envconnect/(?P<path>static/.*)$', static_serve,
            {'document_root': settings.HTDOCS}),
        url(r'^(?P<path>static/.*)$', static_serve,
            {'document_root': settings.HTDOCS}),
        url(r'^media/envconnect/(?P<path>.*)$', static_serve,
            {'document_root': settings.MEDIA_ROOT}),
    ]
Exemple #8
0
        AccountRedirectView.as_view(
            pattern_name='improve_organization_redirect',
            new_account_url=site_prefixed('/users/roles/accept/')),
        name='improve_redirect'),
    url(r'app/complete(?P<path>%s)/' % PATH_RE,
        AccountRedirectView.as_view(
            pattern_name='complete_organization_redirect',
            new_account_url=site_prefixed('/users/roles/accept/')),
        name='complete_redirect'),
    url(r'app/scorecard(?P<path>%s)/' % PATH_RE,
        AccountRedirectView.as_view(
            pattern_name='scorecard_organization_redirect',
            new_account_url=site_prefixed('/users/roles/accept/')),
        name='scorecard_redirect'),
    url(r'app/share(?P<path>%s)/' % PATH_RE,
        AccountRedirectView.as_view(
            pattern_name='share_organization',
            new_account_url=site_prefixed('/users/roles/accept/')),
        name='share_redirect'),
    url(r'app/info(?P<path>%s)/download/content/' % PATH_RE,
        ContentDetailXLSXView.as_view(),
        name='summary_download_content'),
    url(r'app/info(?P<path>%s)/download/' % PATH_RE,
        DetailXLSXView.as_view(),
        name='summary_download'),
    url(r'app/info(?P<path>%s)/' % PATH_RE,
        DetailView.as_view(),
        name='summary'),
    url(r'app/comments/', include('django_comments.urls')),
]
Exemple #9
0
handler404 = 'djaoapp.views.errors.page_not_found'

if settings.DEBUG:
    from django.contrib import admin
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.conf.urls.static import static
    import debug_toolbar

    # admin doc and panel
    try:
        # We cannot include admin panels because a `check` for DjangoTemplates
        # will fail when we are using Jinja2 templates.
        admin.autodiscover()
        try:
            urlpatterns = [
                url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
                url(r'^admin/', admin.site.urls),
            ]
        except ImproperlyConfigured:  # Django <= 1.9
            urlpatterns = [
                url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
                url(r'^admin/', include(admin.site.urls)),
            ]
    except LookupError:
        pass

    urlpatterns = staticfiles_urlpatterns() \
        + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
        url(r'^csrf-error/',
        SuppliersAssessmentsXLSXView.as_view(),
        name='reporting_organization_assess_download'),
    url(r'app/(?P<organization>%s)/reporting(?P<path>%s)/download/'
        % (SLUG_RE, PATH_RE),
        SuppliersSummaryXLSXView.as_view(),
        name='reporting_organization_download'),
    url(r'app/(?P<organization>%s)/reporting(?P<path>%s)/'
        % (SLUG_RE, PATH_RE),
        SuppliersView.as_view(),
        name='reporting_organization'),

    url(r'app/(?P<organization>%s)/portfolios(?P<path>%s)/'
        % (SLUG_RE, NON_EMPTY_PATH_RE),
        PortfoliosDetailView.as_view(), name='matrix_chart'),
    url(r'app/(?P<organization>%s)/portfolios/' % SLUG_RE,
        include('survey.urls.matrix')),

    # Assessments
    url(r'app/(?P<organization>%s)/assess/(?P<sample>%s)/'\
        'intro(?P<path>%s)/' % (SLUG_RE,
        SLUG_RE, PATH_RE), AssessmentView.as_view(),
        name='assess_intro'),
    url(r'app/(?P<organization>%s)/assess/(?P<sample>%s)/'\
        'download(?P<path>%s)/' % (SLUG_RE,
        SLUG_RE, PATH_RE), AssessmentXLSXView.as_view(),
        name='assess_organization_sample_download'),
    url(r'app/(?P<organization>%s)/assess/(?P<sample>%s)/'\
        'content(?P<path>%s)/' % (SLUG_RE,
        SLUG_RE, PATH_RE), AssessmentView.as_view(),
        name='assess_organization'),
    url(r'app/(?P<organization>%s)/assess/new/' % SLUG_RE,