media files aren 27t serving in django app on cpanel

Solutions on MaxInterview for media files aren 27t serving in django app on cpanel by the best coders in the world

showing results for - "media files aren 27t serving in django app on cpanel"
Guadalupe
20 Oct 2017
1To deploy a production server, you need to set 3 things
2
3deactivate the DEBUG configuration:
4DEBUG = False <------
5
6This disable all extra function for development.
7
8define a static root directory in the settings file:
9STATIC_ROOT = '/this/is/a/path/to/statics' <---------
10
11This, indicate where all the static files should be saved.
12
13run the command to collect all static files:
14python manage.py collectstatic <-------
15
16This saves all statics files in the directory configured by STATIC_ROOT
17
18The official documentation for deployment: https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/#static-root-and-static-url