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 · 3 comments
Closed

Static Assets #13

iammerrick opened this issue Nov 7, 2015 · 3 comments

Comments

@iammerrick
Copy link

@iammerrick 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 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 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

@michealjroberts
Copy link

@michealjroberts michealjroberts commented May 16, 2019

This isn't working in the production deployment.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.