コード例 #1
0
ファイル: urls.py プロジェクト: pombredanne/lizard-rainapp
from django.template import Context
from django.template import loader

from lizard_fewsjdbc.views import JdbcSourceView, HomepageView

admin.autodiscover()
handler404  # pyflakes

urlpatterns = patterns(
    '',
    url(r'^$',
        HomepageView.as_view(template_name='lizard_rainapp/homepage.html'),
        name="lizard_rainapp.homepage",
        ),
    url(r'^fews_jdbc/(?P<jdbc_source_slug>.*)/$',
        JdbcSourceView.as_view(adapter_class='adapter_rainapp',
                               filter_url_name="lizard_rainapp.jdbc_source"),
        name="lizard_rainapp.jdbc_source",
        ),
    (r'^admin/', include(admin.site.urls)),
    )


if settings.DEBUG:
    # Add this also to the projects that use this application
    urlpatterns += patterns('',
        (r'', include('staticfiles.urls')),
    )


def handler500(request):
    """500 error handler which includes ``request`` in the context.
コード例 #2
0
ファイル: urls.py プロジェクト: lizardsystem/lizard-fewsjdbc
from django.conf.urls import url, patterns, include
from django.conf import settings
from django.contrib import admin

from lizard_fewsjdbc.views import (HomepageView, JdbcSourceView,
                                   ThresholdsView, ThresholdUpdateView,
                                   ThresholdDeleteView, ThresholdCreateView)

urlpatterns = patterns(
    '',
    url(r'^$',
        HomepageView.as_view(),
        name="lizard_fewsjdbc.homepage",
        ),
    url(r'^fews_jdbc/(?P<jdbc_source_slug>.*)/$',
        JdbcSourceView.as_view(),
        name="lizard_fewsjdbc.jdbc_source",
        ),
    (r'^api/', include('lizard_fewsjdbc.api.urls')),
    # threshold urls
    url(r'^thresholds/create/$', ThresholdCreateView.as_view(),
        name="lizard_fewsjdbc.threshold_create"),
    url(r'^thresholds/update/$', ThresholdUpdateView.as_view(),
        name="lizard_fewsjdbc.threshold_update"),
    url(r'^thresholds/delete/(?P<pk>\d+)/$', ThresholdDeleteView.as_view(),
        name="lizard_fewsjdbc.threshold_delete"),
    url(r'^thresholds/$', ThresholdsView.as_view(),
        name="lizard_fewsjdbc.thresholds"),
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', {
        'packages': ('lizard_fewsjdbc',)})
)