Commit b4cc4f1e authored by totte's avatar totte
Browse files

Update settings to allow for easier local development

parent 39b9653f
# Local development
# Development
## Using the Django development server
- File
- Settings
- Build, Execution, Deployment
- Console
- Python Console
- DEBUG=true
- SECRET_KEY=somethinglong
- ALLOWED_HOSTS=127.0.0.1,localhost
- Django Console
- DEBUG=true
- SECRET_KEY=somethinglong
- ALLOWED_HOSTS=127.0.0.1,localhost
- Run
- Edit Configurations
- Django server
- DEBUG=true
- SECRET_KEY=somethinglong
- ALLOWED_HOSTS=127.0.0.1,localhost
## Using Docker
- Run
- Edit Configurations
- Docker
- `./docker-compose.override.yml; ./docker-compose.yml;`
`.env` file required
# Deployment
## Staging
`.env` file required
## Production
`.env` file required
......@@ -5,5 +5,9 @@ services:
image: $TEST_IMAGE
command: sh -c "coverage run --source='.' manage.py test $CI_PROJECT_NAME && coverage report"
environment:
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_PASSWORD
- POSTGRES_PORT
- POSTGRES_USER
- SECRET_KEY
......@@ -28,11 +28,12 @@ services:
environment:
- ALLOWED_HOSTS
- DEBUG
- SECRET_KEY
- POSTGRES_HOST
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_PASSWORD
- POSTGRES_PORT
- POSTGRES_USER
- SECRET_KEY
nginx:
image: nginx:1.15.9-alpine
......
......@@ -77,12 +77,12 @@ WSGI_APPLICATION = 'melange.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('POSTGRES_DB', 'postgres'),
'USER': os.environ.get('POSTGRES_USER', 'postgres'),
'ENGINE': os.environ.get('ENGINE', 'django.db.backends.sqlite3'),
'NAME': os.environ.get('POSTGRES_DB', os.path.join(BASE_DIR, 'db.sqlite3')),
'USER': os.environ.get('POSTGRES_USER', ''),
'PASSWORD': os.environ.get('POSTGRES_PASSWORD', ''),
'HOST': os.environ.get('POSTGRES_HOST', 'postgres'),
'PORT': 5432
'HOST': os.environ.get('POSTGRES_HOST', ''),
'PORT': os.environ.get('POSTGRES_PORT', ''),
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment