Re: Flatpages - what am I missing to make these work (advice, please)?
Hi, I had the same problem with the SITE_ID mismatched. I also found you can just recognize the SITE_ID from the admin page by editing the site form and checking the URL like (http://localhost:8000/admin/sites/site/ 1/). The last number on URL is exactly the SITE_ID of your site name. Just a tip! On Aug 19, 3:42 pm, gegard wrote: > Thank you! That has resolved my problem. > > The admin shell does not show the site id number by default, so I > supposed that removing the default 'example.com' and adding 'mysite' > would enable Django to reuse id 1. I should have assumed otherwise - > the new site was id == 2, of course. I should have edited > 'example.com' rather than removing it. > > Geoff > > > ... my site.id was not 1 but 2 as I > > discovered with > > the shell... > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Flatpages - what am I missing to make these work (advice, please)?
Thank you! That has resolved my problem. The admin shell does not show the site id number by default, so I supposed that removing the default 'example.com' and adding 'mysite' would enable Django to reuse id 1. I should have assumed otherwise - the new site was id == 2, of course. I should have edited 'example.com' rather than removing it. Geoff > ... my site.id was not 1 but 2 as I > discovered with > the shell... --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Flatpages - what am I missing to make these work (advice, please)?
I just had the same problem, because my site.id was not 1 but 2 as I discovered with the shell... On 18 août, 22:24, gegard wrote: > > I cannot get flatpages to work on my site > > ... which, I should have said, is in Django 1.1. > > Geoff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Flatpages - what am I missing to make these work (advice, please)?
> I cannot get flatpages to work on my site ... which, I should have said, is in Django 1.1. Geoff --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Flatpages - what am I missing to make these work (advice, please)?
I cannot get flatpages to work on my site, although I have done all that I can see in the documentation, and would like guidance. I give a 6-step short description of what I've done and what happened, in case anyone recognizes a glaring mistake or lack in what I've done. Step 6 is it just 'not working'. I can get static pages working Ok. Thank you for any help that you can give me. Regards, Geoff 1) Create settings for flatpages in settings.py settings.py --- ... SITE_ID = 1 ... MIDDLEWARE_CLASSES = ( ... 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', ) INSTALLED_APPS = ( ... 'django.contrib.sites', 'django.contrib.flatpages', ) 2) Create a template for flatpages in flatpages/default.html templates/flatpages/default.html http://www.w3.org/TR/REC-html40/loose.dtd";> {{ flatpage.title }} {{ flatpage.content }} 3) Create a path for flatpages in urls.py (this is not specified in the documentation but would seem to be needed as shown in the cwiw site. I've tried it with and without, and the without just means that all other paths are tried first during DEBUG) urls.py --- urlpatterns = patterns('', ... (r'', include('django.contrib.flatpages.urls')), ) 4) Create a flatpage in the admin console browse to: http://mysite/admin/flatpages/flatpage/1/ create URL: /info/ Title: Information Content: Some Info and Sites: mysite 5) Test that an arbitrary URL creates a 404. browse to: http://mysite/in/ I get a genuine 404 error. In DEBUG mode it says "No FlatPage matches the given query." 6) Test that the info URL creates works (IT DOESN'T!) browse to: http://mysite/info/ I again get a genuine 404 error. In DEBUG mode it again says "No FlatPage matches the given query." I would expect that my flatpage would now show. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---