예제 #1
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from blog.views import IndexView,CategoryView,TagsView,ShowPost
from blog.feeds import LatestPostsFeed

admin.autodiscover()

urlpatterns = patterns('',
	url(r'^feed/latest/?(?P<count>[0-9]+)?/$',LatestPostsFeed(),name="feed"),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$',IndexView.as_view(), name='home'),
    url(r'^tag/(?P<tagslug>[-\w]+)/$',TagsView.as_view(),name='showtag'),
    url(r'^(?P<slug>[-\w]+)/$',CategoryView.as_view(),name='showcategory'),
    url(r'^(?P<catslug>[-\w]+)/(?P<postslug>[-\w]+)/$',ShowPost.as_view(),name='showpost'),
    url(r'^tinymce/', include('tinymce.urls')),
)
예제 #2
0
from django.urls import path, re_path
from blog.views import MainView
from blog.views import TagsView
from blog.views import TypesView
from blog.views import MzView

app_name = 'blog'
urlpatterns = [
    re_path(r'^$', MainView.as_view(), name='home'),
    re_path('^tags/(?P<tag_id>\w+)/$', TagsView.as_view(), name='tags'),
    re_path('^types/(?P<type_id>\w+)/$', TypesView.as_view(), name='types'),
    re_path(r'^mz/$', MzView.as_view(), name='mz'),
]
예제 #3
0
     TemplateView.as_view(template_name="sys/login.html"),
     name='login-view'),
 url(r'^register/$',
     TemplateView.as_view(template_name="sys/register.html"),
     name='register-view'),
 url(r'^forgetpassword/$',
     TemplateView.as_view(template_name="sys/forgetpassword.html"),
     name='forgetpassword-view'),
 url(r'^resetpassword/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
     TemplateView.as_view(template_name="sys/resetpassword.html"),
     name='resetpassword-view'),
 url(r'^aboutme/$', AboutMeView.as_view(), name='aboutme-view'),
 url(r'^media/article/(?P<path>.*)', 'django.views.static.serve',
     {'document_root': settings.MEDIA_ROOT + '/article'}),
 url(r'^article/(?P<pk>\d+)/$', ArticleView.as_view(), name='article-view'),
 url(r'^tag/(?P<tag_name>.+)/$', TagsView.as_view(), name='tag-view'),
 url(r'^all/$', AllView.as_view(), name='all-view'),
 url(r'^comment/(?P<slug>\w+)/$',
     PostCommentView.as_view(),
     name='postcomment-view'),
 url(r'^search/$', SearchView.as_view(), name='search-view'),
 url(r'^category/(?P<pk>\w+)/$',
     CaregoryView.as_view(),
     name='category-view'),
 url(r'^datearticle/(?P<year>\d+)/(?P<month>\d+)/$',
     DateArticleView.as_view(),
     name='datearticle-view'),
 url(r'^msgbook/$', MsgBookView.as_view(), name='msgbook-view'),
 url(r'^photo/$', PhotoView.as_view(), name='photo-view'),
 url(r'^photolist/(?P<pk>\d+)/$',
     PhothListView.as_view(),
예제 #4
0
    url(r'^news/$',NewsView.as_view()),
    url(r'^post/(?P<pk>[0-9]+)$', PostView.as_view()),
    url(r'^news/(?P<pk>[0-9]+)$', News1View.as_view()),
    url(r'^comment/add/(?P<pk>[0-9]+)$', CommentView.as_view()),
    url(r'^comment/delete/(?P<pk>[0-9]+)$', CommentDeleteView.as_view()),
    url(r'^repository$', RepositoryView.as_view()),
    url(r'^repository/(?P<pk>[0-9]+)$', RepositoryDetailView.as_view()),
    url(r'^tag/(?P<slug>[\w\u4e00-\u9fa5]+)$', TagListView.as_view()),
    url(r'^catalogue/(?P<slug>[0-9]+)$', CatalogueListView.as_view()),
    url(r'^author/(?P<pk>[0-9]+)$', AuthorPostListView.as_view()),
    url(r'^test/$',emtest_view,name='sp'),
    url(r'^change_sc/$',change_view,name='ch'),
    url(r'^blog/report/(?P<pk>[0-9]+)$',report_view.as_view()),
    url(r'^author1/(?P<pk>[0-9]+)$', AuthorNewsListView.as_view()),#新闻归档
    url(r'^category/(?P<pk>[0-9]+)$', CategoryListView.as_view()),
    url(r'^add/collect/(?P<pk>[0-9]+)$',CollectView.as_view()),
# 123456
    url(r'^register/$',register_views),
    # url(r'captcha/$', verifycode),
    url(r'ceshi/$',register_views),
    url(r'tiaozhuan/$',ceshi),
    url(r'agreement/$',show_Agreement),
    url(r'aboutus/$',show_aboutUs),
    url(r'contact/$',contact_us),
    # url(r'^change_sc_done/$',change_view_done,name='chd'),
    #####
    url(r'^recommend/(?P<pk>[0-9]+)$', RecommendView.as_view()),
    url(r'^search/(?P<pk>.+)$', SearchView.as_view(), name='search'),# 新增
    url(r'^history/(?P<pk>[0-9]+)$',HistoryView.as_view()),#查看历史文章
	url(r'^tags/$', TagsView.as_view()),
]
예제 #5
0
파일: urls.py 프로젝트: fangmd/djangoblog
from django.conf.urls import url

from blog.views import IndexView, ArticleDetailView, CategoryView, custom, ArticleList, ArticleDetail, TagsView, about

urlpatterns = [

    # 首页调用IndexView
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^index.html/$', IndexView.as_view(), name='index'),  # .html 处理方式不对哦

    # 使用(?P<>\d+)的形式捕获值给<>中得参数,比如(?P<article_id>\d+),当访问/blog/article/3时,
    # 将会将3捕获给article_id,这个值会传到views.ArticleDetailView,这样我们就可以判断展示哪个Article了
    url(r'article/(?P<article_id>\d+)$', ArticleDetailView.as_view(), name='detail'),
    url(r'category/(?P<cate_id>\d+)$', CategoryView.as_view(), name='category'),
    url(r'^custom/$', custom),
    url(r'^tags/$', TagsView.as_view(), name='tags'),
    url(r'^about/$', about, name='about'),

    # api
    url(r'api/v1/articles$', ArticleList.as_view()),
    url(r'api/v1/articles/(?P<article_id>\d+)$', ArticleDetail.as_view()),

]
예제 #6
0
파일: urls.py 프로젝트: AliYmn/DjangoBlog
category_dict = {
    'queryset':Category.objects.all(),
}

tags_dict = {
    'queryset':Tags.objects.all(),
}

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeListView.as_view(),name="home-list"),
    url(r'^hakkimda/', AboutTemplateView.as_view(), name="about"),
    url(r'^iletisim/', ContactView.as_view(), name="about"),
    url(r'^blog/', BlogListView.as_view(), name="about"),
    url(r'^kategori/(?P<slug>[-\w]+)/', CategoryView.as_view(), name='list-detail'),
    url(r'^etiket/(?P<slug>[-\w]+)/$', TagsView.as_view(), name='tags'),

    url(r'^sitemap_post\.xml$', sitemap,{'sitemaps': {'blog': GenericSitemap(post_dict, priority=0.6)}},
                                                 name='django.contrib.sitemaps.views.sitemap'),

    url(r'^sitemap_category\.xml$', sitemap,{'sitemaps': {'blog': GenericSitemap(category_dict, priority=0.6)}},
                                                 name='django.contrib.sitemaps.views.sitemap'),

    url(r'^sitemap_tags\.xml$', sitemap, {'sitemaps': {'blog': GenericSitemap(tags_dict, priority=0.6)}},
        name='django.contrib.sitemaps.views.sitemap'),

    url(r'^robots.txt/', RobotsView.as_view(), name="robots"),
    url(r'^ckeditor/', include('ckeditor_uploader.urls')),

    url(r'^feed/$', LatestEntriesFeed()),
    url(r'^(?P<slug>[-\w]+)/$', PostDetailView.as_view(), name='post'),
예제 #7
0
}

tags_dict = {
    'queryset': Tags.objects.all(),
}

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeListView.as_view(), name="home-list"),
    url(r'^hakkimda/', AboutTemplateView.as_view(), name="about"),
    url(r'^iletisim/', ContactView.as_view(), name="about"),
    url(r'^blog/', BlogListView.as_view(), name="about"),
    url(r'^kategori/(?P<slug>[-\w]+)/',
        CategoryView.as_view(),
        name='list-detail'),
    url(r'^etiket/(?P<slug>[-\w]+)/$', TagsView.as_view(), name='tags'),
    url(r'^sitemap_post\.xml$',
        sitemap,
        {'sitemaps': {
            'blog': GenericSitemap(post_dict, priority=0.6)
        }},
        name='django.contrib.sitemaps.views.sitemap'),
    url(r'^sitemap_category\.xml$',
        sitemap,
        {'sitemaps': {
            'blog': GenericSitemap(category_dict, priority=0.6)
        }},
        name='django.contrib.sitemaps.views.sitemap'),
    url(r'^sitemap_tags\.xml$',
        sitemap,
        {'sitemaps': {
예제 #8
0
from .views import ping

router = routers.SimpleRouter()
router.register(r"blog", BlogPostViewSet)

schema_view = get_schema_view(
    openapi.Info(title="Simple blog API", default_version="v1"),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("admin/", admin.site.urls),
    path("ping/", ping, name="ping"),
    path(
        "api/docs/",
        schema_view.with_ui("swagger", cache_timeout=0),
        name="schema-swagger-ui",
    ),
    path("api/register/", RegisterView.as_view(), name="register"),
    path("api/login/", LoginView.as_view(), name="login"),
    path("api/logout/", LogoutView.as_view(), name="logout"),
    path("api/user/", UserView.as_view(), name="current-user"),
    path("api/tags/", TagsView.as_view(), name="tags"),
    path("api/", include(router.urls)),
    path("api/blog/<slug:slug>/comments/",
         CommentsView.as_view(),
         name="comments"),
    path("api/image/", ImageView.as_view(), name="image"),
]