Re: URLPattern - can't fetch a detail page
Right on the money Martin! Thanks alot. I knew it was something *stupid* I had done, but after looking at the project for so long, you lose your clarity for details :/ On May 21, 8:30 pm, "Martin Glueck" <[EMAIL PROTECTED]> wrote: > Looking at the urls pattern reported in the 404 page it looks like there is > twice the "^" symbol. > And I would say that is the problem because this symbol tries to match the > "start of a line", so the pattern > "^news/ ^/(?P[a-zA-Z0-9-_]+)/?$" will never match to "/news/hello/". > > my guess is that you "include" the urls.py file in your main urls.py file > like: > > urlpatterns += patterns \ > ( "" > , ( "^news/", include ("xxx.urls")) > ) > > If this is the case, the you have to change the patterns in your include > urls.py and remove the "^" part of the pattern: > > urlpatterns = patterns > ( 'django.views.generic.list_detail' > , (r(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', dict(news_list_info, > slug_field='slug')) > , (r$', 'object_list', news_list_info), > ) > > That I would say it should match the "/news/hello/" url. > > Martin > On 5/21/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > > > > Hehe, this is getting old, but still things don't work. > > > There's no special stack trace here, I only get returned a 404 page > > result for the list_detail page. > > > here's the full urls.py: > > > from django.conf.urls.defaults import * > > from myproj.news.models import Entry > > > news_list_info = { > > 'queryset': Entry.objects.all(), > > 'allow_empty': True, > > } > > > urlpatterns = patterns('django.views.generic.list_detail', > > #(r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > > slug_field='slug')), > > (r'^/(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', > > dict(news_list_info, slug_field='slug')), > > (r'^/?$', 'object_list', news_list_info), > > ) > > > - > > > As I noted earlier, the object_list view, works like a charm, the > > object_detail ain't. :/ > > > The resulting 404 page: > > > Using the URLconf defined in myproj.urls, Django tried these URL > > patterns, in this order: > > ^news/ ^/(?P[a-zA-Z0-9-_]+)/?$ > > ^news/ ^/?$ > > ^admin/ > > The current URL, /news/hello/, didn't match any of these. > > > On May 19, 9:57 am, Tyson Tate <[EMAIL PROTECTED]> wrote: > > > Can you post a stack trace and more details from your url.py file? > > > > -Tyson > > > > On May 18, 2007, at 1:05 PM, Panos Laganakos wrote: > > > > > Thanks for the reply mate, but that doesn't seem to be the issue. I > > > > still can't figure out what's going wrong here :/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: URLPattern - can't fetch a detail page
Looking at the urls pattern reported in the 404 page it looks like there is twice the "^" symbol. And I would say that is the problem because this symbol tries to match the "start of a line", so the pattern "^news/ ^/(?P[a-zA-Z0-9-_]+)/?$" will never match to "/news/hello/". my guess is that you "include" the urls.py file in your main urls.py file like: urlpatterns += patterns \ ( "" , ( "^news/", include ("xxx.urls")) ) If this is the case, the you have to change the patterns in your include urls.py and remove the "^" part of the pattern: urlpatterns = patterns ( 'django.views.generic.list_detail' , (r(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', dict(news_list_info, slug_field='slug')) , (r$', 'object_list', news_list_info), ) That I would say it should match the "/news/hello/" url. Martin On 5/21/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > > Hehe, this is getting old, but still things don't work. > > There's no special stack trace here, I only get returned a 404 page > result for the list_detail page. > > here's the full urls.py: > > from django.conf.urls.defaults import * > from myproj.news.models import Entry > > > news_list_info = { > 'queryset': Entry.objects.all(), > 'allow_empty': True, > } > > > urlpatterns = patterns('django.views.generic.list_detail', > #(r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > slug_field='slug')), > (r'^/(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', > dict(news_list_info, slug_field='slug')), > (r'^/?$', 'object_list', news_list_info), > ) > > - > > As I noted earlier, the object_list view, works like a charm, the > object_detail ain't. :/ > > The resulting 404 page: > > Using the URLconf defined in myproj.urls, Django tried these URL > patterns, in this order: > ^news/ ^/(?P[a-zA-Z0-9-_]+)/?$ > ^news/ ^/?$ > ^admin/ > The current URL, /news/hello/, didn't match any of these. > > > On May 19, 9:57 am, Tyson Tate <[EMAIL PROTECTED]> wrote: > > Can you post a stack trace and more details from your url.py file? > > > > -Tyson > > > > On May 18, 2007, at 1:05 PM, Panos Laganakos wrote: > > > > > Thanks for the reply mate, but that doesn't seem to be the issue. I > > > still can't figure out what's going wrong here :/ > > > > > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: URLPattern - can't fetch a detail page
Hehe, this is getting old, but still things don't work. There's no special stack trace here, I only get returned a 404 page result for the list_detail page. here's the full urls.py: from django.conf.urls.defaults import * from myproj.news.models import Entry news_list_info = { 'queryset': Entry.objects.all(), 'allow_empty': True, } urlpatterns = patterns('django.views.generic.list_detail', #(r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='slug')), (r'^/(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', dict(news_list_info, slug_field='slug')), (r'^/?$', 'object_list', news_list_info), ) - As I noted earlier, the object_list view, works like a charm, the object_detail ain't. :/ The resulting 404 page: Using the URLconf defined in myproj.urls, Django tried these URL patterns, in this order: ^news/ ^/(?P[a-zA-Z0-9-_]+)/?$ ^news/ ^/?$ ^admin/ The current URL, /news/hello/, didn't match any of these. On May 19, 9:57 am, Tyson Tate <[EMAIL PROTECTED]> wrote: > Can you post a stack trace and more details from your url.py file? > > -Tyson > > On May 18, 2007, at 1:05 PM, Panos Laganakos wrote: > > > Thanks for the reply mate, but that doesn't seem to be the issue. I > > still can't figure out what's going wrong here :/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: URLPattern - can't fetch a detail page
Can you post a stack trace and more details from your url.py file? -Tyson On May 18, 2007, at 1:05 PM, Panos Laganakos wrote: > Thanks for the reply mate, but that doesn't seem to be the issue. I > still can't figure out what's going wrong here :/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: URLPattern - can't fetch a detail page
Thanks for the reply mate, but that doesn't seem to be the issue. I still can't figure out what's going wrong here :/ On May 18, 10:18 pm, Tyson Tate <[EMAIL PROTECTED]> wrote: > Your slug_field should be set to 'slug' because that's what you've > named it in your RegEx: > > '^/(?P[-\w]+)/?$' > > So you want: > > (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > slug_field='slug')), > > or, conversely: > > (r'^/(?P[-\w]+)/?$', 'object_detail', dict > (news_list_info, slug_field='news_entry')), > > Regards, > Tyson > > On May 18, 2007, at 10:30 AM, Panos Laganakos wrote: > > > I've set up the url pattern as: > >(r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > > slug_field='news_entry')), > > > The news_list_info: > > news_list_info = { > >'queryset': Entry.objects.all(), > >'allow_empty': True, > > } > > > and both list and detail templates are in: > > /templates/news/entry_list.html and entry_detail.html > > > While I can reach the list page just fine, I can't seem to reach > > entry_detail.html, giving me a 'Page not found (404). --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: URLPattern - can't fetch a detail page
Your slug_field should be set to 'slug' because that's what you've named it in your RegEx: '^/(?P[-\w]+)/?$' So you want: (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='slug')), or, conversely: (r'^/(?P[-\w]+)/?$', 'object_detail', dict (news_list_info, slug_field='news_entry')), Regards, Tyson On May 18, 2007, at 10:30 AM, Panos Laganakos wrote: > I've set up the url pattern as: > (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > slug_field='news_entry')), > > The news_list_info: > news_list_info = { > 'queryset': Entry.objects.all(), > 'allow_empty': True, > } > > and both list and detail templates are in: > /templates/news/entry_list.html and entry_detail.html > > While I can reach the list page just fine, I can't seem to reach > entry_detail.html, giving me a 'Page not found (404). --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
URLPattern - can't fetch a detail page
I've set up the url pattern as: (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='news_entry')), The news_list_info: news_list_info = { 'queryset': Entry.objects.all(), 'allow_empty': True, } and both list and detail templates are in: /templates/news/entry_list.html and entry_detail.html While I can reach the list page just fine, I can't seem to reach entry_detail.html, giving me a 'Page not found (404). --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---