I have a project (myapp) in heroku but I can't get the static files to work properly. I was following this blog post.
My Procfile
looks like this:
web: python myapp/manage.py collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=0.0.0.0:$PORT myapp/settings.py
settings.py
:
...
STATIC_ROOT = os.path.join(PROJECT_PATH, 'staticfiles')
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
STATICFILES_DIRS = (
# I have the static folder inside my app and not inside the project
os.path.join(PROJECT_PATH, 'cesar/static'),
)
...
When restarting using heroku restart
this is what the heroku logs
shows:
...
Copying ...
114 static files copied to '/app/myapp/staticfiles'.
...
But when I do heroku run ls -l myapp/
I can't see the staticfiles
folder:
-rw------- 1 u5605 5605 0 Jan 28 16:53 __init__.py
drwx------ 4 u5605 5605 4096 Jan 28 16:53 cesar
-rw------- 1 u5605 5605 503 Jan 28 16:53 manage.py
-rw------- 1 u5605 5605 6292 Jan 28 16:53 settings.py
drwx------ 2 u5605 5605 4096 Jan 28 16:53 templates
-rw------- 1 u5605 5605 257 Jan 28 16:53 urls.py
-rw------- 1 u5605 5605 286 Jan 28 16:53 views.py
What am I missing or doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…