Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

Deploying to production

Daniel Avelino edited this page May 28, 2021 · 3 revisions

Deploying to production

Django requires some additional steps in order to be safety deployed at production environments. Most of them were covered since we start using cherrypy as a WSGI. Some additional steps might be required in order to really go to production:

Changing IP/FQDN and port number

To change server's IP/FQDN address or listening port number do:

Linux:

./run.sh [IP/FQDN]:[port]

Windows:

./run.bat [IP/FQDN]:[port]

Example:

./run.sh 192.168.0.1:80

will serve the Catalog to any source address at 192.168.0.1 IP address via the port number 80.

TLS support

Now we have a cherrypy WSGI support that solves most problems due to port this project to production. Technically it is ready to go to production, but you might be interesting in some security tips, so here we go:

  1. Create the folder base/ssl and set the permissions accordingly.
mkdir -p base/ssl
  1. Edit the file base/run_cherrypy.py: Open it by using your favorite editor and change the following lines accordingly:
# For SSL Support
    # server.ssl_module            = 'builtin'
    # server.ssl_certificate       = 'ssl/certificate.cer'
    # server.ssl_private_key       = 'ssl/private.key'
    # server.ssl_certificate_chain = 'ssl/bundle.pem'

Then import your certificate material accordingly.

Additional Django security features

For more security settings, please check Django's official documentation here and here.

After that, review the settings at base/base/settings.py file.

Clone this wiki locally