Tengo un proyecto (myapp) en heroku pero no puedo hacer que los archivos estáticos funcionen correctamente. Estaba siguiendo esto blog post.Heroku - Manejo de archivos estáticos en la aplicación Django
Mi Procfile
se parece a esto:
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'),
)
...
Al reiniciar usando heroku restart
Esto es lo que los heroku logs
espectáculos:
...
Copying ...
114 static files copied to '/app/myapp/staticfiles'.
...
Pero cuando lo haga heroku run ls -l myapp/
I no puede ver la carpeta staticfiles
:
-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
¿Qué me falta o hacer mal?
Recientemente escribí una explicación detallada sobre el servicio de archivos estáticos en S3 desde una aplicación Heroku, échale un vistazo - http://balzerg.blogspot.co.il/2012/09/staticfiles-on -heroku-with-django.html – idanzalz