May 2018
Beginner to intermediate
526 pages
11h 57m
English
NGINX is very good at serving static content. For best performance we will use NGINX to serve the static files in our production environment. We will set up NGINX to serve both static files of our application and media files uploaded for course contents.
Edit the settings/base.py file and add the following code to it:
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
We need to export static assets with Django. The collectstatic command copies static files from all applications and stores them in the STATIC_ROOT directory. Open the shell and run the following command:
python manage.py collectstatic
You will see this output:
160 static files copied to '/educa/static'.
Now edit the config/nginx.conf file and add ...
Read now
Unlock full access