Exemple #1
0
from django.conf.urls import url, patterns

from views import MyProfileView, UserInfoView, UserProfileUpdateView
from views import AvatarUploadView, AvatarDeleteView, UserProfileDeleteView

urlpatterns = patterns(
    "",
    url(r"^$", MyProfileView.as_view(), name="my_profile"),
    url(r"^(?P<username>[\w.@+-]+)/info/$", UserInfoView.as_view(), name="user_detail"),
    url(r"^accounts/settings/info/$", UserProfileUpdateView.as_view(), name="userprofile_update"),
    url(r"^accounts/avatar_upload/$", AvatarUploadView.as_view(), name="avatar_upload"),
    url(r"^(?P<pk>\d+)/avatar_delete/$", AvatarDeleteView.as_view(), name="avatar_delete"),
    url(r"^(?P<pk>\d+)/profile_delete/$", UserProfileDeleteView.as_view(), name="profile_delete"),
)
Exemple #2
0
    PostEditView,
    PostDeleteView,
    UserProfileView,
    UserProfileUpdateView,
    UserProfileCreateView,
    LoginView,
    RegisterView,
    LogoutView,
    UploadImage,
    
)

urlpatterns = [
    url(r'^$', index, name='index'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^$', PostListView.as_view(), name='post_list'),
    url(r'^post/(?P<pk>[0-9]+)/create$', PostCreateView.as_view(), name='post_create'),
    url(r'^post/(?P<pk>[0-9]+)/edit$', PostEditView.as_view(), name='post_edit'),
    url(r'^post/(?P<pk>[0-9]+)$', post_detail, name='post_detail'),
    url(r'^post/(?P<pk>[0-9]+)/delete$', PostDeleteView.as_view(), name='post_delete'),
    url(r'^post/(?P<pk>[0-9]+)/comment/create$', CommentCreateView.as_view(), name='comment_create'),
    url(r'^userprofile/(?P<pk>[0-9]+)$', UserProfileView.as_view(), name='user_profile'),
    url(r'^userprofile/(?P<pk>[0-9]+)/edit$', UserProfileUpdateView.as_view(),name='profile_edit'),
     url(r'^userprofile/(?P<pk>[0-9]+)/create$', UserProfileCreateView.as_view(),
        name='user_profile_create'),
    url(r'^post/(?P<pk>[0-9]+)/comment/(?P<pk_comment>[0-9]+)/edit$', CommentEditView.as_view(), name='comment_edit'),
    url(r'^post/(?P<pk>[0-9]+)/comment/(?P<pk_comment>[0-9]+)/delete$', CommentDeleteView.as_view(), name='comment_delete'),
    url(r'^post/(?P<pk>[0-9]+)/image/create$', UploadImage.as_view(), name='upload_image'),
] + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) 
Exemple #3
0
from django.conf.urls import url, patterns

from views import MyProfileView, UserInfoView, UserProfileUpdateView
from views import AvatarUploadView, AvatarDeleteView, UserProfileDeleteView

urlpatterns = patterns(
    '',
    url(r'^$', MyProfileView.as_view(), name='my_profile'),
    url(r'^(?P<username>[\w.@+-]+)/info/$',
        UserInfoView.as_view(),
        name='user_detail'),
    url(r'^accounts/settings/info/$',
        UserProfileUpdateView.as_view(),
        name='userprofile_update'),
    url(r'^accounts/avatar_upload/$',
        AvatarUploadView.as_view(),
        name='avatar_upload'),
    url(r'^(?P<pk>\d+)/avatar_delete/$',
        AvatarDeleteView.as_view(),
        name="avatar_delete"),
    url(r'^(?P<pk>\d+)/profile_delete/$',
        UserProfileDeleteView.as_view(),
        name="profile_delete"),
)
Exemple #4
0
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.decorators import login_required
from django.views.generic.base import TemplateView
from views import UserProfileDetailView, UserUpdateView, UserProfileUpdateView,\
                  UserOptionUpdateView, UserAccountUpdateView, UserMaterialListView

urlpatterns = patterns('',
    url(r'^config/?$',     login_required(UserUpdateView.as_view()),
        name='auth_user_update'),
    url(r'^config/profile/?$',     login_required(UserProfileUpdateView.as_view()),
        name='auth_userprofile_update'),
    url(r'^config/option/?$',      login_required(UserOptionUpdateView.as_view()),
        name='auth_useroption_update'),
    url(r'^config/accounts/?$',    login_required(UserAccountUpdateView.as_view()),
        name='auth_useraccount_update'),
    url(r'^(?P<pk>\d+)/$',           UserProfileDetailView.as_view(), name='auth_user_detail'),
    url(r'^(?P<pk>\d+)/materials/$', UserMaterialListView.as_view(), name='auth_user_material_list'),
)