コード例 #1
0
from channels import include as routing_include
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin

from places.views import PlaceListView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', PlaceListView.as_view(), name='index'),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_PATH,
                          document_root=settings.MEDIA_ROOT)

channel_routing = [
    routing_include('votes.urls.websocket_routing', path=r'^/votes/stream'),
    routing_include('votes.urls.votes_routing'),
]
コード例 #2
0
ファイル: urls.py プロジェクト: openpolis/op_api3
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from rest_framework.urlpatterns import format_suffix_patterns
from places.views import MapsView, PlaceListView, PlaceDetailView, PlaceTypeDetailView, PlaceTypeListView, IdentifierListView, \
    IdentifierDetailView, LanguageDetailView, LanguageListView, ClassificationListView, \
    ClassificationDetailView, ClassificationNodeDetailView

__author__ = 'guglielmo'

urlpatterns = patterns('places.views',
   url(r'^$', MapsView.as_view(), name='api-root'),
   url(r'^places$', PlaceListView.as_view(), name='place-list'),
   url(r'^places/(?P<slug>[\w-]+)$', PlaceDetailView.as_view(), name='place-detail'),
   url(r'^placetypes$', PlaceTypeListView.as_view(), name='placetype-list'),
   url(r'^placetypes/(?P<slug>[\w-]+)$', PlaceTypeDetailView.as_view(), name='placetype-detail'),
   url(r'^classifications$', ClassificationListView.as_view(), name='classification-list'),
   url(r'^classifications/(?P<slug>[\w-]+)$', ClassificationDetailView.as_view(), name='classification-detail'),
   url(r'^classifications/(?P<tag__slug>[\w-]+)/places/(?P<place__slug>[\w-]+)$',
       ClassificationNodeDetailView.as_view(), name='classificationnode-detail'),
   url(r'^identifiers$', IdentifierListView.as_view(), name='identifier-list'),
   url(r'^identifiers/(?P<slug>[\w-]+)$', IdentifierDetailView.as_view(), name='identifier-detail'),
   url(r'^languages$', LanguageListView.as_view(), name='language-list'),
   url(r'^languages/(?P<iso639_1_code>\w+)$', LanguageDetailView.as_view(), name='language-detail'),

)

# Format suffixes
urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
コード例 #3
0
ファイル: urls.py プロジェクト: rkaregar/Kakhneshin
from django.urls import path

from places.views import PlaceTinyDetailView, PlaceCreateView, PlaceDeleteView, PlaceUpdateView, PlaceListView, \
    PlaceSearchView

urlpatterns = [
    path('', PlaceListView.as_view(), name='all'),
    path('create/', PlaceCreateView.as_view(), name='place_create'),
    path('<int:place_pk>/delete/',
         PlaceDeleteView.as_view(),
         name='place_delete'),
    path('<int:place_pk>/update/',
         PlaceUpdateView.as_view(),
         name='place_update'),
    path('<int:place_pk>/detail/',
         PlaceTinyDetailView.as_view(),
         name='place_detail'),
    path('search/', PlaceSearchView.as_view(), name='place_search'),
]
コード例 #4
0
ファイル: urls.py プロジェクト: MaciejPuczkowski/epolonica
    ArticleListView,
    CreatePlaceView,
    EditPlaceView,
    CreatePlaceContentView,
    PublishedView,
    EditArticleView,
    EditPhotoView,
    UrlPlaceListView,
)
from places.models import Place, Photo, Article, PlaceTranslation
from places.forms import PlaceForm, ArticleForm, PhotoForm, TranslatePlaceForm
from core.views import ObservedContentsView, TranslateView

urlpatterns = patterns(
    "",
    (r"^$", PlaceListView.as_view()),
    (r"^page_(?P<page>\d)$", PlaceListView.as_view()),
    (r"^place,(?P<title>[^,]*),(?P<id>\d+).html$", PlaceView.as_view()),
    (r"^published.html$", UrlPlaceListView.as_view()),
    (r"^promoted.html$", UrlPlaceListView.as_view(title="Promoted", template_name="plist.html")),
    (r"^(?P<title>[^,]*),(?P<lang>[^,]*),(?P<id>\d+).html$", PlaceView.as_view()),
    (r"^(?P<title>.*),(?P<id>\d)/gallery,(?P<page>\d).html$", PhotoListView.as_view()),
    (r"^(?P<title>.*),(?P<id>\d)/articles,(?P<page>\d).html$", ArticleListView.as_view()),
    (r"^article/(?P<title>.*),(?P<id>\d).html$", ArticleView.as_view()),
    (r"^(?P<title>.*),(?P<id>\d)/gallery,(?P<page>\d)$", PhotoListView.as_view()),
    (r"^photo/(?P<title>.*),(?P<id>\d).html$", PhotoView.as_view()),
    (r"^add.html$", CreatePlaceView.as_view()),
    (
        r"^translate/(?P<id>\d*).html$",
        TranslateView.as_view(form_class=TranslatePlaceForm, model=Place, trans_model=PlaceTranslation),
    ),
コード例 #5
0
ファイル: urls.py プロジェクト: gelliravi/django-match-maker
"""URLs for the ``places`` app."""
from django.conf.urls.defaults import patterns, url

from places.views import PlaceCreateView, PlaceDetailView, PlaceListView


urlpatterns = patterns(
    '',
    url(r'^$',
        PlaceListView.as_view(),
        name='places_list',),

    url(r'^(?P<pk>\d+)/$',
        PlaceDetailView.as_view(),
        name='places_detail',),

    url(r'^create/$',
        PlaceCreateView.as_view(),
        name='places_create',),
)
コード例 #6
0
"""URLs for the ``places`` app."""
from django.conf.urls.defaults import patterns, url

from places.views import PlaceCreateView, PlaceDetailView, PlaceListView

urlpatterns = patterns(
    '',
    url(
        r'^$',
        PlaceListView.as_view(),
        name='places_list',
    ),
    url(
        r'^(?P<pk>\d+)/$',
        PlaceDetailView.as_view(),
        name='places_detail',
    ),
    url(
        r'^create/$',
        PlaceCreateView.as_view(),
        name='places_create',
    ),
)
コード例 #7
0
# -*- coding: utf-8 -*-
"""Definition of places app urls."""
from __future__ import unicode_literals

from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from places.views import (PlaceAddView, PlaceDetailView, PlaceListView,
                          UserPlaceListView)

app_name = 'places'
urlpatterns = [
    url(r'^$', PlaceListView.as_view(), name='places-index'),
    url(r'^add/$', login_required(PlaceAddView.as_view()), name='places-new'),
    url(r'^filter/(?P<category_slug>[-\w]+)/$', PlaceListView.as_view(), name='places-category'),
    url(r'^by/(?P<username>[-\w]+)/$', UserPlaceListView.as_view(), name='places-user-list'),
    url(r'^(?P<slug>[-\w]+)/$', PlaceDetailView.as_view(), name='places-detail'),
]