Hi Radosław,
On 03/10/2017 11:49 AM, Radosław Orłowski wrote:
> Right now I'm working with Django 1.8.17 and What I'm trying to
> acomplish is simple override of static files.
>
> STATICFILES_DIRS = (
> str(os.path.abspath(os.path.join(SITE_ROOT, 'static_new'))),
> str(os.path.abspath(os.path.join(SITE_ROOT, 'static'))),
> )
>
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> )
>
> my thinking:
> I have to sites that need different logo file.
>
> Both directories static and static_new have images/logo.png, but this
> file is different.
>
> I need to add logo from static_new and load rest of content from static
> (js, css. etc)
You mentioned that you have two sites. Are you using the sites
framework? Then you should have a separate settings module for each
site, so you can just give them different settings:
```
# settings_site1.py
# site1 only uses files from ``static``.
SITE_ID = 1
STATIC_ROOT = '/var/static/site1'
STATICFILES_DIRS = (
os.path.abspath(os.path.join(SITE_ROOT, 'static')),
)
# settings_site2.py
# site2 uses files from ``static_new``, and falls back to ``static``
SITE_ID = 2
STATIC_ROOT = '/var/static/site2'
STATICFILES_DIRS = (
os.path.abspath(os.path.join(SITE_ROOT, 'static_new')),
os.path.abspath(os.path.join(SITE_ROOT, 'static')),
)
Regards,
René
--
René Fleschenberg
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/933e0d82-b0f8-9676-05bc-0d2ab8a5d974%40fleschenberg.net.
For more options, visit https://groups.google.com/d/optout.