On Thu, Oct 30, 2008 at 12:22 PM, john <[EMAIL PROTECTED]> wrote:

>
> Hmm....  that doesn't work properly.
>
> What is the correct way to set up urls when you add flatpages? If you
> add the flatpage urlpattern match to the end of ./shop/urls.py you can
> no longer view products if you use the base_index.html template as
> products are not contained within that shop/url.py so of course it
> doesn't find a match before hitting the flatpage include....
>
> many thanks for any help,
> Stjohn
>

First, don't ever modify shop/urls.py.  That means you are forking the code,
and you won't get updates properly.  I guarantee you will regret it if you
fork the code.

Instead, use the SHOP_URLS facility in your settings file. That's what it is
for.  For more customized needs, please refer to my blog article about
setting up a flexible, maintainable site.  I talk about URLs there.

http://gosatchmo.com/starting-a-new-store-real-world-project-layout

For you, I recommend you simply directly reference the urls that you want to
serve.  Something like this:

urlpatterns += patterns('',
    ('^terms/', 'django.views.generic.simple.direct_to_template',
        {'template' : 'site/terms.html'}, 'shop_terms'))

If you really want to use flatpages, then just have it be active for urls
under some known prefix, like so:

urlpatterns += patterns('',
    ('^pages/', include('django.contrib.flatpages.urls')))

Bruce Kroeze
http://gosatchmo.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to