Exemple #1
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required

from apps.users.views import UserInfoView, UploadImageView, ChangePwdView, ChangeMobileView
from apps.users.views import MyFavOrgView, MyFavTeacherView, MyFavCourseView, MyMessageView

urlpatterns = [
    url(r'^info/$', UserInfoView.as_view(), name="info"),
    url(r'^image/upload/$', UploadImageView.as_view(), name="image"),
    url(r'^update/pwd/$', ChangePwdView.as_view(), name="update_pwd"),
    url(r'^update/mobile/$', ChangeMobileView.as_view(), name="update_mobile"),
    #url(r'^mycourse/$', MyCourseView.as_view(), name="mycourse"),
    url(r'^mycourse/$',
        login_required(
            TemplateView.as_view(template_name="usercenter-mycourse.html"),
            login_url="/login/"), {"current_page": "mycourse"},
        name="mycourse"),
    url(r'^myfavorg/$', MyFavOrgView.as_view(), name="myfavorg"),
    url(r'^myfav_teacher/$', MyFavTeacherView.as_view(),
        name="myfav_teachers"),
    url(r'^myfav_course/$', MyFavCourseView.as_view(), name="myfav_course"),
    url(r'^messages/$', MyMessageView.as_view(), name="messages"),
]
Exemple #2
0
from django.conf.urls import url
from apps.users.views import UserInfoView, UploadImageView, ChangePwdView, ChangeMobileView, MycourseView, MyFavView,MyFavTeacherView,MyFavCourseView
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required

urlpatterns = [
    url(r'^info/$', UserInfoView.as_view(), name='info'),
    url(r'^image/upolad/$', UploadImageView.as_view(), name='image'),
    url(r'^update/pwd/$', ChangePwdView.as_view(), name='update_pwd'),
    url(r'^update/mobile/$', ChangeMobileView.as_view(), name='update_mobile'),
    # url(r'^mycourse/$', MycourseView.as_view(), name='my_course'),
    url(r'^mycourse/$',
        login_required(TemplateView.as_view(template_name="usercenter-mycourse.html"), login_url="/login"),
        {"current_page": "mycourse"},
        name='my_course'),
    url(r'^mafavorg/$', MyFavView.as_view(), name='my_fav_org'),
    url(r'^mafavteacher/$', MyFavTeacherView.as_view(), name='my_fav_teacher'),
    url(r'^mafavcourse/$', MyFavCourseView.as_view(), name='my_fav_course'),
]
Exemple #3
0
from django.urls import path, include, re_path
from apps.users.views import UserinfoView, UploadImageView, UpdatePwdView, SendEmailCodeView, UpdateEmailView, \
    MyCourseView, MyFavOrgView, MyFavTeacherView,MyFavCourseView,MyMessageView

app_name = 'users'

urlpatterns = [
    #用户信息
    path("info/", UserinfoView.as_view(), name='user_info'),
    #用户图像上传
    path("image/upload", UploadImageView.as_view(), name='image_upload'),
    #修改密码
    path("update/pwd/", UpdatePwdView.as_view(), name='update_pwd'),
    #发送邮箱验证码
    path("sendemail_code/", SendEmailCodeView.as_view(),
         name='sendemail_code'),
    #修改邮箱
    path("update_email/", UpdateEmailView.as_view(), name='update_email'),
    #我的课程
    path("mycourse/", MyCourseView.as_view(), name='mycourse'),
    #我的收藏-课程机构
    path('myfav/org', MyFavOrgView.as_view(), name="myfav_org"),
    # 我的收藏--授课讲师
    path('myfav/teacher/', MyFavTeacherView.as_view(), name="myfav_teacher"),
    #我的收藏--课程
    path('myfav/course/', MyFavCourseView.as_view(), name="myfav_course"),
    #我的消息
    path('my_message/', MyMessageView.as_view(), name="my_message"),
]
Exemple #4
0
from django.contrib.auth.decorators import login_required

from apps.users.views import LoginView, LogoutView, SendSmsView, MobileLoginView, RegisterView, UserInfoView, \
    UploadImageView, UploadInfoView, UpdatePwdView
from apps.users.views import UpdateMobileView, MyFavOrgView, MyFavTeacherView, MyFavCourseView, UsersMessageView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('send_sms/', SendSmsView.as_view(), name='dend_sms'),
    path('mobilelogin', MobileLoginView.as_view(), name='mobilelogin'),
    path('register/', RegisterView.as_view(), name='register'),

    # 个人中心
    url(r'^user_info$', UserInfoView.as_view(), name='user_info'),  # 个人中心-个人资料
    url(r'^upload_image$', UploadImageView.as_view(),
        name='upload_image'),  # 个人中心-个人资料-修改头像
    url(r'^upload_info$', UploadInfoView.as_view(),
        name='upload_info'),  # 个人中心-个人资料修改
    url(r'^update_pwd$', UpdatePwdView.as_view(),
        name='update_pwd'),  # 个人中心-个人资料密码修改
    url(r'^update_mobile$', UpdateMobileView.as_view(),
        name='update_mobile'),  # 个人中心-个人资料手机号修改

    # 我的课程
    url(r'^mycourse$',
        login_required(
            TemplateView.as_view(template_name='usercenter-mycourse.html')),
        kwargs={'active': 'mycourse'},
        name='mycourse'),
from django.conf.urls import url
from django.urls import path,re_path
from apps.users.views import UserInfoView,UploadImageView,ChangePwdView,MyCourseView,FavOrgView,\
    FavTeacherView,FavCourseView,MyMessageView

urlpatterns=[
    re_path("^info/$",UserInfoView.as_view(),name="info"),
    re_path("^image/upload/$",UploadImageView.as_view(),name="upload"),
    re_path("^update/pwd/$",ChangePwdView.as_view(),name="update_pwd"),
    re_path("^my_course/$",MyCourseView.as_view(),name="mycourse"),
    re_path("^fav_org/$",FavOrgView.as_view(),name="fav_org"),
    re_path("^fav_teacher/$",FavTeacherView.as_view(),name="fav_teacher"),
    re_path("^fav_course/$",FavCourseView.as_view(),name="fav_course"),
    re_path("^my_messages/$",MyMessageView.as_view(),name="my_message"),
]
Exemple #6
0
from django.urls import path
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from apps.users.views import UserInfoView,UploadImageView,ChangePwdView,ChangeMobileView,MyCourseView,MyFavOrgView,MyFavTeaView,MyFavCourseView,MyMessageView
app_name='users'

urlpatterns=[
    path('info/',UserInfoView.as_view(),name='info'),
    path('image/upload/',UploadImageView.as_view(),name='image'),
    path('update/pwd/',ChangePwdView.as_view(),name='update'),
    path('update/mobile/',ChangeMobileView.as_view(),name='update_mobile'),
    #path('mycourse/',MyCourseView.as_view(),name='mycourse')#只有get方法,写 一个视图函数,或者直接使用下面的方式
    path('mycourse/',login_required(TemplateView.as_view(template_name="usercenter-mycourse.html"),login_url="/login/"),{"current_page":"mycourse"},name='mycourse'),
    path('myfavorg/',MyFavOrgView.as_view(),name='myfavorg'),
    path('myfavtea/',MyFavTeaView.as_view(),name='myfavtea'),
    path('myfavcour/',MyFavCourseView.as_view(),name='myfavcour'),
    path('messages/',MyMessageView.as_view(),name='messages'),

]