7
Your Nginx is not serving the MEDIA_URL
i.e. /media/
. You need an Nginx configuration section like you have for /static/
server {
listen 80;
server_name <my IP> ;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myusername/myproject;
}
location /media/ {
root /home/myusername/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/myusername/myproject/myproject.sock;
}
}
0
You may need to run this command :
python manage.py collectstatic
from the shell of your platform
if you are using heroku here is the command
heroku run python manage.py collectstatic
- [Django]-Django-pyodbc SQL Server/freetds server connection problems on linux
- [Django]-Django admin โ OneToOneField inline throws "has no ForeignKey" exception
- [Django]-Django Query, filter by user group
- [Django]-Int vs String for field choices
- [Django]-Getting a ValueError: invalid literal for int() with base 10: '' error and don't know why
Source:stackexchange.com