-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
71 lines (62 loc) · 3.29 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.views.generic.date_based import archive_index
from dayzlog.apps.blog import views
from django.contrib import admin
admin.autodiscover()
from pinax.apps.account.openid_consumer import PinaxConsumer
handler500 = "pinax.views.server_error"
from dayzlog.apps.blog.feeds import BlogFeedUser
blogs_feed_dict = {"feed_dict": {
'only': BlogFeedUser,
}}
from dayzlog.apps.blog.models import Post, IS_PUBLIC
post_dict_public = {
'queryset': Post.objects.filter(status=IS_PUBLIC),
'template_object_name': 'post',
}
post_dict = {
'queryset': Post.objects.filter(),
'template_object_name': 'post',
}
# =todo: vanity url: http://stackoverflow.com/questions/3333765/get-user-from-url-segment-with-django
urlpatterns = patterns("",
url(r"^$", "dayzlog.apps.blog.views.homepage", name="home"),
url(r"^new/$", "dayzlog.apps.blog.views.new", name="new"),
url(r"^admin/invite_user/$", "pinax.apps.signup_codes.views.admin_invite_user", name="admin_invite_user"),
url(r"^admin/", include(admin.site.urls)),
# url(r"^about/", include("about.urls")),
url(r"^faq/$", direct_to_template, {"template": "faq.html"}, name="faq"),
# url(r"^beans/$", direct_to_template, {"template": "beans.html"}, name="beans"),
url(r"^account/", include("pinax.apps.account.urls")),
url(r"^openid/", include(PinaxConsumer().urls)),
url(r"^profiles/", include("profiles.urls")), # NOTA BENE: that this is pointing to profiles/urls.py and not IDIOS app...
# url(r"^up/", include("profiles.urls")),
url(r"^notices/", include("notification.urls")),
url(r"^announcements/", include("announcements.urls")),
# url(r'^log/', include('blog.urls')),
url(r'^logs/', include('dayzlog.apps.blog.urls')),
url(r'^relationships/', include('relationships.urls')),
url(r'^following/','dayzlog.apps.blog.views.following', name='following'),
url(r'^followers/','dayzlog.apps.blog.views.followers', name='followers'),
url(r'^backup/$', 'dayzlog.apps.blog.views.backup', name='backup'),
url(r'^dashboard/$', 'dayzlog.apps.blog.views.dashboard', dict(post_dict, template_name='blog/dashboard.html'), name='dashboard'),
url(r'^write/$', 'dayzlog.apps.blog.views.add', name='blog_add'),
# url(r'^b/', include('blogs.short_urls')), # For short urls, if you want
url(r'^feeds/posts/(?P<url>w+)/', 'django.contrib.syndication.views.feed', blogs_feed_dict),
url(r'^search/$', 'dayzlog.apps.blog.views.search', name="search"),
# webmaster tools site verification
# http://news.e-scribe.com/431
url(r'^googleab865041b72036e4\.html$', lambda r: HttpResponse("google-site-verification: googleab865041b72036e4.html", mimetype="text/html"))
)
# if settings.SERVE_MEDIA:
# urlpatterns += patterns("",
# url(r"", include("staticfiles.urls")),
# )
# =todo: figure out why I had to add this so player image is served
if settings.DEBUG :
urlpatterns += patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
url(r'^uploads/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
)