I've been having a hard time figuring out how to solve this problem:

We're building *another* django blogging app, but we want the app to
support multiple blogs on the same site, ideally by having each Blog
"mounted" on it's own URL, ie: "/politics/" is a Blog, "/tumbles/" is
another Blog, etc.

To accomplish this, I have a `Blog` model which looks roughly
something like this:

class Blog(models.Model):
    site = models.ForeignKey(Site)
    title = models.CharField(max_length=500)
    url = models.SlugField('URL', prepopulate_from=("title",),
blank=True)

urls.py then contains lines like this:
    (r'^(?P<blog_url>[-\w]+)/categories/',
include('glyph.apps.categories.urls')),

That way we can create new Blogs, and have the URLs be generic enough
to handle any blog's url.  The problem is that we also want to allow a
Blog to have a blank URL, i.e. have it mounted on the root of the
domain.  That way "example.com/categories/" would route to
`glyph.apps.categories.urls', and execute all the views using the Blog
with an empty URL field.  I'm really stuck figuring out how to do
this...

I would greatly appreciate any advice!  I'm really not sure how to do
this, but what I have so far sure doesn't feel like an elegant
solution :(

(For reference, the entirety of the code is at 
http://code.google.com/p/glyph-blog/.
I know it's messy, I'm working on making it better :)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to