def _create_javascript_catalog(self, locale, domain, packages):
     activate(locale)
     if django.VERSION < (2, 0):
         catalog, plural = get_javascript_catalog(locale, domain, packages)
         response = render_javascript_catalog(catalog, plural)
     else:
         catalog = JavaScriptCatalog()
         packages = get_packages(packages)
         # we are passing None as the request, as the request object is
         # currently not used by django
         response = catalog.get(self, None, domain=domain, packages=packages)
     return force_text(response.content)
Beispiel #2
0
        def create_js_catalog_url():
            packages = ['django_mptt_admin']
            url_pattern = r'^jsi18n/$'

            if django.VERSION[0:2] <= (1, 9):
                return create_url(url_pattern, 'jsi18n', javascript_catalog, kwargs=dict(packages=packages), cacheable=True)
            else:
                return create_url(url_pattern, 'jsi18n', JavaScriptCatalog.as_view(packages=packages), cacheable=True)
Beispiel #3
0
    def i18n_javascript(self, request, extra_context=None):
        """
        Displays the i18n JavaScript that the Django admin requires.

        `extra_context` is unused but present for consistency with the other
        admin views.
        """
        return JavaScriptCatalog.as_view(packages=['django.contrib.admin'])(request)
Beispiel #4
0
def generate_widget_js(lang):
    code = []
    with language(lang):
        # Provide isolation
        code.append('(function (siteglobals) {\n')
        code.append('var module = {}, exports = {};\n')
        code.append('var lang = "%s";\n' % lang)

        c = JavaScriptCatalog()
        c.translation = DjangoTranslation(lang, domain='djangojs')
        catalog, plural = c.get_catalog(), c.get_plural()

        str_wl = (
            'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su',
            'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
            'September', 'October', 'November', 'December'
        )
        catalog = dict((k, v) for k, v in catalog.items() if k.startswith('widget\u0004') or k in str_wl)
        template = Engine().from_string(js_catalog_template)
        context = Context({
            'catalog_str': indent(json.dumps(
                catalog, sort_keys=True, indent=2)) if catalog else None,
            'formats_str': indent(json.dumps(
                get_formats(), sort_keys=True, indent=2)),
            'plural': plural,
        })
        code.append(template.render(context))

        files = [
            'vuejs/vue.js' if settings.DEBUG else 'vuejs/vue.min.js',
            'vuejs/vue-resize.min.js',
            'pretixpresale/js/widget/docready.js',
            'pretixpresale/js/widget/floatformat.js',
            'pretixpresale/js/widget/widget.js',
        ]
        for fname in files:
            f = finders.find(fname)
            with open(f, 'r') as fp:
                code.append(fp.read())

        if settings.DEBUG:
            code.append('})(this);\n')
        else:
            # Do not expose debugging variables
            code.append('})({});\n')
    return ''.join(code)
Beispiel #5
0
 def test_i18n_unknown_package_error(self):
     view = JavaScriptCatalog.as_view()
     request = RequestFactory().get('/')
     msg = 'Invalid package(s) provided to JavaScriptCatalog: unknown_package'
     with self.assertRaisesMessage(ValueError, msg):
         view(request, packages='unknown_package')
     msg += ',unknown_package2'
     with self.assertRaisesMessage(ValueError, msg):
         view(request, packages='unknown_package+unknown_package2')
Beispiel #6
0
 def handle(self, *args, **options):
     fake_request = HttpRequest()
     fake_request.method = 'GET'
     for lang in settings.AMO_LANGUAGES:
         filename = os.path.join(
             settings.STATICFILES_DIRS[0], 'js', 'i18n', '%s.js' % lang)
         with translation.override(lang):
             response = JavaScriptCatalog.as_view()(fake_request)
             with open(filename, 'w') as f:
                 f.write(force_text(response.content))
Beispiel #7
0
    def get_urls(self):
        """
        Adds a url to move nodes to this admin
        """
        urls = super(TreeAdmin, self).get_urls()

        if django.VERSION < (1, 10):
            from django.views.i18n import javascript_catalog
            jsi18n_url = url(r'^jsi18n/$', javascript_catalog, {'packages': ('treebeard',)})
        else:
            from django.views.i18n import JavaScriptCatalog

            jsi18n_url = url(r'^jsi18n/$',
                JavaScriptCatalog.as_view(packages=['treebeard']),
                name='javascript-catalog'
            )

        new_urls = [
            url('^move/$', self.admin_site.admin_view(self.move_node), ),
            jsi18n_url,
        ]
        return new_urls + urls
Beispiel #8
0
    def get_urls(self):
        urls = super(SubscriptionAdmin, self).get_urls()

        my_urls = [
            url(r'^import/$',
                self._wrap(self.subscribers_import),
                name=self._view_name('import')),
            url(r'^import/confirm/$',
                self._wrap(self.subscribers_import_confirm),
                name=self._view_name('import_confirm')),
        ]
        # Translated JS strings - these should be app-wide but are
        # only used in this part of the admin. For now, leave them here.
        if HAS_CBV_JSCAT:
            my_urls.append(url(r'^jsi18n/$',
                JavaScriptCatalog.as_view(packages=('newsletter',)),
                name='newsletter_js18n'))
        else:
            my_urls.append(url(r'^jsi18n/$',
                javascript_catalog,
                {'packages': ('newsletter',)},
                name='newsletter_js18n'))

        return my_urls + urls
Beispiel #9
0
from misago.admin.forms import AdminAuthenticationForm

from . import views

admin.autodiscover()
admin.site.login_form = AdminAuthenticationForm

urlpatterns = [
    url(r'^', include('social_django.urls', namespace='social')),
    url(r'^forum/', include('misago.urls', namespace='misago')),
    url(r'^django-admin/', admin.site.urls),
    url(r'^django-i18n.js$',
        cache_page(86400 * 2, key_prefix='misagojsi18n')(
            last_modified(lambda req, **kw: timezone.now())(
                JavaScriptCatalog.as_view(packages=['misago'], ), ), ),
        name='django-i18n'),
    url(r'^forum/test-mail-user/$',
        views.test_mail_user,
        name='test-mail-user'),
    url(r'^forum/test-mail-users/$',
        views.test_mail_users,
        name='test-mail-users'),
    url(r'^forum/test-pagination/$',
        views.test_pagination,
        name='test-pagination'),
    url(r'^forum/test-pagination/(?P<page>[1-9][0-9]*)/$',
        views.test_pagination,
        name='test-pagination'),
    url(r'^forum/test-paginated-response/$',
        views.test_paginated_response,
Beispiel #10
0
    url(r'^api/users', users, name='users'),
    url(r'', include(api.urls)),

    # Curated Thumbnail
    url(r'^base/(?P<res_id>[^/]+)/thumbnail_upload$',
        thumbnail_upload,
        name='thumbnail_upload'),
]

urlpatterns += i18n_patterns(url(r'^admin/', admin.site.urls, name="admin"), )

# Internationalization Javascript
urlpatterns += [
    url(r'^i18n/', include(django.conf.urls.i18n), name="i18n"),
    url(r'^jsi18n/$',
        JavaScriptCatalog.as_view(),
        js_info_dict,
        name='javascript-catalog')
]

urlpatterns += [  # '',
    url(r'^showmetadata/', include('geonode.catalogue.metadataxsl.urls')),
]

if settings.FAVORITE_ENABLED:
    urlpatterns += [  # '',
        url(r'^favorite/', include('geonode.favorite.urls')),
    ]

if check_ogc_backend(geoserver.BACKEND_PACKAGE):
    if settings.CREATE_LAYER:
Beispiel #11
0
    # App versions.
    url(r'pages/appversions/', include('olympia.applications.urls')),

    # Services
    url(r'', include('olympia.amo.urls')),

    # Search
    url(r'^search/', include('olympia.search.urls')),

    # Javascript translations.
    # Should always be called with a cache-busting querystring.
    # Still served for the moment, but superseded by a fully static version we
    # generate at deploy-time through our generate_jsi18n_files command.
    url(r'^jsi18n\.js$',
        cache_page(60 * 60 * 24 * 365)(JavaScriptCatalog.as_view()),
        {'domain': 'djangojs', 'packages': []}, name='jsi18n'),

    # API v3+.
    url(r'^api/', include('olympia.api.urls')),

    # Site statistics that we are going to catch, the rest will fall through.
    url(r'^statistics/', include('olympia.stats.urls')),

    # Fall through for any URLs not matched above stats dashboard.
    url(r'^statistics/', lambda r: redirect('/'), name='statistics.dashboard'),

    # Redirect patterns.
    url(r'^bookmarks/?$',
        lambda r: redirect('browse.extensions', 'bookmarks', permanent=True)),

admin.autodiscover()
admin.site.login_form = AdminAuthenticationForm


urlpatterns = [
    url(r'^', include('misago.urls', namespace='misago')),

    # Javascript translations
    url(
        r'^django-i18n.js$',
        last_modified(lambda req, **kw: timezone.now())(
            cache_page(86400 * 2, key_prefix='misagojsi18n')(
                JavaScriptCatalog.as_view(
                    packages=['misago'],
                ),
            ),
        ),
        name='django-i18n',
    ),

    # Uncomment next line if you plan to use Django admin for 3rd party apps
    #url(r'^django-admin/', admin.site.urls),
]


# If debug mode is enabled, include debug toolbar
if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
Beispiel #13
0
import django
from django.conf.urls import url

try:
    from django.views.i18n import JavaScriptCatalog
    javascript_catalog = JavaScriptCatalog.as_view()
except ImportError:  # Django < 2.0
    from django.views.i18n import javascript_catalog

from jet.views import add_bookmark_view, remove_bookmark_view, toggle_application_pin_view, model_lookup_view


app_name = 'jet'

urlpatterns = [
    url(
        r'^add_bookmark/$',
        add_bookmark_view,
        name='add_bookmark'
    ),
    url(
        r'^remove_bookmark/$',
        remove_bookmark_view,
        name='remove_bookmark'
    ),
    url(
        r'^toggle_application_pin/$',
        toggle_application_pin_view,
        name='toggle_application_pin'
    ),
    url(
Beispiel #14
0
from kirppu.views import index, MobileRedirect

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

js_packages = (
    'kirppu',
)

last_modified_date = timezone.now()

urlpatterns = [
    path('', index, name='home'),
    path(r'kirppu/', include('kirppu.urls', namespace="kirppu")),
    path(r'accounts/', include('kirppuauth.urls', namespace="kirppuauth")),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    path(r'admin/', admin.site.urls),
    path(r'i18n/', include('django.conf.urls.i18n')),
    path(r'jsi18n/', last_modified(lambda req, **kw: last_modified_date)(
        JavaScriptCatalog.as_view(packages=js_packages)),
        name="javascript-catalog"),
    re_path(r'^m/?$', MobileRedirect.as_view()),
    path('', include('kompassi_oauth2.urls')),
]
Beispiel #15
0
from misago.users.forms.auth import AdminAuthenticationForm


admin.autodiscover()
admin.site.login_form = AdminAuthenticationForm


urlpatterns = [
    url(r"^", include("misago.urls", namespace="misago")),
    # Javascript translations
    url(
        r"^django-i18n.js$",
        last_modified(lambda req, **kw: timezone.now())(
            cache_page(86400 * 2, key_prefix="misagojsi18n")(
                JavaScriptCatalog.as_view(packages=["misago"])
            )
        ),
        name="django-i18n",
    ),
    # Uncomment next line if you plan to use Django admin for 3rd party apps
    url(r"^django-admin/", admin.site.urls),
    # django-simple-sso doesn't have namespaces, we can't use namespace here
    url(r"^sso/", include("misago.sso.urls")),
]


# If debug mode is enabled, include debug toolbar
if settings.DEBUG:
    import debug_toolbar
Beispiel #16
0
router.register(r'softwares', SoftwareViewSet)
router.register(r'hardwares', HardwareViewSet)
router.register(r'installations', InstallationViewSet)

admin.autodiscover()

urlpatterns = [
    url(r'^$', views.home, name="home"),
    url(r'^api/', include(router.urls)),
    url(r'^report$', views.generic_report, name='generic_report'),
    url(r'^create-event/$', views.create_event, name="create_event"),
    url(r'^events/', include('manager.urls.events'), name='events'),
    url(r'^tags/', include('manager.urls.event_tags'), name='event_tags'),
    url(r'^admin/', include(admin.site.urls), name='admin'),
    url(r'^forms/', include(forms_builder.forms.urls)),
    url(r'^ckeditor/', include('ckeditor_uploader.urls'), name='ckeditor'),
    url(r'^accounts/profile/',
        TemplateView.as_view(template_name='account/profile.html'),
        name="user_profile"),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(),
        {'domain': 'djangojs', 'packages': None}, name='javascript-catalog'),
    url(r'^i18n/', include('django.conf.urls.i18n')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
Beispiel #17
0
from django.views import defaults
from django.views.generic import RedirectView
from django.views.i18n import JavaScriptCatalog
from django.contrib.staticfiles import views as static_views

# pylint suggests importing analytics_dashboard.core, which causes errors in our AMI
# pylint: disable=relative-import
from core import views


admin.autodiscover()

urlpatterns = [
    url(r'^$', views.LandingView.as_view(), name='landing'),
    url(r'^api-auth/', include('rest_framework.urls')),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(packages=['core', 'courses']), name='javascript-catalog'),
    url(r'^status/$', views.status, name='status'),
    url(r'^health/$', views.health, name='health'),
    url(r'^courses/', include('courses.urls')),
    url(r'^admin/', admin.site.urls),
    # TODO: the namespace arg is deprecated, but python-social-auth urls.py doesn't specify app_name so we are stuck
    # using namespace. Once python-social-auth is updated to fix that, remove the namespace arg.
    url('', include('social_django.urls', namespace='social')),
    url(r'^accounts/login/$',
        RedirectView.as_view(url=reverse_lazy('social:begin', args=['edx-oidc']), permanent=False, query_string=True),
        name='login'),
    url(r'^accounts/logout/$', views.InsightsLogoutView.as_view(), name='logout'),
    url(r'^accounts/logout_then_login/$', views.insights_logout_then_login, name='logout_then_login'),
    url(r'^test/auto_auth/$', views.AutoAuth.as_view(), name='auto_auth'),
    url(r'^announcements/', include('pinax.announcements.urls', namespace='pinax_announcements')),
]
Beispiel #18
0
app_view_patterns = [
    path('users/', include('users.urls.views_urls', namespace='users')),
    path('assets/', include('assets.urls.views_urls', namespace='assets')),
    path('perms/', include('perms.urls.views_urls', namespace='perms')),
    path('terminal/', include('terminal.urls.views_urls', namespace='terminal')),
    path('ops/', include('ops.urls.view_urls', namespace='ops')),
    path('audits/', include('audits.urls.view_urls', namespace='audits')),
    path('orgs/', include('orgs.urls.views_urls', namespace='orgs')),
    path('auth/', include('authentication.urls.view_urls'), name='auth'),
]

if settings.XPACK_ENABLED:
    app_view_patterns.append(path('xpack/', include('xpack.urls', namespace='xpack')))

js_i18n_patterns = i18n_patterns(
    path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
)

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('luna/', LunaView.as_view(), name='luna-error'),
    path('i18n/<str:lang>/', I18NView.as_view(), name='i18n-switch'),
    path('settings/', include('common.urls.view_urls', namespace='settings')),
    path('common/', include('common.urls.view_urls', namespace='common')),
    path('api/v1/', redirect_format_api),
    path('api/', include(v1_api_patterns)),

    # External apps url
    path('captcha/', include('captcha.urls')),
]
urlpatterns += app_view_patterns
Beispiel #19
0
    # Ticket authentication related
    re_path(r'^uds/page/ticket/auth/(?P<ticketId>[a-zA-Z0-9-])$', uds.web.views.ticketAuth, name='page.ticket.auth'),
    path(r'uds/page/ticket/launcher', uds.web.views.modern.index, name='page.ticket.launcher'),

    # This must be the last, so any patition will be managed by client in fact
    re_path(r'uds/page/.*', uds.web.views.modern.index, name='page.placeholder'),

    # Utility
    path('uds/utility/closer', uds.web.views.service.closer, name='utility.closer'),

    # Javascript
    path(r'uds/utility/uds.js', uds.web.views.modern.js, name="utility.js"),

    # i18n
    re_path(r'^uds/utility/i18n/(?P<lang>[a-z_-]*).js$', JavaScriptCatalog.as_view(), name='utility.jsCatalog'),
    path(r'uds/utility/i18n/', include('django.conf.urls.i18n')),

    # Downloader
    re_path(r'^uds/utility/download/(?P<idDownload>[a-zA-Z0-9-]*)$', uds.web.views.download, name='utility.downloader'),

    # WEB API path (not REST api, frontend)
    re_path(r'^uds/webapi/img/transport/(?P<idTrans>[a-zA-Z0-9-]+)$', uds.web.views.transportIcon, name='webapi.transportIcon'),
    re_path(r'^uds/webapi/img/gallery/(?P<idImage>[a-zA-Z0-9-]+)$', uds.web.views.image, name='webapi.galleryImage'),

    re_path(r'^uds/webapi/action/(?P<idService>.+)/enable/(?P<idTransport>[a-zA-Z0-9-]+)$', uds.web.views.userServiceEnabler, name='webapi.enabler'),

    re_path(r'^uds/webapi/action/(?P<idService>.+)/(?P<action>[a-zA-Z0-9-]+)$', uds.web.views.action, name='webapi.action'),

    # Services list, ...
    path(r'uds/webapi/services', uds.web.views.modern.servicesData, name='webapi.services'),
Beispiel #20
0
    re_path(r'^pluginDetection/(?P<detection>[a-zA-Z0-9-]*)$', uds.web.views.plugin_detection, name='PluginDetection'),
    # Client access enabler
    re_path(r'^enable/(?P<idService>.+)/(?P<idTransport>.+)$', uds.web.views.clientEnabler, name='ClientAccessEnabler'),

    # Releaser
    re_path(r'^release/(?P<idService>.+)$', uds.web.views.release, name='Releaser'),

    # Custom authentication callback
    re_path(r'^auth/(?P<authName>.+)', uds.web.views.authCallback, name='uds.web.views.authCallback'),
    re_path(r'^authinfo/(?P<authName>.+)', uds.web.views.authInfo, name='uds.web.views.authInfo'),
    re_path(r'^about', uds.web.views.about, name='uds.web.views.about'),
    # Ticket authentication
    re_path(r'^tkauth/(?P<ticketId>.+)$', uds.web.views.ticketAuth, name='TicketAuth'),

    # REST Api
    re_path(r'^rest/(?P<arguments>.*)$', REST.Dispatcher.as_view(), name="REST"),

    # Web admin GUI
    re_path(r'^adm/', include('uds.admin.urls')),

    # Files
    re_path(r'^files/(?P<uuid>.+)', uds.web.views.file_storage, name='uds.web.views.file_storage'),

    # Internacionalization in javascript
    # Javascript catalog. In fact, lang is not used, but it is maintanied for "backward" user templates compatibility
    re_path(r'^jsi18n/(?P<lang>[a-z]*)$', JavaScriptCatalog.as_view(), name='uds.web.views.jsCatalog'),
]

# Append urls from special dispatchers
urlpatterns += loadModulesUrls()
Beispiel #21
0
    # Top Level Pages
    path('donations/',
        tournaments.views.DonationsView.as_view(),
        name='donations'),
    path('style/',
        tournaments.views.StyleGuideView.as_view(),
        name='style-guide'),

    # Set language override
    path('i18n/',
        include('django.conf.urls.i18n')),

    # JS Translations Catalogue; includes all djangojs files in locale folders
    path('jsi18n/',
         JavaScriptCatalog.as_view(domain="djangojs", ),
         name='javascript-catalog'),

    # Summernote (WYSYWIG)
    path('summernote/',
        include('django_summernote.urls')),

    # Admin area
    path('jet/',
        include('jet.urls', 'jet')),
    path('database/',
        admin.site.urls),

    # Accounts
    path('accounts/logout/',
        auth_views.LogoutView.as_view(),
Beispiel #22
0
def js_catalog(request, lang):
    c = JavaScriptCatalog()
    c.translation = DjangoTranslation(lang, domain='djangojs')
    context = c.get_context_data()
    return c.render_to_response(context)
Beispiel #23
0
    url(r"^dashboard/", include((dashboard_urls, "dashboard"), namespace="dashboard")),
    url(r"^graphql/", csrf_exempt(GraphQLView.as_view(schema=schema)), name="api"),
    url(
        r"^sitemap\.xml$",
        sitemap,
        {"sitemaps": sitemaps},
        name="django.contrib.sitemaps.views.sitemap",
    ),
    url(r"^i18n/$", set_language, name="set_language"),
    url("", include("social_django.urls", namespace="social")),
]

translatable_urlpatterns = [
    url(r"^", include(core_urls)),
    url(r"^checkout/", include((checkout_urls, "checkout"), namespace="checkout")),
    url(r"^jsi18n/$", JavaScriptCatalog.as_view(), name="javascript-catalog"),
    url(r"^order/", include((order_urls, "order"), namespace="order")),
    url(r"^page/", include((page_urls, "page"), namespace="page")),
    url(r"^products/", include((product_urls, "product"), namespace="product")),
    url(r"^account/", include((account_urls, "account"), namespace="account")),
    url(r"^feeds/", include((feed_urls, "data_feeds"), namespace="data_feeds")),
    url(r"^search/", include((search_urls, "search"), namespace="search")),
]

urlpatterns = non_translatable_urlpatterns + i18n_patterns(*translatable_urlpatterns)

if settings.DEBUG:
    import debug_toolbar

    urlpatterns += [
        url(r"^__debug__/", include(debug_toolbar.urls)),
Beispiel #24
0
from django.urls import include, re_path
from django.views.i18n import JavaScriptCatalog

urlpatterns = [
    re_path(r'^', include('course_grader.urls')),
    re_path(r'^saml/', include('uw_saml.urls')),
    re_path(r'^support/?', include('userservice.urls')),
    re_path(r'^persistent_message/', include('persistent_message.urls')),
    re_path(r'^jsi18n/$', JavaScriptCatalog.as_view(packages=['grade_conversion_calculator', 'course_grader']), name='javascript-catalog')
]
Beispiel #25
0
from django.conf.urls import include, url
from django.views.decorators.cache import cache_page
from django.views.i18n import JavaScriptCatalog
from kanisa.views import KanisaIndexView
from kanisa.views.public.seasonal import seasonal_view


urlpatterns = [
    url(r'^$', KanisaIndexView.as_view(), {}, 'kanisa_public_index'),
    url(r'^banners/', include('kanisa.urls.public.banners')),
    url(r'^blog/', include('kanisa.urls.public.blog')),
    url(r'^christmas/$', seasonal_view, {'season': 'christmas'},
        'kanisa_public_seasonal'),
    url(r'^diary/', include('kanisa.urls.public.diary')),
    url(r'^easter/$', seasonal_view, {'season': 'easter'},
        'kanisa_public_seasonal'),
    url(r'^jsi18n/$',
        cache_page(86400, key_prefix='js18n')(JavaScriptCatalog.as_view(
            packages=['recurrence']
        )),
        name='javascript-catalog'),
    url(r'^manage/', include('kanisa.urls.management')),
    url(r'^members/', include('kanisa.urls.members')),
    url(r'^search/', include('kanisa.urls.public.search')),
    url(r'^sermons/', include('kanisa.urls.public.sermons')),
    url(r'^xhr/', include('kanisa.urls.xhr')),
]
Beispiel #26
0
 def i18n_javascript(self, request):
     """
     Displays the i18n JavaScript that the Django admin requires.
     """
     return JavaScriptCatalog.as_view(packages=["django.contrib.admin"])(request)
Beispiel #27
0
urlpatterns = i18n_patterns(
    url(r'^blog/', include('ideascube.blog.urls')),
    url(r'^library/', include('ideascube.library.urls')),
    url(r'^search/', include('ideascube.search.urls')),
    url(r'^mediacenter/', include('ideascube.mediacenter.urls')),
    url(r'^monitoring/', include('ideascube.monitoring.urls')),
    url(r'^$', views.index, name='index'),
    url(r'^welcome_staff/$', views.welcome_staff, name='welcome_staff'),
    url(r'^server/', include('ideascube.serveradmin.urls')),
    url(r'^login/$', auth_views.login, name='login'),
    url(r'^logout/$', auth_views.logout, kwargs={"next_page": "/"},
        name='logout'),
    url(r'^user/$', views.user_list, name='user_list'),
    url(r'^user/(?P<pk>[\d]+)/$', views.user_detail, name='user_detail'),
    url(r'^user/(?P<pk>[\d]+)/edit/$', views.user_update, name='user_update'),
    url(r'^user/(?P<pk>[\d]+)/set-password/$', views.set_password,
        name='user_set_password'),
    url(r'^user/new/$', views.user_create, name='user_create'),
    url(r'^user/export/$', views.user_export, name='user_export'),
    url(r'^user/import/$', views.user_import, name='user_import'),
    url(r'^user/(?P<pk>[\d]+)/delete/$',
        views.user_delete, name='user_delete'),
    url(r'^user/(?P<pk>[\d]+)/toggle-staff/$',
        views.user_toggle_staff, name='user_toggle_staff'),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(packages=['ideascube']), name='jsi18n'),
)
urlpatterns = urlpatterns + [
    url(r'^i18n/', include('django.conf.urls.i18n')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Beispiel #28
0
from datetime import date
from django.contrib import admin
from django.urls import path,  include
from django.conf.urls.i18n import i18n_patterns, set_language 
from django.contrib.auth.views import LoginView, logout_then_login
from django.views.generic.base import RedirectView
from django.views.i18n import JavaScriptCatalog
import debug_toolbar

from money import views as money_views
urlpatterns=[
    path('favicon.ico', RedirectView.as_view(url='/static/images/favicon.ico')),
]

urlpatterns=urlpatterns+ i18n_patterns(
    path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
    path('__debug__/', include(debug_toolbar.urls)),

    path('ajax/', money_views.ajax_modal_button, name='ajax_modal_button'),
    path('ajax/investment/<int:pk>/leverage/', money_views.ajax_investment_to_json, name='ajax_investment_to_json'),

    path('i18n/setlang/',  set_language, name="set_language"), 
    path('admin/', admin.site.urls,  name="admin-site"),
    path('', money_views.home, name='home'),
    
    path('login/', LoginView.as_view(template_name='login.html'), name="login"), 
    path('logout/', logout_then_login, name="logout"), 
    
    path('bank/list/', money_views.bank_list,  {'active':True}, name='bank_list_active'),
    path('bank/list/inactive/', money_views.bank_list,  {'active':False}, name='bank_list_inactive'),
    path('bank/view/<int:pk>/', money_views.bank_view, name='bank_view'),
Beispiel #29
0
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views import defaults as default_views
from django.views.i18n import JavaScriptCatalog
from graphene_django.views import GraphQLView

urlpatterns = [
    url(r'^graphql', GraphQLView.as_view(graphiql=True)),
    url(r"", include("thefederation.urls")),

    # JavaScript translations
    path("jsi18n/",
         JavaScriptCatalog.as_view(packages=['thefederation']),
         name="javascript-catalog"),

    # Admin pages
    url(settings.ADMIN_URL, admin.site.urls),
    url(r"^django-rq/", include("django_rq.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    # This allows the error pages to be debugged during development, just visit
    # these url in browser to see how these error pages look like.
    urlpatterns += [
        url(r"^400/$",
            default_views.bad_request,
            kwargs={"exception": Exception("Bad Request!")}),
        url(r"^403/$",
Beispiel #30
0
from django.conf.urls import url
from django.views.i18n import JavaScriptCatalog

from . import admin_views
from . import fiber_admin

urlpatterns = [
    url(r'^page/(?P<id>\d+)/move_up/$', admin_views.page_move_up, name='fiber_page_move_up'),
    url(r'^page/(?P<id>\d+)/move_down/$', admin_views.page_move_down, name='fiber_page_move_down'),
    url(r'^login/$', admin_views.fiber_login, name='fiber_login'),
    url(r'^pages.json$', admin_views.pages_json, name='pages_json'),
    url(r'^fiber_admin/', fiber_admin.site.urls),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), {'packages': 'fiber'}, name='fiber_i18n'),
]
Beispiel #31
0
from misago.users.forms.auth import AdminAuthenticationForm


admin.autodiscover()
admin.site.login_form = AdminAuthenticationForm


urlpatterns = [
    url(r"^", include("misago.urls", namespace="misago")),
    url(r"^", include("social_django.urls", namespace="social")),
    # Javascript translations
    url(
        r"^django-i18n.js$",
        last_modified(lambda req, **kw: timezone.now())(
            cache_page(86400 * 2, key_prefix="misagojsi18n")(
                JavaScriptCatalog.as_view(packages=["misago"])
            )
        ),
        name="django-i18n",
    ),
    # Uncomment next line if you plan to use Django admin for 3rd party apps
    url(r"^django-admin/", admin.site.urls),
]


# If debug mode is enabled, include debug toolbar
if settings.DEBUG:
    import debug_toolbar

    urlpatterns += [url(r"^__debug__/", include(debug_toolbar.urls))]
Beispiel #32
0
    load_dashboard_module_view, reset_dashboard_view

app_name = 'dashboard'

urlpatterns = [
    path('module/<int:pk>/',
         UpdateDashboardModuleView.as_view(),
         name='update_module'),
    path('update_dashboard_modules/',
         update_dashboard_modules_view,
         name='update_dashboard_modules'),
    path('add_user_dashboard_module/',
         add_user_dashboard_module_view,
         name='add_user_dashboard_module'),
    path('update_dashboard_module_collapse/',
         update_dashboard_module_collapse_view,
         name='update_dashboard_module_collapse'),
    path('remove_dashboard_module/',
         remove_dashboard_module_view,
         name='remove_dashboard_module'),
    path('load_dashboard_module/<int:pk>/',
         load_dashboard_module_view,
         name='load_dashboard_module'),
    path('reset_dashboard/', reset_dashboard_view, name='reset_dashboard'),
    path('jsi18n/',
         JavaScriptCatalog.as_view(), {'packages': 'jet'},
         name='jsi18n'),
]

urlpatterns += dashboard.urls.get_urls()
Beispiel #33
0
from django.conf import settings
from django.conf.urls import include, url, static

from django.contrib import admin
from django.views.i18n import JavaScriptCatalog

from test_app.views import root, AuthorAutocomplete

admin.autodiscover()


urlpatterns = [
    url(r'^$', root),
    url(r'^author_autocomplete/$', AuthorAutocomplete.as_view(), name="author-autocomplete"),
    url(r'^multiseek/', include(('multiseek.urls', 'multiseek'), namespace="multiseek")),

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

    url(r'^i18n/$',
        JavaScriptCatalog.as_view(packages=['multiseek']),
        name="js_i18n_catalog")

] + static.static(settings.STATIC_URL,
                  document_root=settings.STATIC_ROOT,
                  show_indexes=True)
Beispiel #34
0
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from django.views.i18n import JavaScriptCatalog

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('blog.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
]
            **kwargs
        )


urlpatterns = i18n_patterns(
    url(r'^$', login_required(LandingView.as_view()), name='home'),

    url(r'^', include('cashbook.urls')),
    url(r'^disbursements/', include('disbursements.urls', namespace='disbursements')),

    url(r'^', include('mtp_auth.urls')),
    url(r'^', include('mtp_common.user_admin.urls')),

    url(r'^', include('feedback.urls')),

    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'^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')),
Beispiel #36
0
# -*- coding: utf-8 -*-
#
from django.conf import settings
from django.urls import path, re_path, include
from django.views.i18n import JavaScriptCatalog
from . import views

urlpatterns=[
   re_path(r'^login/?$', views.login, name='login'),
   re_path(r'^logout/?$', views.logout, name='logout'),

   re_path(r'^users/?$', views.users, name='users'),
   re_path(r'^users/(?P<user>[^/]*)/?$', views.user, name='user'),
   re_path(r'^users/(?P<user>[^/]*)/prefs/?$', views.prefs, name='prefs'),
   re_path(r'^users/(?P<user>[^/]*)/prefs/(?P<prefId>[^/]*)/?$', views.pref, name='pref'),

   re_path(r'^ajax/users/?$', views.ajaxUsers, name='ajax-users'),
   re_path(r'^ajax/pref/(?P<name>[^/]+)/?$', views.ajaxPref, name='ajax-pref'),     #It can be disabled in WF-AJAX_PREF
   re_path(r'^ajax/prefs/(?P<name>[^/]+)/?$', views.ajaxPrefs, name='ajax-prefs'),  #It can be disabled in WF-AJAX_PREFS

   re_path('jsi18n/', JavaScriptCatalog.as_view(domain='django', packages=['webframe',]), name='js'),
] 
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
{%- if cookiecutter.frontend_style == 'webapp' %}
from django.views.generic.base import TemplateView
from django.views.i18n import JavaScriptCatalog{% else %}
from django.views.generic.base import RedirectView{% endif %}


admin.autodiscover()

urlpatterns = [
{%- if cookiecutter.frontend_style == 'webapp' %}
    path("", include("accounts.urls")),
    path("", TemplateView.as_view(template_name="home.html"), name="home"),
    path("jsi18n/", JavaScriptCatalog.as_view(), name="javascript-catalog"),{% else %}
    path("api/", include("{{cookiecutter.repo_name}}.rest.urls")),{% endif %}
    path("{{cookiecutter.django_admin_path}}/", admin.site.urls),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if not settings.DEBUG:
    handler500 = "{{cookiecutter.repo_name}}.views.server_error"
    handler404 = "{{cookiecutter.repo_name}}.views.page_not_found"

if settings.DEBUG:
    try:
        import debug_toolbar
Beispiel #38
0
    'domain': "djangojs",
    'packages': ('BikeMaps','mapApp',),
}



urlpatterns = [
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^api-token-auth/', auth_views.obtain_auth_token),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^accounts/', include('django.contrib.auth.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^robots.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
    url(r'^\.well-known/', include(certbot_django.server.urls)),
]

# Add internationalization url patters to these pages
urlpatterns += solid_i18n_patterns(
    url(r'^', include('mapApp.urls', namespace="mapApp")),
    url(r'^user/', include('userApp.urls', namespace="userApp")),
    url(r'^blog/', include('blogApp.urls', namespace="blogApp")),
    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
Beispiel #39
0
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.views.i18n import JavaScriptCatalog

from artifacts import views
from users import views as user_views

urlpatterns = [
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)

urlpatterns += i18n_patterns(
    path('', views.HomeView.as_view(), name='home'),
    path('contact', user_views.ContactView.as_view(), name='contact'),
    path('about', views.AboutView.as_view(), name='about'),
    path('artifact/', include('artifacts.urls')),
    path('accounts/', include('users.urls')),
    path('jsi18n/',
         JavaScriptCatalog.as_view(packages=['artifacts']),
         name='javascript-catalog'),
    path('i18n/', include('django.conf.urls.i18n')),
)