Example #1
0
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required

from djangoratings.views import AddRatingFromModel

from views import PhotosListView, PhotoDetailView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView, rate_photo

urlpatterns = patterns('',

    url(r'^photos/$',
        PhotosListView.as_view(),
        name='photos_list_photos'),

    url(r'^users/(?P<username>[\.\w]+)/photos/$',
        PhotosListView.as_view(),
        name='profile_photos'),

    url(r'^photos/(?P<photo_id>[\d]+)/$',
        PhotoDetailView.as_view(),
        name='photos_show_photo'),

    url(r'^photos/add/$',
        PhotoCreateView.as_view(),
        name='photos_add_photo'),

    url(r'^photos/(?P<photo_id>[\d]+)/edit/$',
        PhotoUpdateView.as_view(),
        name='photos_edit_photo'),

    url(r'^photos/(?P<photo_id>[\d]+)/delete/$',
        PhotoDeleteView.as_view(),
Example #2
0
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required

from djangoratings.views import AddRatingFromModel

from views import PhotosListView, PhotoDetailView, PhotoCreateView, PhotoUpdateView, PhotoDeleteView, rate_photo

urlpatterns = patterns(
    '',
    url(r'^photos/$', PhotosListView.as_view(), name='photos_list_photos'),
    url(r'^users/(?P<username>[\.\w]+)/photos/$',
        PhotosListView.as_view(),
        name='profile_photos'),
    url(r'^photos/(?P<photo_id>[\d]+)/$',
        PhotoDetailView.as_view(),
        name='photos_show_photo'),
    url(r'^photos/add/$', PhotoCreateView.as_view(), name='photos_add_photo'),
    url(r'^photos/(?P<photo_id>[\d]+)/edit/$',
        PhotoUpdateView.as_view(),
        name='photos_edit_photo'),
    url(r'^photos/(?P<photo_id>[\d]+)/delete/$',
        PhotoDeleteView.as_view(),
        name='photos_remove_photo'),
    url(r'^photos/(?P<photo_id>[\d]+)/comments/$',
        PhotoDetailView.as_view(template_name='photos/photo_comments.html'),
        name='photos_comments_photo'),
    url(r'^photos/(?P<photo_id>[\d]+)/ratings/$',
        PhotoDetailView.as_view(template_name='photos/photo_ratings.html'),
        name='photos_ratings_photo'),
    url(r'photos/(?P<photo_id>\d+)/rate/(?P<score>\d+)/',
        rate_photo,
Example #3
0
from django.conf.urls import url
from views import IndexView, FacebookAuthView,\
                  DashboardView, LogoutView,\
                  PhotosListView, PhotoUploadView,\
                  PhotoServiceView, PhotoUpdateDeleteView

urlpatterns = [
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^auth/facebook/$', FacebookAuthView.as_view(), name='facebook_auth'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^dashboard/$', DashboardView.as_view(), name='dashboard'),
    url(r'^dashboard/photos/$', PhotosListView.as_view(), name='photos'),
    url(r'^dashboard/photos/upload/$',
        PhotoUploadView.as_view(),
        name='photo_upload'),
    url(r'^dashboard/photos/(?P<public_id>[\w]+)/$',
        PhotoUpdateDeleteView.as_view(),
        name='photo_update_delete'),
    url(r'^media/photos/(?P<username>[\w\-]+)/' +
        r'(?P<effects>[\w\,]+)/(?P<filename>[\w\-\.]+)$',
        PhotoServiceView.as_view(),
        name='photo_effects_service'),
    url(r'^media/photos/(?P<username>[\w\-]+)/(?P<filename>[\w\-\.]+)$',
        PhotoServiceView.as_view(),
        name='photo_service'),
]