Ejemplo n.º 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"),
]
Ejemplo n.º 2
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'),

]
Ejemplo n.º 3
0
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"),
]
Ejemplo n.º 4
0
from django.conf.urls import url
from apps.users.views import UserInfoView, ImageUploadView, ChangePwdView, ChangeMobileView, MyFavOrgView
from apps.users.views import MyFavTeacherView, MyFavCourseView, MyMessageView
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/upload/$', ImageUploadView.as_view(), name='image'),
    url(r'^update/pwd/$', ChangePwdView.as_view(), name='pwd'),
    url(r'^update/mobile/$', ChangeMobileView.as_view(), name='mobile'),
    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'^myfavteacher/$', MyFavTeacherView.as_view(), name='myfavteacher'),
    url(r'^myfavcourse/$', MyFavCourseView.as_view(), name='myfavcourse'),
    url(r'^messages/$', MyMessageView.as_view(), name='messages'),
]