'Collectstatic deleting wagtail blog images
I have a wagtail site that I deploy using elasticbeanstalk. When I deploy collectstatic is ran:
.platform/hooks/postdeploy
#!/bin/sh
source /var/app/venv/staging-LQM1lest/bin/activate
python /var/app/current/manage.py migrate
python /var/app/current/manage.py createsu
python /var/app/current/manage.py collectstatic --noinput
I have found that this has the effect of deleting any images that are in my blog posts. I assume this is because the blog posts have been made using the page editor (of the deployed site) and are not on my local machine like the rest of the static files
How should I be setting things so that I do not delete the images everytime collectstatic is ran?
Solution 1:[1]
Make sure the MEDIA_ROOT and MEDIA_URL settings in your project (which define where uploaded files will be placed) are set to something different to STATIC_ROOT and STATIC_URL (which define the location of static files that are deployed as part of the app).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gasman |
