urlpatterns = patterns( '', (r'^hulkify/', include(admin.site.urls)), (r'^hulkify/', include('admin_tools.urls')), (r'^ckeditor/', include('ckeditor.urls')), url(r'', include('accounts.urls')), # EstLan urls url(r'^$', FrontPageView.as_view(), name="frontpage"), url(r'^category/(?P<category_slug>[-\w]+)/?$', FrontPageView.as_view(), name="category"), url(r'^(?P<article_id>\d+)$', ArticleView.as_view(), name="article"), url(r'^article/(?P<article_slug>[-\w]+)/?$', ArticleView.as_view(), name="article_slug"), url(r'^page/(?P<page_id>\d+)$', CustomPageView.as_view(), name="page"), url(r'^p/(?P<page_slug>[-\w]+)/?$', CustomPageView.as_view(), name="page_slug"), # End: EstLan urls url('', include('social.apps.django_app.urls', namespace='social')), (r'^i18n/', include('django.conf.urls.i18n')), ) if settings.DEBUG: urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), )
from flask import Flask from views import ArticleView app = Flask(__name__) app.add_url_rule('/articles', view_func=ArticleView.as_view('article-view'), methods=['GET', 'POST']) if __name__ == '__main__': app.run()
from django.conf.urls import patterns, url from views import index, ArticleView, ArticlePublish, not_found, Contact, about, Test, RegisterView, cus_login, cus_logout, page_not_found, search urlpatterns = patterns('', url(r'^$', index, name='index'), url(r'^article/$', ArticleView.as_view(), name='article_detail'), url(r'^articlepublish/$', ArticlePublish.as_view(), name='article_publish'), url(r'^404/$', not_found), url(r'^contact/$', Contact.as_view(), name='contact'), url(r'^about/$', about, name='about'), url(r'^test/$', Test.as_view()), url(r'^register/$', RegisterView.as_view(), name='register'), url(r'^login/$', cus_login, name='login'), url(r'^logout/$', cus_logout, name='logout'), url(r'^search/$', search, name='search'), url(r'^.*/$', page_not_found, name='not_found'), )
admin.autodiscover() urlpatterns = patterns( '', (r'^hulkify/', include(admin.site.urls)), (r'^hulkify/', include('admin_tools.urls')), (r'^ckeditor/', include('ckeditor.urls')), url(r'', include('accounts.urls')), # EstLan urls url(r'^$', FrontPageView.as_view(), name="frontpage"), url(r'^category/(?P<category_slug>[-\w]+)/?$', FrontPageView.as_view(), name="category"), url(r'^(?P<article_id>\d+)$', ArticleView.as_view(), name="article"), url(r'^article/(?P<article_slug>[-\w]+)/?$', ArticleView.as_view(), name="article_slug"), url(r'^page/(?P<page_id>\d+)$', CustomPageView.as_view(), name="page"), url(r'^p/(?P<page_slug>[-\w]+)/?$', CustomPageView.as_view(), name="page_slug"), # End: EstLan urls url('', include('social.apps.django_app.urls', namespace='social')), (r'^i18n/', include('django.conf.urls.i18n')), ) if settings.DEBUG: urlpatterns += patterns( '',
from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from views import ArticleView, AuthorCreate # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^i18n/setlang/$', 'translation.i18n.set_language', name='set_language'), ] urlpatterns += i18n_patterns( '', url(r'^$', 'translation.views.home', name='home'), url(r'^article/(?P<pk>\d+)/$', ArticleView.as_view(), name='article'), url(r'^article/create/$', AuthorCreate.as_view(), name='create-article'), url(r'^admin/', include(admin.site.urls)), )
# encoding: utf-8 from django.conf.urls import url from views import ArticleView urlpatterns = [ url(r'(?P<uid>[0-9]+)/$', ArticleView.as_view(), name='article'), ]