Optional trailing slash in App URLs

2009-09-28 Thread Nuno Machado
Hello all, I really enjoy the default Django behaviour of handling URL trailing slashes. If one have: (r'^contact', views.contact), It doesn't matter if someone visits mywebsite.com/contact OR mywebsite.com/contact/. It'll work anyway! The problem is when including app urls, for instance:

Recursion without breaking MVC!

2009-09-28 Thread Nuno Machado
Hi djangoers, I've a simple category Model: class Category(models.Model): name = models.CharField(max_length=63) children = models.ManyToManyField('self', symmetrical=False, related_name='parent') I need to create a webpage to display all the categories with proper indentation,

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
> It isn't a bug. Read the docs. Create yourself an empty 404.html and > 500.html file in your templates directory and your flatpage will work > with DEBUG=False. You are so right!! :) It worked like a charm! I neglected this box: "Ensure that your 404 template works Note that the

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
<[EMAIL PROTECTED]> wrote: > On Dec 10, 11:48 am, Nuno Machado <[EMAIL PROTECTED]> wrote: > > > > > My urls.py WAS like this: > > > urlpatterns = patterns('', > >     (r'^admin/(.*)', admin.site.root), > >     (r'', include('django.contrib.flatpages.ur

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Thanks a lot, Jeff FW and Dmitry Dzhus. I'm using the most recent release version of Django (installed 5 days ago). 'django.contrib.flatpages' and 'django.contrib.sites' are listed in my INSTALLED_APPS. 'middleware.FlatpageFallbackMiddleware' is in my MIDDLEWARE_CLASSES. My urls.py WAS

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
com/en/dev/ref/middleware/#module-django.mi... > > On Dec 9, 7:29 pm, Nuno Machado <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm using flatpages to display some static content in a site. The > > "about" page is working flawlessly (URL = mysite.com/abo

Index page using flatpages

2008-12-09 Thread Nuno Machado
Hi, I'm using flatpages to display some static content in a site. The "about" page is working flawlessly (URL = mysite.com/about) but now I'm trying to define the index (URL = mysite.com) using flatpages. I'm having troubles defining the URL in the administration panel: If I put / in the URL