Sorry, I did not get you...
What I do in those cases is indeed put a variable in the settings.py,
and a default value in the models.py of each app:
try:
myvar=settings.myvar
except:
myvar=default_value
I then use the variable in the model to construct the get_absolute_url function.
You could also use that variable to construct your urls.py and in the
template if necessary.
I also make extensive use of the includes in the urls.py. For each of
my projects I have a relative urls.py that get included in my main
urls.py.
But I think I might haven't told you anything very new...
G
On 11/10/06, Sandro Dentella <[EMAIL PROTECTED]> wrote:
>
> On Fri, Nov 10, 2006 at 05:43:28PM +0100, Guillermo Fernandez Castellanos
> wrote:
> >
> > Hi,
> >
> > Maybe this will help you:
> > http://www.djangoproject.com/documentation/sites/
>
> if I understant it correctly this has nothing to do with what I want. They
> have different domain, I want a single domain. They want to share parts of
> the site, I don't want it at all.
>
> To be a little more explicit: suppose I have a site that is
>
> http://www.mydomain.it/1st_djago_prj
>
> and I want to move it to
>
> http://www.mydomain.it/django/1st_djago_prj
>
> i have to change all the links in the templates, and the urls.py so that for
> example:
>
> urlpatterns = patterns('',
> (r'^$', 'bla.bla'),
> )
>
> becomes:
>
> urlpatterns = patterns('',
> (r'^django$', 'bla.bla'),
> )
>
> The problem, as I see it, arises from the fact that if I leave a link
> relative (w/o leading '/') it will be built according to the place where I
> was when the template has been rendered and not from a starting location.
>
> Moreover, as written in the docs "Note that Django's URLconfs won't trim the
> "/mysite/" -- they get passed the full URL." so that ursl.py must be aware
> of the location, it'd e nice to be able to say "trim off /mysite/" when
> doing the regex for the urlpattern.
>
> How does normally people build URLS within templates, isn't there a way to
> be able to reuse them easily if I move the application?
>
> ciao
> sandro
> *:-)
>
> --
> Sandro Dentella *:-)
> http://www.tksql.org TkSQL Home page - My GPL work
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---