Added production settings and support for secret values from env variables (#118)

* Added Django-environ support and Production settings

* Option to set db settings in both ways

* Added setuptools in req.txt

* Minor bug fix

---------

Co-authored-by: Horilla <131998600+horilla-opensource@users.noreply.github.com>
This commit is contained in:
Ashwanth Balakrishnan
2024-03-19 14:14:43 +05:30
committed by GitHub
parent cfe96a5cae
commit c514599c8a
3 changed files with 91 additions and 16 deletions

41
.env.dist Normal file
View File

@@ -0,0 +1,41 @@
# Set "DEBUG=False" for production
DEBUG=True
# Get a secure secret key from https://djecrety.ir
SECRET_KEY=django-insecure-j8op9)1q8$1&0^s&p*_0%d#pr@w9qj@1o=3#@d=a(^@9@zd@%j
# Don't use "*" for ALLOWED_HOSTS in production
ALLOWED_HOSTS=www.example.com,example.com,*
# Database URL
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
# ----OR----
# Database Configuration
DB_ENGINE=django.db.backends.postgresql
DB_NAME=dbname
DB_USER=user
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
# Supportted Formats for DATABASE_URL :
# PostgreSQL: ``postgres[ql]?://`` or ``p[g]?sql://``
# PostGIS: ``postgis://``
# MySQL: ``mysql://`` or ``mysql2://``
# MySQL (GIS): ``mysqlgis://``
# MySQL Connector Python from Oracle: ``mysql-connector://``
# SQLite: ``sqlite://``
# SQLite with SpatiaLite for GeoDjango: ``spatialite://``
# Oracle: ``oracle://``
# Microsoft SQL Server: ``mssql://``
# PyODBC: ``pyodbc://``
# Amazon Redshift: ``redshift://``
# LDAP: ``ldap://``