deployment-docs

E-Commerce (MS4/PP5) : Settings

To ensure the application is configured correctly, the web service's configuration settings are required.


A brief explanation of each setting is given below.

Settings

Name

A name is chosen to help identify the deployment. This will be listed in the Render dashboard overview.

The name chosen will form part of the deployed URL. If the name is unique on Render.com, the resulting URL will be <name>.onrender.com. If the name is not unique, a random hash with be appended to the name given, e.g. <name>-3yk1.onrender.com

Root Directory

The root directory of the project and its content. This can be edited if required, but usually it will remain blank, thus indicating the root directory of the repository is the same as the root directory of the web service.

Environment

The nature of the program so Render.com knows which of their configurations to use. With Python selected, Render will use their latest specified default Python version, but this is configurable.

Region

The physical location of the server hosting the web service. The location will slightly effect loading speeds etc.

Branch

The branch that the service should be deployed from. This will often be main (or master for older repositories) but is configurable to any public branch within the repository.

Build Command

This is the command that is executed when the deployment build is initiated. The command instructs the build to run the build.sh file from the current working directory.

An alternative file name could be given as long as the relevant file exists, but build.sh is a fairly conventional name.

Start Command

This is the executable command that is run within an environment. gunicorn is an installed package, it then runs the wsgi file within the directory given. :application allows the application variable to be called upon which exists within the wsgi file.

Process

  1. Add a Name

    name setting with a meaningful name in the input

    If the name is not unique, a random hash with be appended to the name given, e.g. <name>-3yk1.onrender.com

  2. Ensure the following settings match

    Setting Name Value
    Root Directory blank
    Environment Python 3
    Region Frankfurt (EU Central)

    For those outside of Europe, a more localized region may be preferred.
    Branch main

    You can deploy from a different branch if required.
  3. Set the Build Command

     ./build.sh
    

    build command setting with pip install -r requirements.txt in the input

    Using ./ before a file name in the command line is a common way to execute the file.

  4. Set the Start Command

     gunicorn <PROJECT_NAME>.wsgi:application
    

    start command setting with a value of python app.py

    Replace <PROJECT_NAME> with the directory name of your project. This is the name of the directory that holds your settings.py file.

  5. Ensure the Free plan $0/month is selected

    free plan selected

    The requirements of the project are well within the free services offered by Render.com. Feel free to explore their pricing structure and free plan limitations.

Up Next

The environment variables are needed. The next page details how to add them.