示例#1
0
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import ListView, DetailView
from tumblelog.models import Post
from tumblelog.views import PostDetailView

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

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'tumblelog.views.home', name='home'),
    # url(r'^tumblelog/', include('tumblelog.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', ListView.as_view(
	queryset=Post.objects.all(), 
	context_object_name="posts_list"), 
	name="home"
    ),
    url(r'^post/(?P<slug>[a-zA-Z0-9-]+)/$', PostDetailView.as_view(
	queryset=Post.objects.all(), 
	context_object_name="post"), 
	name="post"
    ),
)
示例#2
0
from django.conf.urls import patterns, include, url

from tumblelog.views import (PostIndexView, AddPostView, PostDetailView,
                             UpdatePostView, DeletePostView, ImageFileView)

from django_mongoengine import mongo_admin

post_patterns = patterns(
    '', url(r'^$', PostDetailView.as_view(), name="post"),
    url(r'^edit/$', UpdatePostView.as_view(), name="post_update"),
    url(r'^delete/$', DeletePostView.as_view(), name="post_delete"))

urlpatterns = patterns(
    '', url(r'^$', PostIndexView.as_view(), name="post_index"),
    url(r'^new/$', AddPostView.as_view(), name="post_new"),
    url(r'^new/(?P<post_type>(post|video|image|quote|music))/$',
        AddPostView.as_view(),
        name="post_new"), url(r'^admin/', include(mongo_admin.site.urls)),
    url(r'^image-file/(?P<slug>[a-zA-Z0-9-]+)/',
        ImageFileView.as_view(),
        name="image_file"),
    url(r'^(?P<slug>[a-zA-Z0-9-]+)/', include(post_patterns)))
示例#3
0
from django.conf.urls import include, url

from tumblelog.views import (
    PostIndexView, AddPostView, PostDetailView,
    UpdatePostView, DeletePostView, ImageFileView,
    TestSessionView,
)

from django_mongoengine import mongo_admin

post_patterns = [
    url(r'^$', PostDetailView.as_view(), name="post"),
    url(r'^edit/$', UpdatePostView.as_view(), name="post_update"),
    url(r'^delete/$', DeletePostView.as_view(), name="post_delete")
]


urlpatterns = [
    url(r'^test-session/', TestSessionView.as_view()),

    url(r'^$', PostIndexView.as_view(), name="post_index"),
    url(r'^new/$', AddPostView.as_view(), name="post_new"),
    url(r'^new/(?P<post_type>(post|video|image|quote|music))/$',
        AddPostView.as_view(), name="post_new"),
    url(r'^admin/', mongo_admin.site.urls),
    url(r'^image-file/(?P<slug>[a-zA-Z0-9-]+)/', ImageFileView.as_view(),
        name="image_file"),
    url(r'^(?P<slug>[a-zA-Z0-9-]+)/', include(post_patterns)),
]
示例#4
0
from django.conf.urls.defaults import *

from tumblelog.feeds import PostFeed
from tumblelog.views import PostDetailView, PostListView

urlpatterns = patterns('tumblelog.views',
    url(r'^$', PostListView.as_view(), name="list"),
    url(r'^feed/$', PostFeed(), name="feed"),
    url(r'^(?P<slug>.+)/$', PostDetailView.as_view(), name="detail"),
)
from django.conf.urls.defaults import *

from tumblelog.feeds import PostFeed
from tumblelog.views import PostDetailView, PostListView, bookmarklet, bookmarklet_window

from tumblelog.models import PARENT_MODEL

urlpatterns = patterns('tumblelog.views',
    url(r'^bookmarklet.js/$', bookmarklet, name="bookmarklet.js"),
    url(r'^bookmarklet.html/$', bookmarklet_window, name="bookmarklet.html"),
    url(r'^(?P<parent__slug>.+)/(?P<pk>.+)/$' if PARENT_MODEL else r'^(?P<pk>.+)/$', PostDetailView.as_view(), name="detail"),
    url(r'^(?P<parent__slug>.+)/$' if PARENT_MODEL else r'^$', PostListView.as_view(), name="list"),
    url(r'^feed/$', PostFeed(), name="feed"),
)
示例#6
0
from django.conf.urls import patterns, include, url

from tumblelog.views import PostIndexView, AddPostView, PostDetailView, UpdatePostView, DeletePostView, ImageFileView

from django_mongoengine import mongo_admin

post_patterns = patterns(
    "",
    url(r"^$", PostDetailView.as_view(), name="post"),
    url(r"^edit/$", UpdatePostView.as_view(), name="post_update"),
    url(r"^delete/$", DeletePostView.as_view(), name="post_delete"),
)


urlpatterns = patterns(
    "",
    url(r"^$", PostIndexView.as_view(), name="post_index"),
    url(r"^new/$", AddPostView.as_view(), name="post_new"),
    url(r"^new/(?P<post_type>(post|video|image|quote|music))/$", AddPostView.as_view(), name="post_new"),
    url(r"^admin/", include(mongo_admin.site.urls)),
    url(r"^image-file/(?P<slug>[a-zA-Z0-9-]+)/", ImageFileView.as_view(), name="image_file"),
    url(r"^(?P<slug>[a-zA-Z0-9-]+)/", include(post_patterns)),
)
示例#7
0
from django.conf.urls.defaults import *

from tumblelog.feeds import PostFeed
from tumblelog.views import PostDetailView, PostListView

urlpatterns = patterns(
    'tumblelog.views',
    url(r'^$', PostListView.as_view(), name="list"),
    url(r'^feed/$', PostFeed(), name="feed"),
    url(r'^(?P<slug>.+)/$', PostDetailView.as_view(), name="detail"),
)
示例#8
0
from django.conf.urls import include, url

from tumblelog.views import (
    PostIndexView,
    AddPostView,
    PostDetailView,
    UpdatePostView,
    DeletePostView,
    ImageFileView,
    TestSessionView,
)

from django_mongoengine import mongo_admin

post_patterns = [
    url(r"^$", PostDetailView.as_view(), name="post"),
    url(r"^edit/$", UpdatePostView.as_view(), name="post_update"),
    url(r"^delete/$", DeletePostView.as_view(), name="post_delete"),
]

urlpatterns = [
    url(r"^test-session/", TestSessionView.as_view()),
    url(r"^$", PostIndexView.as_view(), name="post_index"),
    url(r"^new/$", AddPostView.as_view(), name="post_new"),
    url(
        r"^new/(?P<post_type>(post|video|image|quote|music))/$",
        AddPostView.as_view(),
        name="post_new",
    ),
    url(r"^admin/", mongo_admin.site.urls),
    url(