Hi all,

I want to develop a cms and I want my urls partially to be user-
defined, for example:

/home/info
/home/blog/-/post/
/frank/blog/-/articles/2003
/frank/bio

The first part (the part before '/-/' if any) would map to an
application in the database and is user defined (it could be
anything). That first part could also define additional information to
be passed to the application, in the case of a blog-application this
could be the blog-id. So:

/home/info
A lookup in the database would return the application name: 'Page' and
the page-id: '23'. The url conf of application Page should be included
and the page-id passed to it.

/home/blog/-/post
A lookup in the database would return the application name: 'Blog' and
the blog-id: '54'. The url conf of application Blog should be included
and the blog-id passed to it. The included url conf takes care to map
the second part of the url (post) to a view.

/frank/blog/-/articles/2003
A lookup in the database would return the application name: 'Blog' and
the blog-id: '22'. The url conf of application Blog should be included
and the blog-id passed to it. The included url conf takes care to map
the second part of the url (articles/2003) to the apropriate view.

/frank/bio
A lookup in the database would return the application name: 'Page' and
the page-id: '455'. The url conf of application Page should be
included and the page-id passed to it.

So I would to have something like:

urlpatterns = patterns('',
    (r'^(.*)$', include(<application-name>, <additional-info>)),
)
(where <application-name> and <additonal-info> are found by a database
lookup of the first part of the url.)

I can't firgure out how the database lookup would fit in and how I
could pass something like a blog-id to the included application url
conf.

Any ideas how I could accomplish this?

thanks in advance,

Pieter


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to