30👍
✅
In with your other static media. See here for more info:
2👍
You have defined paths for media and static into the settings.py:
import os.path
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'media'))
STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'static'))
- Used BASE_DIR to calculate the path to the settings.py file
- Used BASE_DIR to generate the MEDIA_ROOT and STATIC_ROOT paths to the previous path of settings
Following that structure the path structure should be:
-yourApp
----manage.py
----media
----static
----yourApp
--------settings.py
--------models.py
- [Django]-How to select a record and update it, with a single queryset in Django?
- [Django]-How to use if/else condition on Django Templates?
- [Django]-How to use Query Strings for filtering Querysets in Django?
Source:stackexchange.com