Bonjour,

Je développe des applications Django sous Docker en utilisant Bootstrap.

Stack : Django/Nginx/Postgresql/Docker

J'aimerais pouvoir "customiser" les styles bootstrap et cherche donc à utiliser sass/scss sous Django.
Mais j'ai visiblement un problème de configuration des fichiers statics que je n'arrive pas à résoudre.

Pourtant les fichiers static semblent chargés dans le dossiers attendus mais le manifeststaticfiles.json ne contient aucun chemin et du coup je me retrouve avec l'erreur suivante
valueerror: missing staticfiles manifest entry for 'theme.scss'

d'avance merci pour votre aide

l'architecture de mes projets :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
- app
    - core
    - static
        - bootstrap
        - css
        - js
        - theme.scss
- nginx
principales configuration de mon environnement preprod
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DEBUG = False
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")


STATICFILES_FINDERS = [
    'compressor.finders.CompressorFinder',
]

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'django_libsass.SassCompiler'),

COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
LIBSASS_OUTPUT_STYLE = 'compressed'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
)

entrypoint.sh
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
python manage.py collectstatic --no-input
python manage.py compress --force
docker_compose.yml
Code yaml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
version: '3.7'
 
services:
    web:
        restart: always
        container_name: web
        build: 
            context: ./app
            dockerfile: Dockerfile.preprod
        restart: always
        command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
        volumes:
            - app_volume:/usr/src/app
            - static_volume:/usr/src/app/static
            - media_volume:/usr/src/app/media
        expose:
            - 8000
        env_file:
            - ./.env.preprod
        depends_on:
            - db
            - redis
        healthcheck:
            test: ["CMD", "curl", "-f", "http://localhost:8000/"]
            interval: 30s
            timeout: 10s
            retries: 50
 
    redis:
        container_name: redis
        image: "redis:alpine"
 
    celery:
        container_name: celery
        build: 
            context: ./app
            dockerfile: Dockerfile.preprod
        command: celery -A core worker -l info
        volumes:
            - app_volume:/usr/src/app
        env_file:
            - ./.env.preprod
        depends_on:
            db:
                condition: service_started
            web:
                condition: service_healthy
            redis:
                condition: service_started
 
    celery-beat:
        container_name: celery-beat
        build: 
            context: ./app
            dockerfile: Dockerfile.preprod
        command: celery -A core beat -l info
        volumes:
            - app_volume:/usr/src/app
        env_file:
            - ./.env.preprod
        depends_on:
            db:
                condition: service_started
            web:
                condition: service_healthy
            redis:
                condition: service_started
 
    db:
        container_name: db
        image: postgres:12.0-alpine
        volumes:
            - postgres_data:/var/lib/postgresql/data/
            - app_volume:/var/lib/postgresql/backup
        env_file:
            - ./.env.preprod.db
 
    nginx:
        container_name: nginx
        build: ./nginx
        restart: always
        volumes:
            - static_volume:/usr/src/app/static
            - media_volume:/usr/src/app/media
        ports:
            - 1340:80
        depends_on:
            web:
                condition: service_healthy
 
volumes:
    postgres_data:
    static_volume:
    media_volume:
    app_volume: