Why /static/ not showing up for /admin in Django project?

So I ahve been trying a bunch of things. settings look good to me but maybe I am missing something, need help.

I use: PostegreySQL, Reddis, Celery beat, nginx, gunicorn.

the problem:
maybe its permission issue, maybe directories, I cannot figure it out.

enter image description here

[error] 280897#280897: *40433 open() "/app/crm_market/collected_static/grappelli/js/grappelli.min.js" failed (2: No such file or directory), client: 31.128.32.152, server: my_domen.com, request: "GET /static/grappelli/js/grappelli.min.js HTTP/1.1", host: "my_domen.com", referrer: "https://my_domen.com/admin/login/?next=/admin/"

(venv) root@fuvscqxzga://root/CRM-WB# docker compose exec web ls -l /app/crm_market/collected_static/ total 12 drwxr-xr-x 6 www-data www-data 4096 Jun 25 09:15 admin drwxr-xr-x 4 www-data www-data 4096 Jun 25 09:15 debug_toolbar drwxr-xr-x 9 www-data www-data 4096 Jun 25 09:15 grappelli

project structure:

enter image description here

settings.py:

STATIC_URL = "/static/"
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = os.path.join(BASE_DIR, "collected_static")

/etc/nginx/sites-enabled/default

server {
    server_name my_domen.com;

    location /static/ {
        alias /app/crm_market/collected_static/;
    }
    location /admin/ {
        proxy_pass http://127.0.0.1:8000;
    }

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;

    listen 443 ssl; 

Dockerfile

FROM python:3.9-slim

WORKDIR /app/crm_market

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["gunicorn", "--bind", "0.0.0.0:8000", "CRM-WB.wsgi:application"]

docker-compose.yml

services:
  db:
    image: postgres:latest
    environment:
      POSTGRES_DB: mydatabase
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword
    volumes:
      - db_data:/var/lib/postgresql/data

  redis:
    image: redis:latest
    command: redis-server --requirepass $REDIS_PASSWORD
    ports:
      - '6379:6379'
    volumes:
      - redisdata:/data
    env_file:
      - .env

  web:
    build: .
    command: >
      sh -c "python manage.py migrate --noinput &&
             python manage.py collectstatic --noinput &&
             gunicorn crm_market.wsgi:application --bind 0.0.0.0:8000"
    volumes:
      - .:/app
      - static_volume:/app/crm_market/collected_static
    ports:
      - "8000:8000"
    depends_on:
      - db
      - redis
    working_dir: /app/crm_market

  worker:
    build: .
    command: celery -A crm_market worker -l info
    volumes:
      - .:/app
    depends_on:
      - db
      - redis
    environment:
      - DJANGO_SETTINGS_MODULE=crm_market.settings
      - PYTHONPATH=/app/crm_market
    working_dir: /app/crm_market

  beat:
    build: .
    command: celery -A crm_market beat -l info
    volumes:
      - .:/app
    depends_on:
      - db
      - redis
    environment:
      - DJANGO_SETTINGS_MODULE=crm_market.settings
      - PYTHONPATH=/app/crm_market
    working_dir: /app/crm_market

volumes:
  db_data:
  redisdata:
  static_volume:

I want admin/ to see collected_static. I tried diffrent variants of the nginx, Dockerfile, docker-compose:

Thried to setup access with these commands:

docker compose exec web chown -R www-data:www-data /app/crm_market/collected_static
docker compose exec web chmod -R 755 /app/crm_market/collected_static
docker compose exec web ls -ld /app/crm_market/collected_static
docker compose exec web ls -l /app/crm_market/collected_static/admin/css/base.css
docker compose down
docker compose up -d --build
curl -I https://handonpulse.ru/static/admin/css/base.css

result:
enter image description here

tried collecting static manually they dont get applied by docker:
docker compose exec web python manage.py collectstatic --noinput

New contributor

Zebra Turner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật