RajeshD wrote:
> > Any other ideas?
>
> Yes. You mention that you "use some available Django generic views".
> Can you show us your urls.py?

No problem, here is the complete urls.py:


# -*- coding: utf-8 -*-

from datetime import datetime

from django.conf.urls.defaults import *
from django.core import context_processors as dcc

from models import Post,Article,PUBLISHED,Comment,Tag
from context_processors import wiki_create_page_name,pyki_context
from pyki.feeds import Rss2
from django.conf import settings

view_post_dict = {
    'queryset':Post.objects.all(),
    'date_field':'pub_date',
    'month_format':'%m',
    'template_object_name':'post',
}

archive_dict = {

'queryset':Post.objects.filter(state=PUBLISHED).filter(pub_date__lte=datetime.now()),
    'date_field':'pub_date',
    'allow_empty':True,
    'template_object_name':'post',
}

month_archive_dict = {
    'month_format':'%m',
}

month_archive_dict.update(archive_dict)

#
# Date-based views
#
urlpatterns = patterns('django.views.generic.date_based',

(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$',
'object_detail', dict(view_post_dict, slug_field='slug')),

(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$','archive_day',
month_archive_dict),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/$','archive_month',
month_archive_dict),
    (r'^(?P<year>\d{4})/$','archive_year', archive_dict),
)

#
# Wiki actions
#
urlpatterns += patterns('django.views.generic.create_update',
    (r'^create/$','create_object',dict( model=Article,

post_save_redirect=settings.BASE_URL+'%(title)s/',
                                        login_required=True,
                                        context_processors=[dcc.auth,
                                                            dcc.debug,
                                                            dcc.i18n,

pyki_context,

wiki_create_page_name,])),

    (r'^edit/(?P<slug>[-\w/]+)/$','update_object',dict( model=Article,

slug_field='title',

post_save_redirect=settings.BASE_URL+'%(title)s/',

login_required=True)),

    (r'^delete/(?P<slug>[-\w/]+)/$','delete_object',dict(
model=Article,

template_object_name='article',

slug_field='title',

post_delete_redirect=settings.BASE_URL,

login_required=True)),
)

#
# Main page and login
#
urlpatterns += patterns('',

    (r'^$','django.views.generic.list_detail.object_list',
            dict(
queryset=Post.objects.filter(state=PUBLISHED).filter(pub_date__lte=datetime.now()),
                    paginate_by=10,
                    allow_empty=True)),

    (r'^accounts/login/$', 'django.contrib.auth.views.login',
dict(template_name='auth/login.html')),

)

#
# Feed handlers
#
urlpatterns += patterns('django.contrib.syndication.views',
    (r'^feeds/(?P<url>.*)/$','feed',dict(feed_dict=dict(rss2=Rss2))),
)

#
# Tag cloud, tag contents, add comment action and wiki pages
#
urlpatterns += patterns('pyki.bliki.views',

    (r'^tags/$','tag_cloud'),

    (r'^tags/(?P<tag>[-\w\.\# ]+)/$','tag_contents',
                                dict(
template_name='bliki/tag_contents.html',
                                        template_object_name='post',
                                        allow_empty=True,
                                        paginate_by=10)),

    (r'^addcomment/$','add_comment'),
    (r'^(?P<slug>[-\w\/]+)/$', 'view_article'),
)



The part that serves the front-page is:

    (r'^$','django.views.generic.list_detail.object_list',
            dict(
queryset=Post.objects.filter(state=PUBLISHED).filter(pub_date__lte=datetime.now()),
                    paginate_by=10,
                    allow_empty=True)),


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to