Ejemplo n.º 1
0
def create_admin(app=None):
    admin = Admin(app,
                  name="CleanBlogAdmin",
                  index_view=MyIndexView(),
                  base_template='admin/my_master.html')
    admin.add_view(UserView(User))
    admin.add_view(PostView(Post))
Ejemplo n.º 2
0
        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'),

    # Post
    url('^post/(?P<pk>\d+)/$', PostView.as_view(), name='post'),
    url('^post/(?P<pk>\d+)/edit/$', EditPostView.as_view(), name='edit_post'),
    url('^post/(?P<pk>\d+)/delete/$',
        DeletePostView.as_view(),
        name='delete_post'),
    url('^post/(?P<pk>\d+)/moderate/$',
        ModeratePost.as_view(),
        name='moderate_post'),

    # Attachment
    #url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),

    # Subscription
    url('^subscription/topic/(\d+)/delete/$',
        'delete_subscription',
        name='delete_subscription'),
Ejemplo n.º 3
0
Archivo: urls.py Proyecto: nigma/pybbm
    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"),
    # Post
    url("^post/(?P<pk>\d+)/$", PostView.as_view(), name="post"),
    url("^post/(?P<pk>\d+)/edit/$", EditPostView.as_view(), name="edit_post"),
    url("^post/(?P<pk>\d+)/delete/$", DeletePostView.as_view(), name="delete_post"),
    url("^post/(?P<pk>\d+)/moderate/$", ModeratePost.as_view(), name="moderate_post"),
    # Attachment
    # url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),
    # Subscription
    url("^subscription/topic/(\d+)/delete/$", "delete_subscription", name="delete_subscription"),
    url("^subscription/topic/(\d+)/add/$", "add_subscription", name="add_subscription"),
    # API
    url("^api/post_ajax_preview/$", "post_ajax_preview", name="post_ajax_preview"),
    # Commands
    url("^mark_all_as_read/$", "mark_all_as_read", name="mark_all_as_read"),
)
Ejemplo n.º 4
0
                        # 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'),

                        # Post
                        url('^post/(?P<pk>\d+)/$', PostView.as_view(), name='post'),
                        url('^post/(?P<pk>\d+)/edit/$', EditPostView.as_view(), name='edit_post'),
                        url('^post/(?P<pk>\d+)/delete/$', DeletePostView.as_view(), name='delete_post'),
                        url('^post/(?P<pk>\d+)/moderate/$', ModeratePost.as_view(), name='moderate_post'),

                        # Attachment
                        #url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),

                        # Subscription
                        url('^subscription/topic/(\d+)/delete/$',
                            'delete_subscription', name='delete_subscription'),
                        url('^subscription/topic/(\d+)/add/$',
                            'add_subscription', name='add_subscription'),

                        # API
                        url('^api/post_ajax_preview/$', 'post_ajax_preview', name='post_ajax_preview'),
Ejemplo n.º 5
0
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from views import BlogList, BlogView, PostView, CreateBlog, UpdateBlog, CreatePost, CreateCategory, UpdatePost, \
    CategoryView, CreatePostInBlog, PostCommentsView, PostLikeCountView, likes_add

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/$',
Ejemplo n.º 6
0
from django.conf.urls import patterns, include, url
from views import BlogView, PostView, ArchiveView
from atlantic777.views import menu
from blog import views

urlpatterns = patterns('', 
		url(r'^$', BlogView.as_view()),
		url(r'(?P<pk>\d+)', PostView.as_view()),
		url(r'archive', ArchiveView.as_view()),
		url(r'new', views.new_post),
		)
Ejemplo n.º 7
0
Archivo: urls.py Proyecto: gpichot/lulz
    PostView

from dajaxice.core import dajaxice_autodiscover, dajaxice_config
dajaxice_autodiscover()

urlpatterns = patterns('',

    url(r'^$', Home.as_view(), name="home"),

    url(r'^hot$', HotView.as_view(), name="hot"),

    url(r'^trending$', TrendingView.as_view(), name="trending"),

    url(r'^channel/(?P<tag>[\w-]+)$', TagView.as_view(), name="tag"),

    url(r'^post/(?P<pk>\d+)$', PostView.as_view(), name="post-detail"),

    url(r'^user/sign-up$', SignUpView.as_view(), name="user-sign-up"),
     
    url(r'^user/sign-in$', SignInView.as_view(), name="user-sign-in"),
     
    url(r'^user/logout$', LogOutView.as_view(), name="user-log-out"),

    url(r'^user/followed-chans', FollowedChansView.as_view(), name="user-followed-chans"),

    url(r'^group/create$', CreateGroupView.as_view(), name="group-create"),

    url(r'^group/(?P<pk>\d+)/detail/(?P<slug>[\w-]+)$', GroupView.as_view(), name="group-detail"),

    url(
        r'^group/(?P<pk>\d+)/members/(?P<slug>[\w-]+)$',
Ejemplo n.º 8
0
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin

admin.autodiscover()

from views import HomeView, PostView

urlpatterns = patterns(
    "",
    # Examples:
    # url(r'^$', 'encontroxxiv.views.home', name='home'),
    # url(r'^encontroxxiv/', include('encontroxxiv.foo.urls')),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^$", HomeView.as_view()),
    url(r"^(?P<pk>\d+)/$", PostView.as_view()),
)
Ejemplo n.º 9
0
from django.conf.urls.defaults import patterns, include, url
from views import BlogView, PostView


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'codeon.views.home', name='home'),
     url(r'^$', BlogView.as_view(), name='blog'),
     url(r'^(?P<pk>\d+)/$', PostView.as_view(), name='post_view'),
)