Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Assets #13

Closed
iammerrick opened this issue Nov 7, 2015 · 4 comments
Closed

Static Assets #13

iammerrick opened this issue Nov 7, 2015 · 4 comments

Comments

@iammerrick
Copy link

iammerrick commented Nov 7, 2015

Any way to let Django serve the static assets if collectstatic hasn't been run yet? It's sort of a pain to run collectstatic each time you know?

@mjhea0
Copy link
Contributor

mjhea0 commented Dec 28, 2015

You could add it to a shell script:

#!/bin/sh
python /app/manage.py collectstatic --noinput
/usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000

Then in the production.yml file just run the shell script:

web:
  restart: always
  build: ./web
  expose:
    - "8000"
  links:
    - postgres:postgres
    - redis:redis
  env_file: .env
  command: /shell-script.sh

@viktorvillalobos
Copy link

viktorvillalobos commented Nov 30, 2017

This give me an error:

web_1 | usage: manage.py collectstatic [-h] [--version] [-v {0,1,2,3}]
web_1 | [--settings SETTINGS] [--pythonpath PYTHONPATH]
web_1 | [--traceback] [--no-color] [--noinput]
web_1 | [--no-post-process] [-i PATTERN] [-n] [-c] [-l]
web_1 | [--no-default-ignore]
web_1 | manage.py collectstatic: error: unrecognized arguments: --noinput

@mmichealjroberts
Copy link

mmichealjroberts commented May 16, 2019

This isn't working in the production deployment.

@hashlash
Copy link

hashlash commented Aug 16, 2020

web_1 | manage.py collectstatic: error: unrecognized arguments: --noinput

@viktorvillalobos It may be caused by CR line endings. See https://stackoverflow.com/a/38425862/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants