Esempio n. 1
0
def apply_decorators(  # noqa: C901
        view=None,
        login=False,
        staff=False,
        perms=None,
        cache=None,
        gzip=False,
        xframe=None,
        csrf=None,
        decorators=(),
):
    """
    Apply decorators to view function. Can also be used as a decorator.
    """

    if view is None:
        kwargs = locals()
        kwargs.pop("view")
        return lambda view: apply_decorators(view, **kwargs)

    # Cache control
    if cache is False:
        view = never_cache(view)
    elif cache is not None:
        view = cache_control(**cache)(view)

    # Permissions
    # (We keep the implementation here, but those options are not handled by
    #  this decorator anymore).
    if login:
        view = login_required(view)
    if perms:
        view = permission_required(perms)(view)
    if staff:
        view = staff_required(view)

    # Compression
    if gzip:
        view = gzip_page(view)

    # Security
    if xframe is False:
        view = xframe_options_exempt(view)
    elif xframe == "deny":
        view = xframe_options_deny(view)
    elif xframe == "sameorigin":
        view = xframe_options_sameorigin(view)
    if csrf is False:
        view = csrf_exempt(view)
    elif csrf == "cookie":
        view = ensure_csrf_cookie(view)
    elif csrf == "token":
        view = requires_csrf_token(view)
    elif csrf is True:
        view = csrf_protect(view)

    # Apply final decorators
    for decorator in reversed(decorators):
        view = decorator(view)
    return view
Esempio n. 2
0
def apply_decorators(
    view=None,
    login=False,
    staff=False,
    perms=None,  # noqa: C901
    cache=None,
    gzip=False,
    xframe=None,
    csrf=None,
    decorators=()):
    """
    Apply decorators to view function. Can also be used as a decorator.
    """

    if view is None:
        kwargs = locals()
        kwargs.pop('view')
        return lambda view: apply_decorators(view, **kwargs)

    # Cache control
    if cache is False:
        view = never_cache(view)
    elif cache is not None:
        view = cache_control(**cache)(view)

    # Permissions
    if login:
        view = login_required(view)
    if perms:
        view = permission_required(perms)(view)
    if staff:
        view = staff_required(view)

    # Compression
    if gzip:
        view = gzip_page(view)

    # Security
    if xframe is False:
        view = xframe_options_exempt(view)
    elif xframe == 'deny':
        view = xframe_options_deny(view)
    elif xframe == 'sameorigin':
        view = xframe_options_sameorigin(view)
    if csrf is False:
        view = csrf_exempt(view)
    elif csrf == 'cookie':
        view = ensure_csrf_cookie(view)
    elif csrf == 'token':
        view = requires_csrf_token(view)
    elif csrf is True:
        view = csrf_protect(view)

    # Apply final decorators
    for decorator in reversed(decorators):
        view = decorator(view)
    return view
Esempio n. 3
0
 def as_view(cls, **kwargs):
     """
     Optionally decorates the base view with the
     django.views.decorators.clickjacking.xframe_options_exempt() decorator.
     
     """
     view = super(XFrameOptionsExempt, cls).as_view(**kwargs)
     return (
         clickjacking.xframe_options_exempt(view)
             if cls.xframe_options_exempt
             else view)
Esempio n. 4
0
    def get(self, request):
        # Leave validation to GiosgappTriggerContext object
        try:
            trigger = GiosgappTriggerContext(request, settings.GIOSG_APP_SECRET)
            handler = getattr(self, 'on_'+trigger.type, self.__unsupported_trigger_type)
            if trigger.type == 'manual_dialog' or trigger.type == 'manual_nav':
                handler = xframe_options_exempt(handler)
            return handler(request, trigger)

        # Handle any giosg-auth-token validation errors
        except ValueError as e:
            return HttpResponseBadRequest(e)
Esempio n. 5
0
File: urls.py Progetto: pdflu/CPDB
from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.decorators.clickjacking import xframe_options_exempt

from embed.views.embed_view import EmbedView

cache_view = cache_page(86400 * 90)

urlpatterns = [
    url(r'^$',
        xframe_options_exempt(cache_view(EmbedView.as_view())),
        name='embed'),
]
Esempio n. 6
0
def map_index(request,
              mode=None,
              slug=None,
              slug2=None,
              details=None,
              options=None,
              nearby=None,
              level=None,
              x=None,
              y=None,
              zoom=None,
              embed=None):

    # check for access token
    access_signed_data = request.GET.get('access')
    if access_signed_data:
        try:
            token = AccessPermissionForm.load_signed_data(access_signed_data)
        except SignedPermissionDataError as e:
            return HttpResponse(str(e).encode(),
                                content_type='text/plain',
                                status=400)

        num_restrictions = len(token.restrictions)
        with transaction.atomic():
            token.save()

            if not request.user.is_authenticated:
                messages.info(request,
                              _('You need to log in to unlock areas.'))
                request.session['redeem_token_on_login'] = str(token.token)
                token.redeem()
                return redirect_to_login(request.path_info, 'site.login')

            token.redeem(request.user)
            token.save()

        messages.success(
            request,
            ungettext_lazy('Area successfully unlocked.',
                           'Areas successfully unlocked.', num_restrictions))
        return redirect('site.index')

    origin = None
    destination = None
    routing = False
    if slug2 is not None:
        routing = True
        origin = check_location(slug, request)
        destination = check_location(slug2, request)
    else:
        routing = (mode and mode != 'l')
        if mode == 'o':
            origin = check_location(slug, request)
        else:
            destination = check_location(slug, request)

    state = {
        'routing':
        routing,
        'origin':
        (origin.serialize(detailed=False, simple_geometry=True, geometry=False)
         if origin else None),
        'destination': (destination.serialize(
            detailed=False, simple_geometry=True, geometry=False)
                        if destination else None),
        'sidebar':
        routing or destination is not None,
        'details':
        True if details else False,
        'options':
        True if options else False,
        'nearby':
        True if nearby else False,
    }

    levels = levels_by_short_label_for_request(request)

    level = levels.get(level, None) if level else None
    if level is not None:
        state.update({
            'level': level.pk,
            'center': (float(x), float(y)),
            'zoom': float(zoom),
        })

    initial_bounds = settings.INITIAL_BOUNDS
    if not initial_bounds:
        initial_bounds = tuple(chain(*Source.max_bounds()))

    ctx = {
        'bounds':
        json.dumps(Source.max_bounds(), separators=(',', ':')),
        'levels':
        json.dumps(tuple(
            (level.pk, level.short_label) for level in levels.values()),
                   separators=(',', ':')),
        'state':
        json.dumps(state, separators=(',', ':'), cls=DjangoJSONEncoder),
        'tile_cache_server':
        settings.TILE_CACHE_SERVER,
        'initial_level':
        settings.INITIAL_LEVEL,
        'primary_color':
        settings.PRIMARY_COLOR,
        'initial_bounds':
        json.dumps(initial_bounds, separators=(',', ':'))
        if initial_bounds else None,
        'last_site_update':
        json.dumps(SiteUpdate.last_update()),
        'ssids':
        json.dumps(settings.WIFI_SSIDS, separators=(',', ':'))
        if settings.WIFI_SSIDS else None,
        'random_location_groups':
        (','.join(str(i) for i in settings.RANDOM_LOCATION_GROUPS)
         if settings.RANDOM_LOCATION_GROUPS else None),
        'editor':
        can_access_editor(request),
        'embed':
        bool(embed),
    }

    if grid.enabled:
        ctx['grid'] = json.dumps(
            {
                'rows': grid.rows,
                'cols': grid.cols,
                'invert_x': grid.invert_x,
                'invert_y': grid.invert_y,
            },
            separators=(',', ':'),
            cls=DjangoJSONEncoder)

    csrf.get_token(request)

    if not embed:
        announcement = Announcement.get_current()
        if announcement:
            messages.info(request, announcement.text)

    response = render(request, 'site/map.html', ctx)
    set_tile_access_cookie(request, response)
    if embed:
        xframe_options_exempt(lambda: response)()
    return response
Esempio n. 7
0
    re_path(r"^$", views.SnippetView.as_view(), name="snippet_new"),
    re_path(
        r"^about/$",
        cache_control(max_age=config.CACHE_TIMEOUT)(TemplateView.as_view(
            template_name="dpaste/about.html",
            extra_context=config.extra_template_context,
        )),
        name="dpaste_about",
    ),
    re_path(r"^history/$",
            views.SnippetHistory.as_view(),
            name="snippet_history"),
    re_path(
        r"^(?P<snippet_id>[a-zA-Z0-9]{%d,})/?$" % L,
        views.SnippetDetailView.as_view(),
        name="snippet_details",
    ),
    re_path(
        r"^(?P<snippet_id>[a-zA-Z0-9]{%d,})/raw/?$" % L,
        views.SnippetRawView.as_view(),
        name="snippet_details_raw",
    ),
    re_path(
        r"^(?P<snippet_id>[a-zA-Z0-9]{%d,})/slim/?$" % L,
        xframe_options_exempt(
            views.SnippetDetailView.as_view(
                template_name="dpaste/details_slim.html")),
        name="snippet_details_slim",
    ),
]
Esempio n. 8
0
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^rosetta/', include('rosetta.urls')),
    url(r'', include(two_factor_urls)),
]

schema_view = get_swagger_view(title='Billing API')

urlpatterns += i18n_patterns(
    url(r'^ajax_select/', include(ajax_select_urls)),
    url(r'^swagger/', schema_view),
    url(r'^adminactions/', include('adminactions.urls')),
    url(r'^finances/',
        include(('finances.urls', 'finances'), namespace='finances')),
    url(r'^billing/processing$',
        xframe_options_exempt(
            TemplateView.as_view(template_name='billing/processing.html')),
        name='billing-processing'),
    url(r'^billing/payment-successful$',
        xframe_options_exempt(
            TemplateView.as_view(
                template_name='billing/payment_successful.html')),
        name='billing-payment-successful'),
    url(r'^billing/fail$',
        xframe_options_exempt(
            TemplateView.as_view(template_name='billing/fail.html')),
        name='billing-fail'),
    url(r'^', include(router.urls)),
)

if settings.DEBUG:
    import debug_toolbar
Esempio n. 9
0
    HomeView,
    ElectionDetailView,
    CandidateDetailView,
    FaceToFaceView,
    AreaDetailView,
    KnowYourCandidatesView,
)

from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.decorators.cache import cache_page

media_root = getattr(settings, 'MEDIA_ROOT', '/')

urlpatterns = [
    path('',
         cache_page(60 * settings.CACHE_MINUTES)(xframe_options_exempt(
             HomeView.as_view())),
         name='home'),
    path('buscar',
         SearchView(template='search.html', form_class=ElectionForm),
         name='search'),
    path('busqueda_tags',
         ElectionsSearchByTagView.as_view(),
         name='tags_search'),
    path('eleccion/<slug:slug>',
         ElectionDetailView.as_view(
             template_name='elections/election_detail.html'),
         name='election_view'),
    path('eleccion/<slug:slug>/questionary',
         ElectionDetailView.as_view(
             template_name='elections/election_questionary.html'),
         name='questionary_detail_view'),
Esempio n. 10
0
File: urls.py Progetto: invinst/CPDB
from django.conf.urls import url
from django.views.decorators.cache import cache_page
from django.views.decorators.clickjacking import xframe_options_exempt

from embed.views.embed_view import EmbedView

cache_view = cache_page(86400 * 90)


urlpatterns = [
    url(r'^$', xframe_options_exempt(cache_view(EmbedView.as_view())), name='embed'),
]
Esempio n. 11
0
from django.conf.urls import patterns, url, include
from django.views.decorators.cache import cache_page
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.generic import TemplateView

from fb_fangates.models import FanGate
from fb_fangates.views import FanGateView

urlpatterns = patterns('',
    url(r'^channel/$', cache_page(60*60*24*365)(TemplateView.as_view(template_name='fb/channel.html')), name='fb_channel'),
    url(r'^(?P<pk>\d+)/$', xframe_options_exempt(csrf_exempt(FanGateView.as_view())), name='fb_fangate'),
)
Esempio n. 12
0
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = patterns(
    '',
    url(r'^$', views.IndexView.as_view(), name='home'),
    url(r'^blog/$', views.BlogListView.as_view(), name='blog_index'),
    url(r'^blog/(?P<year>\d{4})/(?P<month>(10|11|12|\d))/(?P<day>(\d|1\d|2\d|30|31))/(?P<slug>[-\w]+)/$',
        views.BlogArticleView.as_view(),
        name='blog_article'),
    url(r'^events/$', views.EventListView.as_view(), name='event_index'),
    url(r'^videos/$', views.VideoIndex.as_view(), name='video_index'),
    url(r'^videos/(?P<slug>[-_\w]+)/$',
        views.VideoDetailView.as_view(),
        name='video_detail'),
    url(r'^live/embed/',
        xframe_options_exempt(
            TemplateView.as_view(template_name="liveembed.html")),
        name='liveembed'),
    url(r'^live/',
        TemplateView.as_view(template_name="live.html"),
        name='live'),
    url(r'^tech/',
        TemplateView.as_view(template_name="tech.html"),
        name='tech'),
    url(r'^services/',
        TemplateView.as_view(template_name="services.html"),
        name='services'),
    url(r'^contact/',
        TemplateView.as_view(template_name="contact.html"),
        name='contact'),
    url(r'^questions-live/',
        views.QuestionsLiveCreateView.as_view(),
Esempio n. 13
0
def map_index(request, mode=None, slug=None, slug2=None, details=None, options=None,
              level=None, x=None, y=None, zoom=None, embed=None):

    # check for access token
    access_signed_data = request.GET.get('access')
    if access_signed_data:
        try:
            token = AccessPermissionForm.load_signed_data(access_signed_data)
        except SignedPermissionDataError as e:
            return HttpResponse(str(e).encode(), content_type='text/plain', status=400)

        num_restrictions = len(token.restrictions)
        with transaction.atomic():
            token.save()

            if not request.user.is_authenticated:
                messages.info(request, _('You need to log in to unlock areas.'))
                request.session['redeem_token_on_login'] = str(token.token)
                token.redeem()
                return redirect_to_login(request.path_info, 'site.login')

            token.redeem(request.user)
            token.save()

        messages.success(request, ungettext_lazy('Area successfully unlocked.',
                                                 'Areas successfully unlocked.', num_restrictions))
        return redirect('site.index')

    origin = None
    destination = None
    routing = False
    if slug2 is not None:
        routing = True
        origin = check_location(slug, request)
        destination = check_location(slug2, request)
    else:
        routing = (mode and mode != 'l')
        if mode == 'o':
            origin = check_location(slug, request)
        else:
            destination = check_location(slug, request)

    state = {
        'routing': routing,
        'origin': (origin.serialize(detailed=False, simple_geometry=True, geometry=False)
                   if origin else None),
        'destination': (destination.serialize(detailed=False, simple_geometry=True, geometry=False)
                        if destination else None),
        'sidebar': routing or destination is not None,
        'details': True if details else False,
        'options': True if options else False,
    }

    levels = levels_by_short_label_for_request(request)

    level = levels.get(level, None) if level else None
    if level is not None:
        state.update({
            'level': level.pk,
            'center': (float(x), float(y)),
            'zoom': float(zoom),
        })

    initial_bounds = settings.INITIAL_BOUNDS
    if not initial_bounds:
        initial_bounds = tuple(chain(*Source.max_bounds()))

    ctx = {
        'bounds': json.dumps(Source.max_bounds(), separators=(',', ':')),
        'levels': json.dumps(tuple((level.pk, level.short_label) for level in levels.values()), separators=(',', ':')),
        'state': json.dumps(state, separators=(',', ':'), cls=DjangoJSONEncoder),
        'tile_cache_server': settings.TILE_CACHE_SERVER,
        'initial_level': settings.INITIAL_LEVEL,
        'primary_color': settings.PRIMARY_COLOR,
        'initial_bounds': json.dumps(initial_bounds, separators=(',', ':')) if initial_bounds else None,
        'last_site_update': json.dumps(SiteUpdate.last_update()),
        'ssids': json.dumps(settings.WIFI_SSIDS, separators=(',', ':')) if settings.WIFI_SSIDS else None,
        'editor': can_access_editor(request),
        'embed': bool(embed),
    }

    if grid.enabled:
        ctx['grid'] = json.dumps({
            'rows': grid.rows,
            'cols': grid.cols,
            'invert_x': grid.invert_x,
            'invert_y': grid.invert_y,
        }, separators=(',', ':'), cls=DjangoJSONEncoder)

    csrf.get_token(request)

    if not embed:
        announcement = Announcement.get_current()
        if announcement:
            messages.info(request, announcement.text)

    response = render(request, 'site/map.html', ctx)
    set_tile_access_cookie(request, response)
    if embed:
        xframe_options_exempt(lambda: response)()
    return response
Esempio n. 14
0
from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = patterns('',
    url(r'proxy\.html$', xframe_options_exempt(TemplateView.as_view(
        template_name='xdomain/proxy.html'
    )), name='xdomain-proxy',),
)
Esempio n. 15
0
    EntityDetailNetworkEmbedView,
)
from .api_views import (
    YolodexRouter,
    EntityViewSet,
    EntityTypeViewSet
)

router = YolodexRouter()
router.register(r'api/entity', EntityViewSet, 'entity')
router.register(r'api/entitytype', EntityTypeViewSet, 'entitytype')

entity_urls = [
    url(r'^$', RealmView.as_view(), name='overview'),
    url(_(r'^corrections/$'), RealmCorrectionsView.as_view(), name='corrections'),
    url(_(r'^search/$'), EntitySearchView.as_view(), name='search'),
    url(r'^(?P<type>[\w-]+)/$',
        EntityListView.as_view(),
        name='entity_list'),
    url(r'^(?P<type>[\w-]+)/(?P<slug>[\w-]+)/$',
        EntityDetailView.as_view(),
        name='entity_detail'),
    url(r'^(?P<type>[\w-]+)/(?P<slug>[\w-]+)/embed/$',
        xframe_options_exempt(EntityDetailNetworkEmbedView.as_view()),
        name='entity_detail_embed'),
]

urlpatterns = router.urls

urlpatterns += entity_urls
Esempio n. 16
0
File: urls.py Progetto: zno-ua/site
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt

from calculator import views

urlpatterns = [
    url(r'^$', xframe_options_exempt(views.CalcUniversityView.as_view()), name='calculator'),
    url(r'^university/$', xframe_options_exempt(views.CalcUniversityView.as_view()), name='calculator_university'),
    url(r'^ajax/$', views.CalcAjaxView.as_view(), name='calculator_ajax'),
]
from django.conf.urls import url, include
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.clickjacking import xframe_options_exempt

from ..views.zerodocs import (ZeroDocsIndexView, login, EmailSentView,
                              ZeroDocsEntryView, ZeroDocsMapView,
                              get_zerodocs_pdf)


zerodocs_patterns = [
    url(r'^$', ZeroDocsIndexView.as_view(),
        name='eurosfueraerzte-zerodocs_index'),
    url(_(r'^map/$'), xframe_options_exempt(ZeroDocsMapView.as_view()),
        name='eurosfueraerzte-zerodocs_map'),
    # Translators: url slug
    url(_(r'^login/$'), login, name='eurosfueraerzte-zerodocs_login'),
    # Translators: url slug
    url(_(r'^login/email-sent/$'), EmailSentView.as_view(),
        name='eurosfueraerzte-zerodocs_email_sent'),
    # Translators: url slug
    url(_(r'^entry/(?P<slug>\w+)/$'), ZeroDocsEntryView.as_view(),
        name='eurosfueraerzte-zerodocs_entry'),
    # Translators: url slug
    url(_(r'^entry/(?P<slug>\w+)/pdf/$'), get_zerodocs_pdf,
        name='eurosfueraerzte-zerodocs_pdf'),
]

urlpatterns = [
    # Translators: url slug
    url(_(r'^zero-euro/'), include(zerodocs_patterns))
]
Esempio n. 18
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt

from .views import MyView, PageView, AnalyticView


urlpatterns = [
    url(r'^api/$', MyView.as_view()),
    # url(r'^votube/(?P<word>[a-zA-Z]+)/', PageView.as_view()),
    url(r'^votube/clip/$', PageView.as_view(template_name="controls/clip_player.html")),
    url(r'^votube/movie/$', PageView.as_view(template_name="controls/sidebar.html")),
    url(r'^votube/view/$', AnalyticView.as_view()),
    url(r'^votube/subtitle/$', AnalyticView.as_view()),
    url(r'^votube/loadtime/$', AnalyticView.as_view()),
    url(r'^votube/$', xframe_options_exempt(PageView.as_view(template_name="index.html"))),
]
Esempio n. 19
0
urlpatterns = [

  # --------------------------------------------------------------------------------------------------------------------
  # Django Admin
  # --------------------------------------------------------------------------------------------------------------------

  url(r'^admin/', include(admin.site.urls)),

  # --------------------------------------------------------------------------------------------------------------------
  # Compounds
  # --------------------------------------------------------------------------------------------------------------------

  url(r'^compound_report_card/(?P<chembl_id>\w+)/$',
      DirectTemplateView.as_view(template_name="glados/compoundReportCard.html"), ),

  url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/representations/$', xframe_options_exempt(
    DirectTemplateView.as_view(template_name="glados/CompoundReportCardParts/RepresentationsToEmbed.html")), ),

  url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/name_and_classification/$', xframe_options_exempt(
    DirectTemplateView.as_view(template_name="glados/CompoundReportCardParts/NameAndClassificationToEmbed.html")), ),

  url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/mechanism_of_action/$', xframe_options_exempt(
    DirectTemplateView.as_view(template_name="glados/CompoundReportCardParts/MechanismOfActionToEmbed.html")), ),

   url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/molecule_features/$', xframe_options_exempt(
    DirectTemplateView.as_view(template_name="glados/CompoundReportCardParts/MoleculeFeaturesToEmbed.html")), ),

  url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/alternate_forms/$', xframe_options_exempt(
    DirectTemplateView.as_view(template_name="glados/CompoundReportCardParts/AlternateFormsToEmbed.html")), ),

  url(r'^compound_report_card/(?P<chembl_id>\w+)/embed/calculated_properties/$', xframe_options_exempt(
    DirectTemplateView.as_view(
Esempio n. 20
0
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from website import views
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = patterns('',
    url(r'^$', views.IndexView.as_view(), name='home'),
    url(r'^blog/$', views.BlogListView.as_view(), name='blog_index'),
    url(r'^blog/(?P<year>\d{4})/(?P<month>(10|11|12|\d))/(?P<day>(\d|1\d|2\d|30|31))/(?P<slug>[-\w]+)/$', views.BlogArticleView.as_view(), name='blog_article'),
    url(r'^events/$', views.EventListView.as_view(), name='event_index'),
    url(r'^videos/$', views.VideoIndex.as_view(), name='video_index'),
    url(r'^videos/(?P<slug>[-_\w]+)/$', views.VideoDetailView.as_view(), name='video_detail'),
    url(r'^live/embed/', xframe_options_exempt(TemplateView.as_view(template_name="liveembed.html")), name='liveembed'),
    url(r'^live/', TemplateView.as_view(template_name="live.html"), name='live'),
    url(r'^tech/', TemplateView.as_view(template_name="tech.html"), name='tech'),
    url(r'^services/', TemplateView.as_view(template_name="services.html"), name='services'),
    url(r'^contact/', TemplateView.as_view(template_name="contact.html"), name='contact'),
    url(r'^questions-live/', views.QuestionsLiveCreateView.as_view(), name='questions_live'),
)
Esempio n. 21
0
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.decorators.csrf import csrf_exempt

from . import views

urlpatterns = [
    url(r'^die/(?P<k>\+?[0-9]*)/?',
        csrf_exempt(xframe_options_exempt(views.DieView.as_view())),
        name='die'),
]
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from rest_framework.urlpatterns import format_suffix_patterns

from .public_api import (IssuerJson, IssuerBadgesJson, IssuerImage, BadgeClassJson,
                         BadgeClassImage, BadgeClassCriteria, BadgeInstanceJson,
                         BadgeInstanceImage, BackpackCollectionJson, BakedBadgeInstanceImage)

json_patterns = [
    url(r'^issuers/(?P<entity_id>[^/.]+)$', xframe_options_exempt(IssuerJson.as_view(slugToEntityIdRedirect=True)), name='issuer_json'),
    url(r'^issuers/(?P<entity_id>[^/.]+)/badges$', xframe_options_exempt(IssuerBadgesJson.as_view(slugToEntityIdRedirect=True)), name='issuer_badges_json'),
    url(r'^badges/(?P<entity_id>[^/.]+)$', xframe_options_exempt(BadgeClassJson.as_view(slugToEntityIdRedirect=True)), name='badgeclass_json'),
    url(r'^assertions/(?P<entity_id>[^/.]+)$', xframe_options_exempt(BadgeInstanceJson.as_view(slugToEntityIdRedirect=True)), name='badgeinstance_json'),

    url(r'^collections/(?P<entity_id>[^/.]+)$', xframe_options_exempt(BackpackCollectionJson.as_view(slugToEntityIdRedirect=True)), name='collection_json'),
]

image_patterns = [
    url(r'^issuers/(?P<entity_id>[^/]+)/image$', IssuerImage.as_view(slugToEntityIdRedirect=True), name='issuer_image'),
    url(r'^badges/(?P<entity_id>[^/]+)/image', BadgeClassImage.as_view(slugToEntityIdRedirect=True), name='badgeclass_image'),
    url(r'^badges/(?P<entity_id>[^/]+)/criteria', BadgeClassCriteria.as_view(slugToEntityIdRedirect=True), name='badgeclass_criteria'),
    url(r'^assertions/(?P<entity_id>[^/]+)/image', BadgeInstanceImage.as_view(slugToEntityIdRedirect=True), name='badgeinstance_image'),
    url(r'^assertions/(?P<entity_id>[^/]+)/baked', BakedBadgeInstanceImage.as_view(slugToEntityIdRedirect=True), name='badgeinstance_bakedimage'),
]

urlpatterns = format_suffix_patterns(json_patterns, allowed=['json']) + image_patterns
Esempio n. 23
0
    url(r'^$', views.FrontPageView.as_view(), name='frontpage'),
    url(r'^kayttaja/', include('account.urls', namespace='account')),
    url(r'^hallinta/', include('nkadmin.urls', namespace='nkadmin')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('content.urls', namespace='content')),
    url(r'^organisaatiot/', include('organization.urls', namespace='organization')),
    url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog'),
    url(r'^kommentit/', include('nkcomments.urls', namespace='nkcomments')),
    url(r'', include('social.apps.django_app.urls', namespace='social')),
    url(r'^palaute/$', FeedbackView.as_view(), name="feedback"),
    url(r'', include('nkmoderation.urls', namespace='nkmoderation')),
    url(r'^tietoa-palvelusta/', include('help.urls', namespace='help')),
    url(r'^tiedotteet/', include('info.urls', namespace='info')),
    url(r'^kampanjat/', include('campaign.urls', namespace='campaign')),
    url(r'^suosikit/', include('favorite.urls', namespace='favorite')),
    url(r'^widget/', xframe_options_exempt(ShowWidgetView.as_view()), name="nkwidget"),
    url(r'^', include('survey.urls', namespace='survey')),
    url('^liitteet/laheta/(?P<upload_group_id>[a-f0-9]{32})'
        '(?P<upload_token>[a-f0-9]{32})/$',
        combo(check_perm(IsAuthenticated), legacy_json_plaintext)(
            UploadAttachmentView.as_view()
        ),
        name='attachtor_file_upload'),
    url('^liitteet/sallitut-paatteet/$', AllowedFileUploadExtensions.as_view(),
        name='allowed_file_upload_extensions')
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


if settings.STATIC_URL.startswith('http'):
    urlpatterns += staticfiles_urlpatterns('/static/')
                          CreateProposalsForGathering,
                          UpdateGatheringView,
                          ThanksForCreating,
                          GatheringListView,
                          ProposalListView,
                          ProposalDetailView,
                          GatheringView,
                          HomeView,)
from django.views.generic import TemplateView
from django.views.decorators.clickjacking import xframe_options_exempt


urlpatterns = [
    #url(r'^$', TemplateView.as_view(template_name="votita/index.html"),
    #                                  name='index'),
    url(r'^$', (xframe_options_exempt(HomeView.as_view())), name='index'),
    url(r'^materiales/$',
        TemplateView.as_view(template_name='votita/materiales.html'),
        name='materiales'),
    url(r'^que-es/$',
        TemplateView.as_view(template_name='votita/que-es.html'),
        name='que-es'),
    url(r'^crear/?$',
        VotitaWizard.as_view(),
        name='create_proposal'),
    url(r'^crear_propuestas/(?P<pk>\d+)/?$',
        CreateProposalsForGathering.as_view(),
        name='proposal_for_gathering'),
    url(r'^actualizar_encuentro/(?P<pk>\d+)/?$',
        UpdateGatheringView.as_view(),
        name='update_gathering'),
Esempio n. 25
0
from RIGS import models, views, rigboard, finance, ical, versioning, forms
from django.views.generic import RedirectView
from django.views.decorators.clickjacking import xframe_options_exempt

from PyRIGS.decorators import permission_required_with_403
from PyRIGS.decorators import api_key_required

urlpatterns = patterns('',
                       # Examples:
                       # url(r'^$', 'PyRIGS.views.home', name='home'),
                       # url(r'^blog/', include('blog.urls')),
                       url('^$', login_required(views.Index.as_view()), name='index'),
                       url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),

                       url('^user/login/$', 'RIGS.views.login', name='login'),
                       url('^user/login/embed/$', xframe_options_exempt(views.login_embed), name='login_embed'),
                       url(r'^user/password_reset/$', 'django.contrib.auth.views.password_reset', {'password_reset_form': forms.PasswordReset}),

                       # People
                       url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
                           name='person_list'),
                       url(r'^people/add/$',
                           permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
                           name='person_create'),
                       url(r'^people/(?P<pk>\d+)/$',
                           permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
                           name='person_detail'),
                       url(r'^people/(?P<pk>\d+)/history/$',
                           permission_required_with_403('RIGS.view_person')(versioning.VersionHistory.as_view()),
                           name='person_history', kwargs={'model': models.Person}),
                       url(r'^people/(?P<pk>\d+)/edit/$',
                                                   PopularProposalAyuranosView,
                                                   )
from popular_proposal.views.wizard import (ProposalWizard,
                                           ProposalWizardFull,
                                           ProposalWizardFullWithoutArea,
                                           wizard_creator_chooser)
from django.views.decorators.clickjacking import xframe_options_exempt
from django.utils.translation import ugettext_lazy as _


urlpatterns = [
    url(r'^$',
        HomeView.as_view(),
        name='home'),
    url(r'^embedded/?$',
        xframe_options_exempt(HomeView.as_view(is_embedded=True)),
        name='embedded_home'),
    url(r'^area_embedded/(?P<slug>[-\w]+)/?$',
        xframe_options_exempt(ProposalsPerArea.as_view(is_embedded=True)),
        name='area_embedded'),
    url(r'^create_wizard/(?P<slug>[-\w]+)/?$',
        ProposalWizard.as_view(),
        name='propose_wizard'),
    url(_(r'^nueva/?$'),
        ProposalWizardFull.as_view(),
        name='propose_wizard_full'),
    url(_(r'^crear/?$'),
        wizard_creator_chooser().as_view(),
        name='propose_wizard_full_without_area'),
    url(r'^detail/(?P<slug>[-\w]+)/?$',
        xframe_options_exempt(PopularProposalDetailView.as_view()),
Esempio n. 27
0
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from rest_framework.urlpatterns import format_suffix_patterns

from .public_api import (IssuerJson, IssuerList, IssuerBadgesJson, IssuerImage,
                         BadgeClassJson, BadgeClassList, BadgeClassImage,
                         BadgeClassCriteria, BadgeInstanceJson,
                         BadgeInstanceImage, BackpackCollectionJson,
                         BakedBadgeInstanceImage, OEmbedAPIEndpoint,
                         VerifyBadgeAPIEndpoint)

json_patterns = [
    url(r'^issuers/(?P<entity_id>[^/.]+)$',
        xframe_options_exempt(IssuerJson.as_view(slugToEntityIdRedirect=True)),
        name='issuer_json'),
    url(r'^issuers/(?P<entity_id>[^/.]+)/badges$',
        xframe_options_exempt(
            IssuerBadgesJson.as_view(slugToEntityIdRedirect=True)),
        name='issuer_badges_json'),
    url(r'^all-issuers$',
        xframe_options_exempt(IssuerList.as_view()),
        name='issuer_list_json'),
    url(r'^badges/(?P<entity_id>[^/.]+)$',
        xframe_options_exempt(
            BadgeClassJson.as_view(slugToEntityIdRedirect=True)),
        name='badgeclass_json'),
    url(r'^all-badges$',
        xframe_options_exempt(BadgeClassList.as_view()),
        name='badgeclass_list_json'),
    url(r'^assertions/(?P<entity_id>[^/.]+)$',
        xframe_options_exempt(
Esempio n. 28
0
        name='latest-control-view'),
    url(r'^review_control/(?P<pk>[^/]+)$',
        views.ConfirmControl.as_view(),
        name='review-control-view'),

    # Votes
    url(r'^posts/(?P<post_election_id>[\d]+)/$',
        views.PostResultsView.as_view(),
        name='post-results-view'),
    url(r'^posts/(?P<post_election_id>[\d]+)/report$',
        views.PostReportVotesView.as_view(),
        name='report-post-votes-view'),
    url(r'^posts/(?P<result_set_id>[\d]+)/review$',
        views.ReviewPostReportView.as_view(),
        name='review-votes-view'),
    url(r'^posts$',
        views.LatestVoteResults.as_view(),
        name='latest-votes-view'),
    url(r'^posts/(?P<post_slug>[^/]+)/$',
        views.PostResultsRedirectView.as_view(),
        name='post-result-redirect-view'),

    # Map Views
    url(r'^map/data.json$',
        cache_page(60)(views.MapAreaView.as_view()),
        name='map-data-view'),
    url(r'^map/embed$',
        xframe_options_exempt(cache_page(60)(views.MapEmbedView.as_view())),
        name='map-embed-view'),
]
Esempio n. 29
0
File: urls.py Progetto: lukyth/bcbk5
from django.conf.urls import patterns, include, url
from django.views.decorators.clickjacking import xframe_options_exempt

from schedule.views import SessionView, SessionRenderView

urlpatterns = patterns('',
	url(r'^$', SessionView.as_view(), name='session'),
	url(r'^render$', xframe_options_exempt(SessionRenderView.as_view()), name='session_table')
)
Esempio n. 30
0
     views.get_entities_records,
     name='entities_records'),
 url(r'^covid_entities_records/$',
     views.get_covid_entities_records,
     name='covid_entities_records'),
 url(r'^github_details/$', views.get_github_details, name='github_details'),
 url(r'^blog_entries/(?P<pageToken>.+)?$',
     views.get_latest_blog_entries,
     name='blog_entries'),
 url(r'^visualise/$', views.visualise, name='visualise'),
 url(r'^play/$', views.play, name='play'),
 url(
     r'^handlebars/visualisation_sources/$',
     xframe_options_exempt(
         DirectTemplateView.as_view(
             template_name=
             "glados/Handlebars/LazilyLoaded/Visualisations/VisualisationsSources.html"
         )),
 ),
 url(r'^design_components/$',
     views.design_components,
     name='design_components'),
 url(
     r'^marvin_search_fullscreen/$',
     DirectTemplateView.as_view(
         template_name="glados/marvin_search_fullscreen.html"),
 ),
 url(
     r'^compound_3D_speck/$',
     DirectTemplateView.as_view(
         template_name="glados/comp_3D_view_speck_fullscreen.html"),
Esempio n. 31
0
    url(r'^devices/(?P<pk>[0-9]*)/tags/(?P<tag>[0-9]*)$', DeviceTagRemove.as_view(), name="device-tag-remove"),
    url(r'^devices/(?P<pk>[0-9]*)/lending/$', DeviceLendingList.as_view(), name="device-lending-list"),
    url(r'^devices/(?P<pk>[0-9]*)/lending/(?P<page>[0-9]*)$', DeviceLendingList.as_view(), name="device-lending-list"),
    url(r'^devices/(?P<pk>[0-9]*)/inventoried/$', DeviceInventoried.as_view(), name="device-inventoried"),
    url(r'^devices/(?P<pk>[0-9]*)/bookmark/$', DeviceBookmark.as_view(), name="device-bookmark"),
    url(r'^devices/(?P<pk>[0-9]*)/notes/create/$', NoteCreate.as_view(), name="device-note-create"),
    url(r'^devices/(?P<pk>[0-9]*)/notes/edit/$', NoteUpdate.as_view(), name="device-note-edit"),
    url(r'^devices/(?P<device>[0-9]*)/notes/(?P<pk>[0-9]*)/delete/$', NoteDelete.as_view(), name="device-note-delete"),
    url(r'^devices/(?P<pk>[0-9]*)/pictures/create/$', PictureCreate.as_view(), name="device-picture-create"),
    url(r'^devices/(?P<device>[0-9]*)/pictures/(?P<pk>[0-9]*)/edit/$', PictureUpdate.as_view(), name="device-picture-edit"),
    url(r'^devices/(?P<device>[0-9]*)/pictures/(?P<pk>[0-9]*)/delete/$', PictureDelete.as_view(), name="device-picture-delete"),
    url(r'^devices/lend/$', DeviceLend.as_view(), name="device-lend"),
    url(r'^devices/lend/(?P<pk>[0-9]*)$', DeviceLend.as_view(), name="device-lend"),
    url(r'^devices/export/csv/$', ExportCsv.as_view(), name='export-csv'),
    url(r'^devices/return/(?P<lending>[0-9]*)$', DeviceReturn.as_view(), name="device-return"),
    url(r'^devices/public/$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/(?P<page>[0-9]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/sorting/(?P<sorting>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/page/(?P<page>[0-9]*)/sorting/(?P<sorting>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/sorting/(?P<sorting>[^/]*)/group/(?P<group>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/page/(?P<page>[0-9]*)/sorting/(?P<sorting>[^/]*)/group/(?P<group>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/sorting/(?P<sorting>[^/]*)/group/(?P<group>[^/]*)/filter/(?P<filter>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/page/(?P<page>[0-9]*)/sorting/(?P<sorting>[^/]*)/group/(?P<group>[^/]*)/filter/(?P<filter>[^/]*)$', xframe_options_exempt(PublicDeviceListView.as_view()), name="public-device-list"),
    url(r'^devices/public/(?P<pk>[0-9]*)/$', xframe_options_exempt(PublicDeviceDetailView.as_view()), name="public-device-detail"),
    url(r'^devices/templates/$', permission_required("devices.read_template")(TemplateList.as_view()), name="template-list"),
    url(r'^devices/templates/(?P<page>[0-9]*)$', permission_required("devices.read_template")(TemplateList.as_view()), name="template-list"),
    url(r'^devices/templates/add$', permission_required("devices.add_template")(TemplateCreate.as_view()), name="template-add"),
    url(r'^devices/templates/(?P<pk>[0-9]*)/edit/$', permission_required("devices.change_template")(TemplateUpdate.as_view()), name="template-edit"),
    url(r'^devices/templates/(?P<pk>[0-9]*)/delete/$', permission_required("devices.delete_template")(TemplateDelete.as_view()), name="template-delete"),

Esempio n. 32
0
 url(r'^uslogging/', include('uslogging.urls', 'uslogging')),
 url(r'^enterprise/[\w-]*$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'enterprise.html'}, 'enterprise_page'),
 url(r'^dfxp-wrapper-test/$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'dfxp-wrapper-test.html'}, 'dfxp-wrapper-test'),
 url(r'^embedder/$', 'django.views.generic.simple.direct_to_template',
     {'template': 'embedder.html'}, 'embedder_page'),
 url(r'^embedder-iframe/$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'embedder-iframe.js'}, 'embedder_iframe'),
 url(r'^embedder-offsite/$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'embedder-offsite.html'}, 'embedder_page_offsite'),
 url(r'^embedder-widget-iframe', xframe_options_exempt(direct_to_template),
     {'template': 'embedder-widget.html'}, 'embedder_page_offsite'),
 url(r'^streaming-transcript/$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'streaming-transcript.html'},
     'streaming_transcript_demo'),
 url(r'^w3c/p3p.xml$', 'django.views.generic.simple.direct_to_template',
     {'template': 'p3p.xml'}),
 url(r'^w3c/Policies.xml$',
     'django.views.generic.simple.direct_to_template',
     {'template': 'Policies.xml'}, 'policy_page'),
 url(r'^about$', 'django.views.generic.simple.direct_to_template',
     {'template': 'about.html'}, 'about_page'),
 url(r'^security', 'django.views.generic.simple.direct_to_template',
     {'template': 'security.html'}, 'security_page'),
 url(r'^get-code/$', 'django.views.generic.simple.direct_to_template',
    CreateProposalsForGathering,
    UpdateGatheringView,
    ThanksForCreating,
    GatheringListView,
    ProposalListView,
    ProposalDetailView,
    GatheringView,
    HomeView,
)
from django.views.generic import TemplateView
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = [
    #url(r'^$', TemplateView.as_view(template_name="votita/index.html"),
    #                                  name='index'),
    url(r'^$', (xframe_options_exempt(HomeView.as_view())), name='index'),
    url(r'^materiales/$',
        TemplateView.as_view(template_name='votita/materiales.html'),
        name='materiales'),
    url(r'^crear/?$', VotitaWizard.as_view(), name='create_proposal'),
    url(r'^crear_propuestas/(?P<pk>\d+)/?$',
        CreateProposalsForGathering.as_view(),
        name='proposal_for_gathering'),
    url(r'^actualizar_encuentro/(?P<pk>\d+)/?$',
        UpdateGatheringView.as_view(),
        name='update_gathering'),
    url(r'^gracias_por_crear/(?P<pk>\d+)/?$',
        ThanksForCreating.as_view(),
        name='thanks_for_creating_a_gathering'),
    url(r'^crear_propuestas_wizard/(?P<pk>\d+)/?$',
        VotitaWizard.as_view(),
Esempio n. 34
0
from core_roottree import views
from django.contrib.auth.views import login, logout
from django.views.decorators.clickjacking import xframe_options_exempt

router = routers.DefaultRouter()
router.register(r'sessions', views.SessionViewSet)
router.register(r'developers', views.DeveloperViewSet)
router.register(r'clients', views.ClientUserViewSet)
router.register(r'commands', views.CommandViewSet)

urlpatterns = patterns(
    '',
    # Examples:
    # url(r'^$', 'roottree.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r'^$', xframe_options_exempt(TemplateView.as_view(template_name='index.html')),
        name='home'),
    url(r'^test/$', 'core_roottree.views.index'),
    url(r'^api/', include(router.urls)),
    url(r'^dev/$', views.DevHomeView.as_view()),
    # url(r'^api/file/', views.FileView.as_view()),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^accounts/login/clientuser/$',  xframe_options_exempt(login), {'template_name':'registration/clientuser_login.html'}),
    url(r'^accounts/login/clientuser/cross_domain/$',  xframe_options_exempt(login), {'template_name':'registration/clientuser_login_cross_domain.html'}),
    url(r'^accounts/login/dev/$',  xframe_options_exempt(login), {'template_name':'registration/dev_login.html'}),
    url(r'^accounts/logout/$', logout), 
    url(r'^accounts/delete_cookie/$', views.DeleteCookieView.as_view()),
    url(r'^accounts/register/dev/$', views.DevCreateView.as_view()),
    url(r'^accounts/register/clientuser/$', views.ClientUserCreateView.as_view()),
    url(r'^accounts/set_cookie/$', xframe_options_exempt(views.SetCookieView.as_view())),
    url(r'^accounts/set_cookie/cross_domain/$', xframe_options_exempt(views.SetCookieViewDomain.as_view())),
Esempio n. 35
0
from django.contrib.auth.models import User
from django.views.decorators.clickjacking import xframe_options_exempt

from torneo import views

urlpatterns = patterns('',
                       url(r'^classifica/$',views.classifica, name='classifica'),
#                       url(r'^calendario/$',views.calendario, name='calendario'),
                       url(r'^partite/(?P<pk>\d+)/modifica/$',views.PartiteModifica.as_view(),name='partitemodifica'),
                       url(r'^partite/(?P<pk>\d+)/(?P<azione>(approva|rifiuta))/$',views.PartiteApprova.as_view(),name='partiteapprova'),
                       url(r'^partite/$',views.PartiteLista.as_view(),name='partite'),
                       url(r'^partite/(?P<pk>\d+)/$',DetailView.as_view(model=Partita),name='partiteid'),
                       url(r'^partite/mie/$',views.PartiteLista.as_view(mie=True),name='partitemie'),
                       url(r'^regolamento/$',views.regolamento, name='regolamento'),
                       url(r'^istruzioni/$',TemplateView.as_view(template_name="torneo/istruzioni.html"), name='istruzioni'),
                       url(r'^signage/$',xframe_options_exempt(views.signage),name='signage'),
#                       url(r'^squadre/$',ListView.as_view(model=Squadra,),name='squadre'),
                       url(r'^squadre/$',views.SquadreLista.as_view(),name='squadre'),
                       url(r'^squadre/mie/$',views.SquadreLista.as_view(mie=True),name='squadremie'),
#                       url(r'^squadre/$',views.squadre, name='squadre'),
                       url(r'^squadre/(?P<idsquadra>\d+)/$',views.squadreid, name='squadreid'),
                       url(r'^squadre/(?P<pk>\d+)/modifica/$',login_required(views.SquadreModifica.as_view()), name='squadremodifica'),
                       url(r'^squadre/nuova/$',login_required(views.SquadreNuova.as_view()), name='squadrenuova'),
                       url(r'^squadre/(?P<pk>\d+)/cancella/$',login_required(views.SquadreCancella.as_view()), name='squadrecancella'),
                       url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
                       url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
                       url(r'^giocatori/$',views.GiocatoriLista.as_view(),name='giocatori'),
                       url(r'^giocatori/preferenze/$',login_required(views.PreferenzeUtenteModifica.as_view()),name='giocatoripreferenze'),
                       url(r'^giocatori/modifica/$',views.GiocatoriModifica.as_view(),name='giocatorimodifica'),
                       url(r'^$',views.index, name='index')
#                           # ex: /polls/
Esempio n. 36
0
    PopularProposalUpdateView,
    ProposalWizard,
    ProposalWizardFull,
    UnlikeProposalView,
    ProposalsPerArea,
    CommitView,
    NotCommitView,
    CommitmentDetailView,
)
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = patterns(
    '',
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^embedded/?$',
        xframe_options_exempt(HomeView.as_view(is_embedded=True)),
        name='embedded_home'),
    url(r'^area_embedded/(?P<slug>[-\w]+)/?$',
        xframe_options_exempt(ProposalsPerArea.as_view(is_embedded=True)),
        name='area_embedded'),
    url(r'^create_wizard/(?P<slug>[-\w]+)/?$',
        ProposalWizard.as_view(),
        name='propose_wizard'),
    url(r'^create_wizard_full/?$',
        ProposalWizardFull.as_view(),
        name='propose_wizard_full'),
    url(r'^detail/(?P<slug>[-\w]+)/?$',
        PopularProposalDetailView.as_view(),
        name='detail'),
    url(r'^commitment/(?P<candidate_slug>[-\w]+)/(?P<proposal_slug>[-\w]+)/?$',
        CommitmentDetailView.as_view(),
Esempio n. 37
0
from sitemaps import *
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.decorators.cache import cache_page

media_root = getattr(settings, 'MEDIA_ROOT', '/')

sitemaps = {
    'elections': ElectionsSitemap,
    'candidates': CandidatesSitemap,
}

urlpatterns = patterns(
    '',
    url(r'^$',
        cache_page(60 * settings.CACHE_MINUTES)(xframe_options_exempt(
            HomeView.as_view(template_name='elections/home.html'))),
        name='home'),
    url(r'^buscar/?$',
        SearchView(template='search.html', form_class=ElectionForm),
        name='search'),
    url(r'^busqueda_tags/?$',
        ElectionsSearchByTagView.as_view(),
        name='tags_search'),
    url(r'^eleccion/(?P<slug>[-\w]+)/?$',
        cache_page(60 * settings.CACHE_MINUTES)(ElectionDetailView.as_view(
            template_name='elections/election_detail.html')),
        name='election_view'),
    url(r'^eleccion/(?P<slug>[-\w]+)/questionary/?$',
        cache_page(60 * settings.CACHE_MINUTES)(ElectionDetailView.as_view(
            template_name='elections/election_questionary.html')),
        name='questionary_detail_view'),
Esempio n. 38
0
    re_path(r'^api-auth/',
            include('rest_framework.urls', namespace='rest_framework')),
    re_path(r'^project-viz/(?P<project_stat_id>\d+)/(?P<token>[0-9a-f-]+)/$',
            ProjectPublicVizView.as_view(),
            name='project-stat-viz-public'),
    re_path(r'^favicon.ico$',
            RedirectView.as_view(url=get_frontend_url('favicon.ico')),
            name="favicon"),
] + [
    # graphql patterns
    re_path('^graphql/?$', csrf_exempt(CustomGraphQLView.as_view())),
    re_path(r'^favicon.ico$',
            RedirectView.as_view(url=get_frontend_url('favicon.ico'), ),
            name="favicon"),
] + static.static(settings.MEDIA_URL,
                  view=xframe_options_exempt(serve),
                  document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    import debug_toolbar
    if 'debug_toolbar' in settings.INSTALLED_APPS:
        urlpatterns += [
            re_path('__debug__/', include(debug_toolbar.urls)),
        ]
    urlpatterns += [
        re_path('^graphiql/?$',
                csrf_exempt(CustomGraphQLView.as_view(graphiql=True))),
        re_path(r'^pr-email/$', PasswordReset.as_view()),
        re_path(r'^pc-email/$', PasswordChanged.as_view()),
        re_path(r'^aa-email/$', AccountActivate.as_view()),
        re_path(r'^pj-email/$', ProjectJoinRequest.as_view()),
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path, include
from django.views.decorators.clickjacking import xframe_options_exempt
from pages.views import HomeView

urlpatterns = [
    # X-Frame-Options exempt to test responsiveness via ami.responsivedesign.is
    path('', xframe_options_exempt(HomeView.as_view()), name='home'),
    path('admin/', admin.site.urls),
    path('users/', include('users.urls')),
    path('users/', include('django.contrib.auth.urls')),
    path('products/', include('products.urls', namespace='products')),
    path('cart/', include('cart.urls', namespace='cart')),
    path('checkout/', include('checkout.urls', namespace='checkout')),
    path('pages/', include('pages.urls', namespace='pages')),
    path('news/', include('news.urls', namespace='news')),
]

# Add media and static local serving during debug mode only
if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
Esempio n. 40
0
from django.conf.urls import patterns, url, include
from django.views.decorators.cache import cache_page
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.generic import TemplateView

from fb_fangates.models import FanGate
from fb_fangates.views import FanGateView

urlpatterns = patterns(
    '',
    url(r'^channel/$',
        cache_page(60 * 60 * 24 * 365)(
            TemplateView.as_view(template_name='fb/channel.html')),
        name='fb_channel'),
    url(r'^(?P<pk>\d+)/$',
        xframe_options_exempt(csrf_exempt(FanGateView.as_view())),
        name='fb_fangate'),
)
Esempio n. 41
0
    url(r'^api/v2/event/(?P<pk>\d+)', api_views.EventViewset.as_view({'get': 'retrieve'})),
    url(r'^api/v2/event/(?P<slug>[-\w]+)', api_views.EventViewset.as_view({'get': 'retrieve'}, lookup_field='slug')),
    url(r'^api/v2/exportperresults/', per_views.ExportAssessmentToCSVViewset.as_view()),
    url(r'^docs/', include_docs_urls(title='IFRC Go API')),
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^admin/', RedirectView.as_view(url='/')),
    # url(r'^', admin.site.urls),
    url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico')),
    url(r'^server-error-for-devs', DummyHttpStatusError.as_view()),
    url(r'^exception-error-for-devs', DummyExceptionError.as_view()),
    path('i18n/', include('django.conf.urls.i18n')),
]

if settings.DEBUG:
    import debug_toolbar
    urlpatterns = [
        url('__debug__/', include(debug_toolbar.urls)),
        # For django versions before 2.0:
        # url(r'^__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns + static.static(
        settings.MEDIA_URL, view=xframe_options_exempt(serve), document_root=settings.MEDIA_ROOT,
    )

# API With language URL patterns
urlpatterns += i18n_patterns(
    path('', admin.site.urls),
    # NOTE: Current language switcher will not work if set to False.
    # TODO: Fix admin panel language switcher before enabling switcher in production
    prefix_default_language=True,
)
Esempio n. 42
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login/',
         auth_views.LoginView.as_view(
             template_name='examplesite/login.html',
             redirect_authenticated_user=True,
         ),
         name='login'),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
    path('',
         login_required(
             TemplateView.as_view(template_name='examplesite/base.html')),
         name='home'),
    path(
        'other_domain/',
        xframe_options_exempt(
            TemplateView.as_view(
                template_name='examplesite/otherdomain.html')),
        name='other_domain',
    ),
]
Esempio n. 43
0
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from signing.api import SymmetricKeyListView, SymmetricKeyDetailView, PublicKeyIssuerDetailView, SetIssuerSignerView

urlpatterns = [
    url(r'^password$',
        SymmetricKeyDetailView.as_view(),
        name='signing_get_symkey_existance'),
    url(r'^update-password$',
        SymmetricKeyDetailView.as_view(),
        name='signing_update_password'),
    url(r'^add-password$',
        SymmetricKeyListView.as_view(),
        name='signing_add_password'),
    url(r'^set-signer$',
        SetIssuerSignerView.as_view(),
        name='signing_set_signer'),
    url(r'^public_key/(?P<entity_id>[^/.]+)$',
        xframe_options_exempt(PublicKeyIssuerDetailView.as_view()),
        name='signing_public_key_json')
]
Esempio n. 44
0
    #     GeoBoundsView.as_view()),
    url(get_api_path(r'geo-options/$'),
        GeoOptionsView.as_view()),

    # Clone apis
    url(get_api_path(r'clone-region/(?P<region_id>\d+)/$'),
        RegionCloneView.as_view()),
    url(get_api_path(r'clone-analysis-framework/(?P<af_id>\d+)/$'),
        AnalysisFrameworkCloneView.as_view()),
    url(get_api_path(r'clone-category-editor/(?P<ce_id>\d+)/$'),
        CategoryEditorCloneView.as_view()),

    # Viewsets
    url(get_api_path(''), include(router.urls)),

    # Docs
    url(get_api_path(r'docs/'), DocsView.as_view()),

    # DRF auth, TODO: logout
    url(r'^api-auth/', include('rest_framework.urls',
                               namespace='rest_framework')),

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

urlpatterns += [
    url(r'^$', FrontendView.as_view()),
    url(get_api_path(''), Api_404View.as_view()),
]
Esempio n. 45
0
from django.urls import path
from .views import log_add, log_show
from django.views.decorators.clickjacking import xframe_options_exempt

urlpatterns = [
    path('log_add/', log_add, name='log_add'),
    # 使用该装饰器,表示该网页的response head将不再设置X-Frame-Options,
    # 也就是说允许该网页在任何站点的frame中显示
    path('log_show/', xframe_options_exempt(log_show), name='log_show'),
]
Esempio n. 46
0
from django.urls import path
from django.views.generic import TemplateView
from django.views.decorators.clickjacking import xframe_options_exempt

from . import views

#app_name = 'PlayGame'

urlpatterns = [
    path('<int:game_id>/', views.play, name='play-game'),
    path('load/<int:game_id>/', views.load, name='load'),
    path('save/<int:game_id>/', views.save, name='save'),
    path(
        'test_game2/',
        xframe_options_exempt(
            TemplateView.as_view(template_name='test_game3.html'))),
    path('score/<int:game_id>/', views.submit_score, name='submit-score'),
]
Esempio n. 47
0
from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from rest_framework.urlpatterns import format_suffix_patterns

from .public_api import (InstitutionJson, InstitutionImage, IssuerJson, IssuerBadgesJson, IssuerImage, BadgeClassJson,
                         BadgeClassImage, BadgeClassCriteria, BadgeInstanceJson,
                         BadgeInstanceImage, BakedBadgeInstanceImage,
                         BadgeClassPublicKeyJson, IssuerPublicKeyJson, AssertionValidate, AssertionRecipientName)

json_patterns = [
    url(r'^institutions/(?P<entity_id>[^/.]+)$', xframe_options_exempt(InstitutionJson.as_view(slugToEntityIdRedirect=True)), name='institution_json'),
    url(r'^issuers/(?P<entity_id>[^/.]+)$', xframe_options_exempt(IssuerJson.as_view(slugToEntityIdRedirect=True)), name='issuer_json'),
    url(r'^issuers/(?P<entity_id>[^/.]+)/pubkey/(?P<public_key_id>[^/.]+)$', xframe_options_exempt(IssuerPublicKeyJson.as_view(slugToEntityIdRedirect=True)), name='issuer_public_key_json'),
    url(r'^issuers/(?P<entity_id>[^/.]+)/badges$', xframe_options_exempt(IssuerBadgesJson.as_view(slugToEntityIdRedirect=True)), name='issuer_badges_json'),
    url(r'^badges/(?P<entity_id>[^/.]+)$', xframe_options_exempt(BadgeClassJson.as_view(slugToEntityIdRedirect=True)), name='badgeclass_json'),
    url(r'^badges/(?P<entity_id>[^/.]+)/pubkey/(?P<public_key_id>[^/.]+)$', xframe_options_exempt(BadgeClassPublicKeyJson.as_view(slugToEntityIdRedirect=True)), name='badgeclass_public_key_json'),
    url(r'^assertions/(?P<entity_id>[^/.]+)$', xframe_options_exempt(BadgeInstanceJson.as_view(slugToEntityIdRedirect=True)), name='badgeinstance_json'),
    url(r'^assertions/validate/(?P<entity_id>[^/]+)$', xframe_options_exempt(AssertionValidate.as_view()), name='assertion_validate'),
    url(r'^assertions/identity/(?P<identity>[^/]+)/(?P<salt>[^/]+)$', xframe_options_exempt(AssertionRecipientName.as_view()), name='assertion_recipient_name'),
]

image_patterns = [
    url(r'^institution/(?P<entity_id>[^/]+)/image$', InstitutionImage.as_view(slugToEntityIdRedirect=True), name='institution_image'),
    url(r'^issuers/(?P<entity_id>[^/]+)/image$', IssuerImage.as_view(slugToEntityIdRedirect=True), name='issuer_image'),
    url(r'^badges/(?P<entity_id>[^/]+)/image', BadgeClassImage.as_view(slugToEntityIdRedirect=True), name='badgeclass_image'),
    url(r'^badges/(?P<entity_id>[^/]+)/criteria', BadgeClassCriteria.as_view(slugToEntityIdRedirect=True), name='badgeclass_criteria'),
    url(r'^assertions/(?P<entity_id>[^/]+)/image', BadgeInstanceImage.as_view(slugToEntityIdRedirect=True), name='badgeinstance_image'),
    url(r'^assertions/(?P<entity_id>[^/]+)/baked', BakedBadgeInstanceImage.as_view(slugToEntityIdRedirect=True), name='badgeinstance_bakedimage'),
]

urlpatterns = format_suffix_patterns(json_patterns, allowed=['json']) + image_patterns
Esempio n. 48
0
    url(r'^hallinta/', include('nkadmin.urls', namespace='nkadmin')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('content.urls', namespace='content')),
    url(r'^organisaatiot/',
        include('organization.urls', namespace='organization')),
    url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog'),
    url(r'^kommentit/', include('nkcomments.urls', namespace='nkcomments')),
    url(r'', include('social.apps.django_app.urls', namespace='social')),
    url(r'^palaute/$', FeedbackView.as_view(), name="feedback"),
    url(r'', include('nkmoderation.urls', namespace='nkmoderation')),
    url(r'^tietoa-palvelusta/', include('help.urls', namespace='help')),
    url(r'^tiedotteet/', include('info.urls', namespace='info')),
    url(r'^kampanjat/', include('campaign.urls', namespace='campaign')),
    url(r'^suosikit/', include('favorite.urls', namespace='favorite')),
    url(r'^widget/',
        xframe_options_exempt(ShowWidgetView.as_view()),
        name="nkwidget"),
    url(r'^', include('survey.urls', namespace='survey')),
    url(
        '^liitteet/laheta/(?P<upload_group_id>[a-f0-9]{32})'
        '(?P<upload_token>[a-f0-9]{32})/$',
        combo(check_perm(IsAuthenticated), legacy_json_plaintext)(
            UploadAttachmentView.as_view()),
        name='attachtor_file_upload'),
    url('^liitteet/sallitut-paatteet/$',
        AllowedFileUploadExtensions.as_view(),
        name='allowed_file_upload_extensions')) + static(
            settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.STATIC_URL.startswith('http'):
    urlpatterns += staticfiles_urlpatterns('/static/')
Esempio n. 49
0
from django.conf.urls import patterns, url
from django.views.decorators.clickjacking import xframe_options_exempt

from .views import ColabWikilegisPluginProxyView


urlpatterns = patterns(
    '',
    url(r'^(?P<path>.*)$',
        xframe_options_exempt(ColabWikilegisPluginProxyView.as_view()),
        name='colab_wikilegis'),
)