예제 #1
0
from django.conf.urls import url
from imager_images.views import (PhotoView, AlbumView, AlbumEditView,
                                 PhotoEditView, AlbumAddView, PhotoAddView)
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView

urlpatterns = [
    url(r'^photos/(?P<pk>\d+)/$',
        login_required(PhotoView.as_view()),
        name='photo_detail'),
    url(r'^library/', login_required(TemplateView.as_view(
                                     template_name='library.html')),
        name='library'),
    url(r'^album/(?P<pk>\d+)/$',
        login_required(AlbumView.as_view()),
        name='album_detail'),
    url(r'^album/add/$', login_required(AlbumAddView.as_view()),
        name='album_add'),
    url(r'^photos/add/$', login_required(PhotoAddView.as_view()),
        name='photo_add'),
    url(r'^album/edit/(?P<pk>\d+)/$', login_required(AlbumEditView.as_view()),
        {'success_url': 'album_detail'}, name='album_edit'),
    url(r'^photos/edit/(?P<pk>\d+)/$',
        login_required(PhotoEditView.as_view()),
        {'success_url': 'photo_detail'}, name='photo_edit'),
    url(r'^photos/(?P<pk>\d+)/detect$', PhotoView.as_view(detect=True),
        name='detect_faces')
]
예제 #2
0
"""Imagersite URL Configuration.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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 imager_images.views import LibraryView, PhotoView, AlbumView, \
    PhotoIdView, AlbumIdView, AddPhotoView, AddAlbumView, PhotoEditView, AlbumEditView

urlpatterns = [
    url(r'^library/$', LibraryView.as_view(), name="library"),
    url(r'^photos/$', PhotoView.as_view(), name="photos"),
    url(r'^albums/$', AlbumView.as_view(), name="albums"),
    url(r'^photos/(?P<pk>\d+)/$', PhotoIdView.as_view(), name="individual_photo"),
    url(r'^albums/(?P<pk>\d+)/$', AlbumIdView.as_view(), name="individual_album"),
    url(r'^albums/add/$', AddAlbumView.as_view(), name="add_albums"),
    url(r'^photos/add/$', AddPhotoView.as_view(), name="add_photos"),
    url(r'^photos/(?P<pk>\d+)/edit/$', PhotoEditView.as_view(), name="edit_photo"),
    url(r'^albums/(?P<pk>\d+)/edit/$', AlbumEditView.as_view(), name="edit_album"),
]
예제 #3
0
"""Images URLS."""

from django.conf.urls import url
from imager_images.views import (LibraryView, AlbumView, PhotoView,
                                 AlbumFormView, PhotoFormView, PublicPhotos,
                                 PublicAlbums, AlbumEditView, PhotoEditView)

urlpatterns = [
    url(r'library', LibraryView.as_view(), name='library'),
    url(r'library/(?P<user_search>[a-zA-Z0-9_.-]+$)', LibraryView.as_view()),
    url(r'^album/(?P<pk>\d+)', AlbumView.as_view(), name='album'),
    url(r'^albums/(?P<pk>\d+)/edit',
        AlbumEditView.as_view(),
        name='album_edit'),
    url(r'^photo/(?P<pk>\d+)', PhotoView.as_view(), name='photo'),
    url(r'^photos/(?P<pk>\d+)/edit',
        PhotoEditView.as_view(),
        name='photo_edit'),
    url(r'^album/add$', AlbumFormView.as_view(), name='new_album'),
    url(r'^photo/add$', PhotoFormView.as_view(), name='new_photo'),
    url(r'photos', PublicPhotos.as_view(), name='public_photos'),
    url(r'albums', PublicAlbums.as_view(), name='public_albums'),
]
예제 #4
0
from imager_images.views import (
    PhotoView,
    AlbumView,
    AlbumAddView,
    PhotoAddView,
    AlbumEditView,
    PhotoEditView,
    FaceEditView,
)


urlpatterns = [
    url(r"^$", views.IndexView.as_view(), name="index"),
    url(r"^profile/", include("imager_profile.urls")),
    url(r"^accounts/", include("registration.backends.default.urls")),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^images/", include("imager_images.urls")),
    url(r"^images/album/(?P<pk>\d+)/$", login_required(AlbumView.as_view()), name="album"),
    url(r"^images/album/add/$", login_required(AlbumAddView.as_view()), name="album_add"),
    url(r"^images/album/edit/(?P<pk>\d+)/$", login_required(AlbumEditView.as_view()), name="album_edit"),
    url(r"^images/photos/(?P<pk>\d+)/$", login_required(PhotoView.as_view()), name="photo"),
    url(r"^images/photos/add/$", login_required(PhotoAddView.as_view()), name="photo_add"),
    url(r"^images/photos/edit/(?P<pk>\d+)/$", login_required(PhotoEditView.as_view()), name="photo_edit"),
    url(r"^photos/(?P<pk>\d+)/detect$", PhotoView.as_view(detect=True), name="detect_faces"),
    url(r"^photo/(?P<pk>\d+)/face/edit/$", FaceEditView.as_view(), name="edit_face"),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
예제 #5
0
"""."""
from django.conf.urls import url
from imager_images.views import LibraryView, AlbumView, AlbumDetailView, PhotoView, PhotoDetailView, CreatePhotoView, CreateAlbumView, PhotoEditView, AlbumEditView


urlpatterns = [
    url(r'library/$', LibraryView.as_view(), name='library'),
    url(r'photos/$', PhotoView.as_view(), name='all_photos'),
    url(r'photos/(?P<pk>\d+)$', PhotoDetailView.as_view(), name='detail_photo'),
    url(r'albums/$', AlbumView.as_view(), name='all_albums'),
    url(r'albums/(?P<pk>\d+)$', AlbumDetailView.as_view(), name='detail_album'),
    url(r'create_photo/$', CreatePhotoView.as_view(), name='create_photo'),
    url(r'create_album/$', CreateAlbumView.as_view(), name='create_album'),
    url(r'photos/(?P<pk>\d+)/edit$', PhotoEditView.as_view(), name='edit_photo'),
    url(r'albums/(?P<pk>\d+)/edit$', AlbumEditView.as_view(), name='edit_album'),
]