It's not very efficient, but it's possible.  I just finished up an app
where dynamic urls was an unfortunate requirement, but simple to
implement.

A view is just a function within which can call another view, so it's
easily possible to have a catchall view that captures the url (using
the normal static routing), fetches uncompiled regex strings->view
name mappings from a source (database, file, etc) and applies those
regexes until one matches. Then have the catchall/dispatcher view call
real view function associated with the regex that matched - passing on
the request object  and captured parameters just like the static url
dispatcher would.

For the app where I needed this functionality, most of the urls were
done with static mapping - only a certain pattern are set to do a
dynamic match.  I also decided to store them in a file via the
ConfigParser module rather than in the database, assuming this would
probably be faster but I haven't gotten around to verifying that
assumption.  The more you can leave static, the better.



On Jul 13, 12:57 pm, Maksymus007 <maksymus...@gmail.com> wrote:
> Its possible to use dynamic (database based maybe) routing, instead of
> static one?
--~--~---------~--~----~------------~-------~--~----~
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