Esempio n. 1
0
from django.contrib import admin
from rest_framework.documentation import include_docs_urls
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic import TemplateView
from article.views import IndexView,UserProfileView,UserProfileEditView

from django.conf.urls import url,include

urlpatterns = [
    path('admin/',admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    url(r'mdeditor/',include('mdeditor.urls')),

    path('api-auth/', include('rest_framework.urls')),
    path('doc/',include_docs_urls(title="Huu Api")),
    path('accounts/', include('allauth.urls')),
    path('api/', include('api.urls')),

    path('',IndexView.as_view(),name='index'),
    path('article/',include('article.urls')),
    path('accounts/profile/<int:user_id>/', UserProfileView.as_view(), name='profile'),
    path('accounts/profile/edit/', UserProfileEditView.as_view(), name='profile_edit'),
    path('about/',TemplateView.as_view(template_name="article/about_me.html"),name="about_me")
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Esempio n. 2
0
from django.urls import path

from article.views import (IndexView, ArticleView, CreateArticleView,
                           ArticleUpdateView, ArticleCommentCreate,
                           ArticleDeleteView)
from article.views.articles import LikeArticle, UnLikeArticle
from article.views.comments import LikeComment, UnLikeComment

app_name = 'article'

urlpatterns = [
    path('', IndexView.as_view(), name='list'),
    path('add/', CreateArticleView.as_view(), name='add'),
    path('<int:pk>/', ArticleView.as_view(), name='view'),
    path('<int:pk>/update', ArticleUpdateView.as_view(), name='update'),
    path('<int:pk>/delete', ArticleDeleteView.as_view(), name='delete'),
    path('<int:pk>/comments/add/',
         ArticleCommentCreate.as_view(),
         name='comment_create'),
    path('<int:pk>/like', LikeArticle.as_view(), name='article_like'),
    path('<int:pk>/unlike', UnLikeArticle.as_view(), name='article_unlike'),
    path('<int:pk>/comment/like', LikeComment.as_view(), name='comment_like'),
    path('<int:pk>/comment/unlike',
         UnLikeComment.as_view(),
         name='comment_unlike'),
]
Esempio n. 3
0
urlpatterns = [
    url(r'^xadmin/', xadmin.site.urls),
    url('^login/$', LoginView.as_view(), name="login"),
    url('^logout/$', LogoutView.as_view(), name="logout"),
    url('^register/$', RegisterView.as_view(), name="register"),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^active/(?P<active_code>.*)/$',
        AciveUserView.as_view(),
        name="user_active"),
    url(r'^forget/$', ForgetPwdView.as_view(), name="forget_pwd"),
    url(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(),
        name="reset_pwd"),
    url(r'^modify_pwd/$', ModifyPwdView.as_view(), name="modify_pwd"),

    # 首页
    url(r'^$', IndexView.as_view(), name="index"),
    # 视频联盟页
    url(r'^alliance/$', AllianceView.as_view(), name="alliance"),
    # 视频研究中心页
    url(r'^center/$', CenterView.as_view(), name="center"),
    # 金蜘蛛奖
    url(r'^spider/$', GoldenSpiderAwardView.as_view(), name="spider_default"),
    url(r'^spider/(?P<spider_id>\w+)/$',
        GoldenSpiderAwardView.as_view(),
        name="spider"),
    # 显示全部参奖作品
    url(r'^all_award_cases/(?P<sort>\w+)/$',
        AllAwardCacesView.as_view(),
        name="all_award_cases"),
    # 显示全部往期回顾
    url(r'^all_award_history/$',
Esempio n. 4
0
"""ciciot_backend URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/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, include
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
from django.contrib import admin
from article.views import IndexView

urlpatterns = [
    url(r'^$', IndexView.as_view()),
    url(r'^admin/', admin.site.urls),
    url(r'^ckeditor/', include('ckeditor_uploader.urls')),
    url(r'^articles/', include('article.urls', 'article')),
] + static('/uploads', document_root=settings.CKEDITOR_UPLOAD_PATH)
urlpatterns += staticfiles_urlpatterns()
Esempio n. 5
0
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url, patterns
from django.contrib import admin
from django.conf import settings
from article.search_views import MySearchView
from article.views import IndexView
from django.conf.urls.static import static

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),

    # article
    url(r'^$', IndexView.as_view(), name='index'),
    # url(r'^index/', include("article.urls", namespace="index")),
    url(r'^article/', include("article.urls", namespace="article")),
    # short notes
    url(r'^sn/', include("shortNotes.urls", namespace="shortNotes")),
    # apiModel
    url(r'^api_model/', include("apiModel.urls", namespace="api_model")),
    # search
    url(r'^search/', MySearchView(), name='haystack_search'),
    url('^account/', include('django.contrib.auth.urls')),
    url('^account/', include('account.urls', namespace='account')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# debug 添加到全局url
if settings.DEBUG:
    import debug_toolbar
Esempio n. 6
0
from django.urls import path,include,re_path
from article.views import IndexView,InfoView,ArchiveView,SearchResultView
from tags.views import TagsView
from django.views.static import serve

# STATIC_ROOT
from blog.settings import MEDIA_ROOT,STATIC_ROOT

import xadmin

import article


urlpatterns = [
    path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    path('',IndexView.as_view(),name='index'),
    path('info',InfoView.as_view(),name='info'),
    path('bookmark',TagsView.as_view(),name='bookmark'),
    path('archive',ArchiveView.as_view(),name='archive'),
    path('article/', include('article.urls', namespace='article')),
    path('result',SearchResultView.as_view(), name='search'),
    #配置上传文件的访问处理函数
    re_path(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    re_path(r'^static/(?P<path>.*)$', serve, {"document_root": STATIC_ROOT}),
]


handler404 = 'article.views.page_not_found'

handler500 = 'article.views.page_error'
Esempio n. 7
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from lbyledu.admin import admin_site
from article.views import IndexView


urlpatterns = [
    path('admin/', admin_site.urls),
    path('', IndexView.as_view(), name="index"),
    path('', include('organization.urls', namespace="organization")),
    path('', include('article.urls', namespace="article")),
    path('', include('users.urls', namespace="users")),
    path('office/', include('office.urls', namespace="office")),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('captcha/', include('captcha.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)