CollectStatic is a Django Command that collects the static files into STATIC_ROOT directory as per specified in the base.py config files for your django applications.
Questions tagged [collectstatic]
118 questions
139
votes
4 answers
What's the point of Django's collectstatic?
In Django, the convention is to put all of your static files (i.e css, js) specific to your app into a folder called static. So the structure would look like this:
mysite/
manage.py
mysite/ --> (settings.py, etc)
myapp/ --> (models.py,…
user5732453
85
votes
21 answers
Collectstatic error while deploying Django app to Heroku
I'm trying to deploy a Django app to Heroku, it starts to build, download and installs everything, but that's what I get when it comes to collecting static files
$ python manage.py collectstatic --noinput
remote: Traceback (most recent call…

Stefano De Rosso
- 1,309
- 1
- 14
- 27
59
votes
10 answers
The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting
I'm using Django 1.7. When deploying my site to a Production server and running collectstatic, I get following error message:
django.core.exceptions.ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting
I…

SaeX
- 17,240
- 16
- 77
- 97
19
votes
4 answers
Django collectstatic no such file or directory
In django 1.7 collectstatic throws an exception for me:
OSError: [Errno 2] No such file or directory: '/static'
I've performed a lot of collectstatic-calls and everything worked fine, but today have this issue.
settings.py
BASE_DIR =…

VP.
- 15,509
- 17
- 91
- 161
18
votes
3 answers
Running collectstatic on server : AttributeError: 'PosixPath' object has no attribute 'startswith'
After deploying on a server on digital ocean using nginx, gunicorn, django, and virtualenv, I try to use collectstatic:
python manage.py collectstatic --settings=config.settings.production
As you can see I have multiple setting files. One base, one…

Tony
- 2,382
- 7
- 32
- 51
14
votes
3 answers
Django Whitenoise 500 server error in non debug mode
I am using django in my local machine. In order to serve the static files I used WhiteNoise along with it. When DEBUG = True all static files are correctly served. But when I changed DEBUG = False and set ALLOWED_HOSTS = ['*'] I'm getting 500 server…

Devika Sudheer
- 260
- 3
- 12
14
votes
10 answers
Django media files not showing with Debug = False on production - Django 1.10
I currently have two kind of files static files and media files.The static files contain my css,js and other static content. The media files contain stuff that the user uploads.The static folder is right next to the media folder.Now on my deployed…

MistyD
- 16,373
- 40
- 138
- 240
12
votes
4 answers
Using Django's collectstatic with boto S3 throws "Error 32: Broken Pipe" after a while
I'm using boto with S3 to store my Django site's static files. When using the collectstatic command, it uploads a good chunk of the files perfectly before stopping at a file and throwing "Error 32: Broken Pipe." When I try to run the command again,…

BenWurth
- 790
- 1
- 7
- 23
7
votes
3 answers
Django collectstatic not working on production with S3, but same settings work locally
I've been moving around some settings to make more defined local and production environments, and I must have messed something up.
Below are the majority of relevant settings. If I move the production.py settings (which just contains AWS-related…

hookedonwinter
- 12,436
- 19
- 61
- 74
7
votes
1 answer
collecstatic does not push to files S3
EDIT:
I have found that removing import django_heroku from my settings.py file allows me to push my static files to my AWS bucket. When I uncomment import django_heroku, collectstatic then pushes my files to the staticfiles folder.
manage.py…

Nick Mancini
- 119
- 3
- 11
7
votes
3 answers
Django static vs. user uploaded files
After reading a ton of documentation, I still don't have a good grasp on what exactly counts as a static vs. a user uploaded file... or what exactly a static file is even.
1. Static files
Django describes static files as things like "images,…

reedvoid
- 1,203
- 3
- 18
- 34
5
votes
1 answer
getting django-pipeline and bower to play nicely together
I am installing bower components to external/bower_components/ under my project root. I have additional static files under static as well as some that are part of installed apps. I'm trying to use django-pipeline to minify static files that all live…

mirth23
- 377
- 2
- 10
5
votes
1 answer
Collectstatic configuration error when deploying Django app with dokku
When deploying a Django app using dokku I am getting a following error
Collectstatic configuration error. To debug, run:
$ heroku run python ./manage.py collectstatic --noinput
I found no way to run heroku run python ./manage.py collectstatic…

silentser
- 2,083
- 2
- 23
- 29
4
votes
0 answers
No such file or directory when trying to collect static files on Heroku
I’m trying to add a static directory of files, to contain javascript, css, and the like) to my Django app that I’m deploying on Heroku.
The storage is being done with AWS S3 and I know this part is working because before trying to add this static…

Dylan
- 2,315
- 2
- 20
- 33
4
votes
1 answer
Missing staticfiles manifest entry in Django deployment using Heroku
I am trying to deploy my webapp to heroku. I am using Django and the following is most of my settings.py file:
"""
Django settings for blog project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information…

137
- 183
- 2
- 14