Ejemplo n.º 1
0
"""myblog URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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
from django.contrib import admin
from django.views.generic import TemplateView  # 专门用于静态文件

from article.views import ArticleView, ArticlePage, ArchivesView, AboutmeView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^home/$', ArticleView.as_view(), name='home'),
    url(r'^home/(?P<article_id>\d+)/$', ArticlePage.as_view(), name='detail'),
    url(r'^archives/$', ArchivesView.as_view(), name='archives'),
    url(r'^tag/(?P<tag>\w+)/$', 'article.views.search_tag', name='search_tag'),
    url(r'^aboutme/$', AboutmeView.as_view(), name='aboutme'),
    # url(r'^search/$','article.views.blog_search', name = 'search'),
]
Ejemplo n.º 2
0
    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
import xadmin
from django.views.static import serve
from .settings import STATIC_ROOT, MEDIA_ROOT
from article.views import HomeView, TagsView, ArticleView, ArticleDetialView, TagsDetialView

urlpatterns = [
    url(r'^static/(?P<path>.*)', serve, {"document_root": STATIC_ROOT}),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    url(r'^xadmin/', xadmin.site.urls),
    url(r'^ueditor/', include('DjangoUeditor.urls')),
    url(r'^$', HomeView.as_view(), name="home"),
    url(r'^tags/$', TagsView.as_view(), name="tags"),
    url(r'^article/$', ArticleView.as_view(), name="article"),
    url(r'^article/(?P<article_id>\d+)/',
        ArticleDetialView.as_view(),
        name="article_detail"),
    url(r'^tags/(?P<tags_id>.*)/',
        TagsDetialView.as_view(),
        name="tags_detail"),
]
Ejemplo n.º 3
0
from django.urls import path
from django.views.generic import TemplateView

from article.views import ArticleView, ArticleLabelView, ArticleSeriesView, ArticleListView, AddArticleView, \
    ArticleSeriesListView

urlpatterns = [
    # path('', TemplateView.as_view(template_name="article/article_list.html")),
    path('', ArticleView.as_view()),
    path('list/', ArticleListView.as_view()),
    path('list/<str:order_type>/', ArticleListView.as_view()),
    path('list/<str:order_type>/series/<int:series_id>/', ArticleListView.as_view()),
    path('list/<str:order_type>/label/<int:label_id>/', ArticleListView.as_view()),
    path('list/series/<int:series_id>/', ArticleListView.as_view()),
    path('addArticle/', AddArticleView.as_view()),
    path('label/', ArticleLabelView.as_view()),
    path('series/', ArticleSeriesView.as_view()),
    path('series/list/', ArticleSeriesListView.as_view()),
    path('series/list/<str:order_type>/', ArticleSeriesListView.as_view()),
    path('detail/', TemplateView.as_view(template_name="article/article_detail.html")),
    path('detail/<int:id>/', ArticleView.as_view()),
]
Ejemplo n.º 4
0
# encoding=utf-8

__author__ = 'xiaowang'
__date__ = '27/11/15'


from django.conf.urls import url
from article.views import ArticleView

urlpatterns = [
    url(r'^article/(\d*)$', ArticleView.as_view()),
]
Ejemplo n.º 5
0
    url(r'^category_list/(?P<category>.+)/$',
        CategoryListView.as_view(),
        name='category_list'),
    url(r'^archives/$', ArchiveView.as_view(), name='archive'),
    url(r'^tags/list/$', TagView.as_view(), name='tag'),
    url(r'^tag/(?P<tag_name>.+)/$',
        ArticleTagView.as_view(),
        name='tag_article'),
    url(r'^messages/$', MessageView.as_view(), name='message'),
    url(r'^comments/(?P<article_id>\d+)/$',
        CommentView.as_view(),
        name='comment'),
    url(r'^SecWeb/$', SecWebView.as_view(), name='secweb'),
    url(r'^count/$', CountView.as_view(), name='count'),
    url(r'^article/(?P<title>.+)&(?P<is_com>.+)/$',
        ArticleView.as_view(),
        name='article'),
    url(r'^user/', include("users.urls", namespace='user')),
    url(r'^sendcode/$', SendCodeView.as_view(), name='sendcode'),

    # 富文本相关
    # url(r'^ueditor/', include('DjangoUeditor.urls')),
    # 验证码
    url(r'^captcha/', include('captcha.urls')),

    # 媒体文件
    url(r'^media/(?P<path>.*/)', serve, {"document_root": MEDIA_ROOT}),
]

# 配置全局404页面
handle404 = 'users.views.page_not_found'
Ejemplo n.º 6
0
from django.urls import path,include
from article.views import ArticleView
app_name = 'article'
urlpatterns = [
    path('<int:id>/', ArticleView.as_view(), name="article"),
]
Ejemplo n.º 7
0
urlpatterns = [
    # Public pages
    path('catalog/lots/list/', CatalogLotsListView.as_view()),
    path('catalog/lots/<str:category>/', CatalogLotsView.as_view()),
    path('catalog/lots/<str:category>/<str:group>/',
         CatalogLotsView.as_view()),
    path('catalog/lots/<str:category>/<str:pargroup>/<str:group>/',
         CatalogLotsView.as_view()),
    path('catalog/lots/', CatalogLotsView.as_view()),
    path('catalog/groups/list/', CatalogGroupsListView.as_view()),
    path('lot/<str:alias>/', LotView.as_view()),
    path('product/<str:alias>/', ProductView.as_view()),
    path('brand/<str:alias>/', BrandView.as_view()),
    path('supplier/office/<str:alias>/', SupplierView.as_view()),
    path('supplier/<str:alias>/', SupplierOrgView.as_view()),
    path('article/<str:alias>/', ArticleView.as_view()),
    path('search/', SearchView.as_view()),
    path('tag/<str:tag>/', TagView.as_view()),

    # User
    path('register/done/', RegisterDoneView.as_view()),
    path('register/', RegisterView.as_view()),
    path(
        'login/',
        auth_views.LoginView.as_view(template_name='user/login.html',
                                     extra_context={"context":
                                                    Context.get()})),
    path('logout/', auth_views.LogoutView.as_view()),
    url(r'^user/', include('user.urls')),
    url(r'^acomp/', include('acomp.urls')),
    url(r'^sender/', include('sender.urls')),
Ejemplo n.º 8
0
from django.conf.urls import patterns, url
from article.views import ArticleView, ArticleWriteView, ArticleEditView


"""
urlpatterns = patterns('',
                        url(r'^(?P<article_id>\d+)/edit/$', 'article.views.article_edit'),
                        url(r'^(?P<article_id>\d+)/edit_ok/$', 'article.views.article_edit_ok'),
                        url(r'^(?P<article_id>\d+)/delete/$', 'article.views.article_delete_ok'),
                        url(r'^(?P<article_id>\d+)/$', 'article.views.article_view'),
                        url(r'^write/(?P<board_id>\d+)/ok/$', 'article.views.article_write_ok'),
                        url(r'^write/(?P<board_id>\d+)/$', 'article.views.article_write'),
)
"""

urlpatterns = patterns('',
    url(r'^(?P<article_pk>\d+)/edit/$', ArticleEditView.as_view()),
    url(r'^(?P<article_pk>\d+)/$', ArticleView.as_view(), name='article'),
    url(r'^write/(?P<board_pk>\d+)/$', ArticleWriteView.as_view()),
)
Ejemplo n.º 9
0
from django.contrib import admin
from django.urls import path
from article.views import ArticleView, AuthorView

urlpatterns = [
    path('articles/', ArticleView.as_view()),
    path('authors/', AuthorView.as_view())
]
Ejemplo n.º 10
0
from django.urls import path
from article.views import ArticleView
from . import views

app_name = 'article'

urlpatterns = [

    path('', ArticleView.as_view(), name='article'),
    path('<int:title1_id>/', views.rush, name='rush'),

]
Ejemplo n.º 11
0
#     'article': GenericSitemap({'queryset': UserProfile.objects.all(),}, priority=0.6),
#     # 如果还要加其它的可以模仿上面的
# }

router = routers.DefaultRouter()

router.register(r'notes', NoteListViewSet, basename="notes")
router.register(r'docs', DocumentFileListViewSet, basename="docs")
router.register(r'softs', SoftWareFileListViewSet, basename="docs")
router.register(r'doctags', DocTagListViewSet, basename="doctags")



urlpatterns = [

    path('', ArticleView.as_view(), name='index'),
    path('add', ArticleCreateView.as_view(), name='addArticle'),
    path('admin/', admin.site.urls),
    path('article/', include('article.urls')),
    path('user/', include('user.urls')),
    path('notebook/', include('notebook.urls')),
    path('jquery/', include('jqueryDemo.urls')),
    path('store/', include('filemanagement.urls',  namespace='file-management')),

    path('uploadImg/', csrf_exempt(UploadImg), name='UploadImg'),
    path('showImage/', ShowUploadImg, name='ShowUploadImg'),
    path('docs/', include_docs_urls(title="Beyond PLM")),
    path('api/', include(router.urls)),

    re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT }),
    url(r'^api-auth/', include('rest_framework.urls'))
Ejemplo n.º 12
0
from django.contrib import admin
from django.urls import path

from article.views import ArticleView

app_name = 'articles'

urlpatterns = [
    path('articles/', ArticleView.as_view()),
    path('articles/<int:pk>', ArticleView.as_view()),
]
Ejemplo n.º 13
0
"""SAS URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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
from django.contrib import admin
from article.views import ArticleView

import xadmin

urlpatterns = [
    url(r'^sas/', xadmin.site.urls),
    url(r'^$', ArticleView.as_view(), name='index'),
]
Ejemplo n.º 14
0
from __future__ import unicode_literals
from django.conf.urls import patterns, url

#from article.views import article_view, article_list, chapter_list
from article.views import ArticlePostView, ArticleView, ArticleIndexListView,\
    ArticleListView, ArticleIndexPostView, delete_article, delete_articleindex

urlpatterns = patterns('',
    url(r"^view/(?P<pk>\d+)/$", ArticleView.as_view(), name="article_view"),
    url(r"^list/$", ArticleListView.as_view(), name="article_list"),
    url(r"^new/$", ArticlePostView.as_view(), name="article_new"),
    url(r"^edit/(?P<pk>\d+)/$", ArticlePostView.as_view(), name="article_edit"),
    url(r"^delete/(?P<pk>\d+)/$", delete_article, name="article_delete"),
    
    #url(r"^indexview/(?P<pk>\d+)/$", ArticleIndexView.as_view(), name="articleindex_view"),
    url(r"^indexlist/$", ArticleIndexListView.as_view(), name="articleindex_list"),
    url(r"^indexnew/$", ArticleIndexPostView.as_view(), name="articleindex_new"),
    url(r"^indexedit/(?P<pk>\d+)/$", ArticleIndexPostView.as_view(), name="articleindex_edit"),
    url(r"^indexdelete/(?P<pk>\d+)/$", delete_articleindex, name="articleindex_delete"),
)
Ejemplo n.º 15
0
    ArticlesView,
    ArticlesCountView,
    ArticleView,
    RelArts,
    MArticlesView,
    MArticleView,
    CatArticlesView,
    SubCatArticlesView,
    LastArticlesView,
    MostComArticleView,
    TagArtsView,
    UserArtsView)

urlpatterns = [
    # --- version 2 URLs ---
    path("api/v2/", ArticlesQueryView.as_view()),
    path("most/api/v2/commented/", MostComArticleViewI.as_view()),
    # --- version 1 URLs ---
    path("api/v1/", ArticlesView.as_view()),
    path("api/v1/count/", ArticlesCountView.as_view()),
    path("api/v1/lasts/", LastArticlesView.as_view()),
    path("api/v1/<slug:slug>/", ArticleView.as_view()),
    path("related/api/v1/<int:pk>/", RelArts.as_view()),
    path("mapi/v1/", MArticlesView.as_view()),
    path("mapi/v1/<int:pk>/", MArticleView.as_view()),
    path("most/api/v1/comment/", MostComArticleView.as_view()),
    path("cat/api/v1/<int:pk>/", CatArticlesView.as_view()),
    path("cat/sub/api/v1/<int:pk>/", SubCatArticlesView.as_view()),
    path("tag/api/v1/<str:tag>/", TagArtsView.as_view()),
    path("user/api/v1/<slug:uname>/", UserArtsView.as_view())
]
Ejemplo n.º 16
0
# encoding=utf-8

__author__ = 'xiaowang'
__date__ = '27/11/15'

from django.conf.urls import url
from article.views import ArticleView

urlpatterns = [
    url(r'^article/(\d*)$', ArticleView.as_view()),
]
Ejemplo n.º 17
0
# -*- coding: utf-8 -*-

from django.conf.urls.defaults import *

from article.views import ArticleList, ArticleView

urlpatterns = patterns(
    'article.views',
    url(r'^$', ArticleList.as_view(), name='article_list_url'),
    url(r'^(?P<slug>[-_\w]+)/$', ArticleView.as_view(), name='article_url'),
)
Ejemplo n.º 18
0
from django.conf.urls import url
from article.views import ArticleView, CommentView, SearchView

urlpatterns = [
    url(r'(?P<article_id>[0-9]+)$', ArticleView.as_view(), name='article'),
    url(r'^comment/$', CommentView.as_view(), name='comment'),
    url(r'^search/$', SearchView.as_view(), name='search'),
]




Ejemplo n.º 19
0
from django.urls import path
from article.views import ArticleView,ArticlesListView

from rest_framework.urlpatterns import format_suffix_patterns

app_label = 'article'

urlpatterns = [
    path('articles/<int:pk>/', ArticleView.as_view(), name='article-detail'),
    path('articles/',ArticlesListView.as_view(), name='article-list')
]

urlpatterns = format_suffix_patterns(urlpatterns)
Ejemplo n.º 20
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'),
]
Ejemplo n.º 21
0
from django.urls import path

from article.views import ArticlesView, ArticleView

urlpatterns = [
    path('articles', ArticlesView.as_view(), name='articles'),
    path('articles/<str:id>', ArticleView.as_view(), name='article'),
]