Friday, December 31, 2010

Re: De-coupling settings.py from project

On 31 December 2010 03:50, eblume <blume.erich@gmail.com> wrote:
> In particular, I'm having trouble specifying the static content URL
> and the fixtures directories at a per-application level rather than in
> the project settings.py file.

Can't you implement a static files finder, in the similar way to
template loaders to achieve the same effect?

http://docs.djangoproject.com/en/dev/howto/static-files/

New in Django 1.3.

> Is there a way to specify settings like STATIC_URL or FIXTURES_DIRS
> per-application rather than per-site? Even better - is there a
> mechanism to use a settings.py file in the application rather than in
> the site?

As Christophe explained, it is possible, but I also agree with
Christophe - you're going to the extreme for very unlikely use cases.
Also keep in mind that every time Django handles a request, it will
import the settings for *every* app, instead of just the app you think
will be used to handle the request. Settings could then clash, making
debugging a pain.

> Thanks,
> eblume
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment