Skip to main content

Environmental File

The .env file is located at project root and contains a multitude of settings, shared across Django and Node.js environments.

When the project is first installed, there will be a .env.example file instead. This file should be copied to a .env file so that it can be used.

cp .env.example .env

Availables configs in .env:


# All values are defaults
DEBUG=True
# A boolean that turns on/off debug mode.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#debug
REQUESTS_DEBUG=False
# A boolean that turns on/off detailed information about requests sent within the project.
SESSION_COOKIE_SECURE=False
# Whether to use a secure cookie for the session cookie.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#session-cookie-secure
ALLOWED_HOSTS=*
# A list of strings representing the host/domain names that this Django site can serve. Every domain is allowed in development.
DATABASE_URL=sqlite:///db.sqlite3
# Database URL to be used as default database.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#databases
CACHE_URL=dummycache://127.0.0.1:6379/1
# URL for default cache, see below.
LOCAL_CACHE_URL=dummycache://127.0.0.1:6379/2
# URL for local cache. Dummy cache is something that acts like a cache but nothing is actually cached.
# Reference: https://docs.djangoproject.com/en/2.2/topics/cache/#dummy-caching-for-development
STATIC_URL='/static_omnishop/'
# URL to use when referring to static files located in STATIC_ROOT.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#static-url
STATIC_ROOT='static_omnishop_prod'
# The absolute path to the directory where collectstatic will collect static files for deployment.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#static-root
MEDIA_URL='/media/'
# URL that handles the media served from MEDIA_ROOT.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#media-url
MEDIA_ROOT='media'
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Reference: https://docs.djangoproject.com/en/2.2/ref/settings/#media-root
SERVICE_BACKEND_URL=https://pz-api.akinon.net/
# URL to use as a backend service. This service provides almost everything related to the project, such as users, orders, widgets etc. If we're developing a hypothetical project called PZ, the hypothetical service backend URL could be as above. If we wanted, we could also connect to a different project to have their users, see their widgets etc.
WEBPACK_DEV_PORT=5000
# The port which Webpack will use with WebpackDevServer, which is used for auto-reloading the page on change. You only need to change this if you have issues running to projects at the same time and it is only relevant if you're using `yarn dev`, it won't be used with `yarn dev:pure`.