コード例 #1
0
ファイル: urls.py プロジェクト: nigma/pybbm
    ModeratePost,
)


urlpatterns = patterns(
    "",
    # Syndication feeds
    url("^feeds/posts/$", LastPosts(), name="feed_posts"),
    url("^feeds/topics/$", LastTopics(), name="feed_topics"),
)

urlpatterns += patterns(
    "pybb.views",
    # Index, Category, Forum
    url("^$", IndexView.as_view(), name="index"),
    url("^category/(?P<pk>\d+)/$", CategoryView.as_view(), name="category"),
    url("^forum/(?P<pk>\d+)/$", ForumView.as_view(), name="forum"),
    # User
    url("^users/(?P<username>[^/]+)/$", UserView.as_view(), name="user"),
    url("^block_user/([^/]+)/$", "block_user", name="block_user"),
    # Profile
    url("^profile/edit/$", ProfileEditView.as_view(), name="edit_profile"),
    # Topic
    url("^topic/(?P<pk>\d+)/$", TopicView.as_view(), name="topic"),
    url("^topic/(?P<pk>\d+)/stick/$", StickTopicView.as_view(), name="stick_topic"),
    url("^topic/(?P<pk>\d+)/unstick/$", UnstickTopicView.as_view(), name="unstick_topic"),
    url("^topic/(?P<pk>\d+)/close/$", CloseTopicView.as_view(), name="close_topic"),
    url("^topic/(?P<pk>\d+)/open/$", OpenTopicView.as_view(), name="open_topic"),
    # Add topic/post
    url("^forum/(?P<forum_id>\d+)/topic/add/$", AddPostView.as_view(), name="add_topic"),
    url("^topic/(?P<topic_id>\d+)/post/add/$", AddPostView.as_view(), name="add_post"),
コード例 #2
0
feeds = {'posts': LastPosts, 'topics': LastTopics}

urlpatterns = patterns(
    '',
    # Syndication feeds
    url('^feeds/(?P<url>.*)/$',
        'django.contrib.syndication.views.feed', {'feed_dict': feeds},
        name='feed'),
)

urlpatterns += patterns(
    'pybb.views',
    # Index, Category, Forum
    url('^$', IndexView.as_view(), name='index'),
    url('^category/(?P<pk>\d+)/$', CategoryView.as_view(), name='category'),
    url('^forum/(?P<pk>\d+)/$', ForumView.as_view(), name='forum'),

    # User
    url('^users/(?P<username>[^/]+)/$', UserView.as_view(), name='user'),
    url('^block_user/([^/]+)/$', 'block_user', name='block_user'),

    # Profile
    url('^profile/edit/$', ProfileEditView.as_view(), name='edit_profile'),

    # Topic
    url('^topic/(?P<pk>\d+)/$', TopicView.as_view(), name='topic'),
    url('^topic/(?P<pk>\d+)/stick/$',
        StickTopicView.as_view(),
        name='stick_topic'),
    url('^topic/(?P<pk>\d+)/unstick/$',
コード例 #3
0
ファイル: urls.py プロジェクト: heraldmatias/plataformaogcs
from pybb.feeds import LastPosts, LastTopics
from views import IndexView, CategoryView, ForumView, TopicView, AddPostView, EditPostView,\
    UserView, PostView, DeletePostView, StickTopicView, UnstickTopicView,\
    CloseTopicView, OpenTopicView, ModeratePost


urlpatterns = patterns('',
                       # Syndication feeds
                       url('^feeds/posts/$', LastPosts(), name='feed_posts'),
                       url('^feeds/topics/$', LastTopics(), name='feed_topics'),
                       )

urlpatterns += patterns('pybb.views',
                        # Index, Category, Forum
                        url('^$', IndexView.as_view(), name='index'),
                        url('^category/(?P<pk>\d+)/$', CategoryView.as_view(), name='category'),
                        url('^forum/(?P<pk>\d+)/$', ForumView.as_view(), name='forum'),

                        # User
                        url('^users/(?P<username>[^/]+)/$', UserView.as_view(), name='user'),
                        url('^block_user/([^/]+)/$', 'block_user', name='block_user'),

                        # Profile
                        # url('^profile/edit/$', ProfileEditView.as_view(), name='edit_profile'),

                        # Topic
                        url('^topic/(?P<pk>\d+)/$', TopicView.as_view(), name='topic'),
                        url('^topic/(?P<pk>\d+)/stick/$', StickTopicView.as_view(), name='stick_topic'),
                        url('^topic/(?P<pk>\d+)/unstick/$', UnstickTopicView.as_view(), name='unstick_topic'),
                        url('^topic/(?P<pk>\d+)/close/$', CloseTopicView.as_view(), name='close_topic'),
                        url('^topic/(?P<pk>\d+)/open/$', OpenTopicView.as_view(), name='open_topic'),
コード例 #4
0
ファイル: urls.py プロジェクト: j0die/fakecoin
from django.conf.urls import patterns, url
from views import CategoryView, ItemView, IndexView, CheckoutView


urlpatterns = patterns('',
                       url(r'^about/', 'store.views.about', name='about'),
                       url(r'^contact/', 'store.views.contact', name='contact'),
                       url(r'^thanks/', 'store.views.thanks', name='thanks'),
                       url(r'^purchase/success/', 'store.views.purchase_success', name='store_purchase_success'),
                       url(r'^collection/(?P<slug>[-a-zA-Z0-9_]{1,50})/$', CategoryView.as_view(),
                           name='store_category'),
                       url(r'^item/(?P<pk>\d+)/$', ItemView.as_view(), name='store_item'),
                       url(r'^item/(?P<pk>\d+)/purchase$', CheckoutView.as_view(), name='store_item_purchase'),
                       url(r'^$', IndexView.as_view(), name='index'),
)

コード例 #5
0
from django.contrib.auth.decorators import  login_required
from django.conf.urls.defaults      import  patterns, url

from views                          import  ( SignUpView, CategoryView, InviteView )
                                             
urlpatterns = patterns('organizer.views',
    url(r'^$',              'dashboard',                                name='or_dash'      ),
    url(r'^signup/$',       SignUpView.as_view(),                       name='or_signup'    ),
    url(r'^category/$',     login_required( CategoryView.as_view()),    name='or_category'  ),
    url(r'^invite/$',       login_required( InviteView.as_view()),      name='or_invite'    ),
    url(r'^setup/$',        'setup',                                    name='or_setup'     ),
    url(r'^dash/$',         'dashboard',                                name='or_dash'      ),
    url(r'^leadb/$',        'leadb',                                    name='or_leadb'     ),
    url(r'^status/$',       'status',                                   name='or_status'    ),
    url(r'^events/$',       'events',                                   name='or_events'    ),
    url(r'^landing/$',      'landing',                                  name='or_landing'   ),
)

コード例 #6
0
ファイル: urls.py プロジェクト: sstepashka/ficbook
from django.conf.urls import patterns, url
from django.views.generic.simple import direct_to_template
from views import FunficsView, CategoryView, GenreView


urlpatterns = patterns('',
    url(r'^login/$', direct_to_template, {'template': 'login.html'}, "login"),
    url(r'^funfics/$', FunficsView.as_view(), name='funfics'),
    url(r'^categories/(?P<pk>\d+)/', CategoryView.as_view(), name='category'),
    url(r'^genre/(?P<pk>\d+)/', GenreView.as_view(), name='genre'),
    url(r'^$', direct_to_template, {'template': 'home.html'}, "home"),
)
コード例 #7
0
urlpatterns = [
    url(r'^$', BlogList.as_view(), name="blog_list"),
    url(r'^(?P<pk>\d+)/$', BlogView.as_view(), name="blog"),
    url(r'^new/$', login_required(CreateBlog.as_view()), name="create_blog"),
    url(r'^(?P<pk>\d+)/edit/$',
        login_required(UpdateBlog.as_view()),
        name="edit_blog"),
    url(r'^(?P<pk>\d+)/new/$',
        login_required(CreatePostInBlog.as_view()),
        name="create_post_in_blog"),
    url(r'^post/(?P<pk>\d+)/$', PostView.as_view(), name="post"),
    url(r'^post/(?P<pk>\d+)/comments/$',
        PostCommentsView.as_view(),
        name="post_comments"),
    url(r'^post/new/$',
        login_required(CreatePost.as_view()),
        name="create_post"),
    url(r'^post/(?P<pk>\d+)/edit/$',
        login_required(UpdatePost.as_view()),
        name="edit_post"),
    url(r'^post/(?P<pk>\d+)/likes/$',
        csrf_exempt(PostLikeCountView.as_view()),
        name="post_likes"),
    url(r'^post/(?P<pk>\d+)/likes/add/$', likes_add, name="post_new_like"),
    url(r'^category/(?P<pk>\d+)/$', CategoryView.as_view(), name="category"),
    url(r'^category/new/$',
        login_required(CreateCategory.as_view()),
        name="create_category"),
]
コード例 #8
0
class RegexConverter(BaseConverter):
    '''Sets up regex to be used in the add_url_rule '''
    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]


app.url_map.converters['regex'] = RegexConverter

app.add_url_rule("/", view_func=HomeView.as_view('home_view'))
app.add_url_rule("/json", view_func=HomeView.as_view('home_json'))
app.add_url_rule("/xml", view_func=HomeView.as_view('home_xml'))
# /category
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()),
                 view_func=CategoryView.as_view('category_view'))
app.add_url_rule('/<regex("{}"):category>/json'.format(utils.get_cat_regex()),
                 view_func=CategoryView.as_view('category_json'))
app.add_url_rule('/<regex("{}"):category>/xml'.format(utils.get_cat_regex()),
                 view_func=CategoryView.as_view('category_xml'))
# /category/item_id
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>',
                 view_func=ItemView.as_view('item_view'))
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>/json',
                 view_func=ItemView.as_view('item_json'))
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>/xml',
                 view_func=ItemView.as_view('item_xml'))
# /category/item_id/delete
コード例 #9
0
    '''Sets up regex to be used in the add_url_rule '''

    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]

app.url_map.converters['regex'] = RegexConverter


app.add_url_rule("/", view_func=HomeView.as_view('home_view'))
app.add_url_rule("/json", view_func=HomeView.as_view('home_json'))
app.add_url_rule("/xml", view_func=HomeView.as_view('home_xml'))
# /category
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()),
                 view_func=CategoryView.as_view('category_view'))
app.add_url_rule(
    '/<regex("{}"):category>/json'.format(
        utils.get_cat_regex()),
    view_func=CategoryView.as_view('category_json'))
app.add_url_rule(
    '/<regex("{}"):category>/xml'.format(
        utils.get_cat_regex()),
    view_func=CategoryView.as_view('category_xml'))
# /category/item_id
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>', view_func=ItemView.as_view('item_view'))
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>/json', view_func=ItemView.as_view('item_json'))
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
                 '/<int:item_id>/xml', view_func=ItemView.as_view('item_xml'))
コード例 #10
0
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 . import views
from views import CategoryView, RelatedView, DifferentView, CompletedtView, RecommendView
# from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^category/(?P<category>\w+)/$',
        CategoryView.as_view(),
        name='category'),
    url(r'^more/(?P<article_id>\w+)/$', RelatedView.as_view(), name='related'),
    url(r'^skip/(?P<article_id>\w+)/$',
        DifferentView.as_view(),
        name='different'),
    url(r'^completed/(?P<article_id>\w+)/$',
        CompletedtView.as_view(),
        name='completed'),
    url(r'^recommendations/$', RecommendView.as_view(), name='recommend'),
]
コード例 #11
0
ファイル: urls.py プロジェクト: technomicssolutions/d-camelot
from django.conf.urls import patterns,include,url
# from django.views.decorators.csrf import csrf_exempt
# from django.contrib.auth.decorators import login_required

from views import (HomeView, LoginView, SignUpView, LogOutView,
                  CategoryView)


urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name="home"),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^signup/$', SignUpView.as_view(), name='signup'),
    url(r'^logout/$', LogOutView.as_view(), name='logout'),

    url(r'^get_category/$', CategoryView.as_view()),
)