| 1 |
from django.conf.urls.defaults import * |
|---|
| 2 |
from django.contrib.comments.feeds import LatestFreeCommentsFeed |
|---|
| 3 |
from django.contrib.comments.models import FreeComment |
|---|
| 4 |
from django.contrib.sitemaps import views as sitemap_views |
|---|
| 5 |
from django_website.apps.aggregator.feeds import CommunityAggregatorFeed |
|---|
| 6 |
from django_website.apps.aggregator.models import FeedItem |
|---|
| 7 |
from django_website.apps.blog.feeds import WeblogEntryFeed |
|---|
| 8 |
from django_website.sitemaps import FlatPageSitemap, WeblogSitemap |
|---|
| 9 |
from django.views.decorators.cache import cache_page |
|---|
| 10 |
|
|---|
| 11 |
comments_info_dict = { |
|---|
| 12 |
'queryset': FreeComment.objects.filter(is_public=True), |
|---|
| 13 |
'paginate_by': 15, |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
aggregator_info_dict = { |
|---|
| 17 |
'queryset': FeedItem.objects.select_related(), |
|---|
| 18 |
'paginate_by': 15, |
|---|
| 19 |
} |
|---|
| 20 |
|
|---|
| 21 |
feeds = { |
|---|
| 22 |
'weblog': WeblogEntryFeed, |
|---|
| 23 |
'comments': LatestFreeCommentsFeed, |
|---|
| 24 |
'community': CommunityAggregatorFeed, |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
sitemaps = { |
|---|
| 28 |
'weblog': WeblogSitemap, |
|---|
| 29 |
'flatpages': FlatPageSitemap, |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
urlpatterns = patterns('', |
|---|
| 33 |
(r'freenode\.9xJY7YIUWtwn\.html', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}), |
|---|
| 34 |
(r'^accounts/', include('django_website.apps.accounts.urls')), |
|---|
| 35 |
(r'^admin/', include('django.contrib.admin.urls')), |
|---|
| 36 |
(r'^comments/$', 'django.views.generic.list_detail.object_list', comments_info_dict), |
|---|
| 37 |
(r'^comments/', include('django.contrib.comments.urls.comments')), |
|---|
| 38 |
(r'^community/$', 'django.views.generic.list_detail.object_list', aggregator_info_dict), |
|---|
| 39 |
(r'^contact/', include('django_website.apps.contact.urls')), |
|---|
| 40 |
(r'^documentation/', include('django_website.apps.docs.urls')), |
|---|
| 41 |
(r'^r/', include('django.conf.urls.shortcut')), |
|---|
| 42 |
(r'^rss/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), |
|---|
| 43 |
(r'^sitemap.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}), |
|---|
| 44 |
(r'^weblog/', include('django_website.apps.blog.urls')), |
|---|
| 45 |
(r'', include('django.contrib.flatpages.urls')), |
|---|
| 46 |
) |
|---|