Browse Source

Env variables:

We want to allow the admin to choose wether the users can signin in by 
themselves, or if only the admin can do it. We will later implement it 
in the python code

Here we have to modify
- docker-compose.yml : add the env ALLOW_SIGNUP 
Note: I am not sure if it's True or "True"
Note: we could have put it inside the Dockerfile instead of 
docker-compose, it doesn't matter.

- settings.py : Here we make the env variable available to the python 
app

- app.json : that's for the heroku deployment. we simply describe to 
heroku that we have an env variable
pull/250/head
Guillim 5 years ago
parent
commit
d7ccf5789a
3 changed files with 9 additions and 0 deletions
  1. 5
      app.json
  2. 3
      app/app/settings.py
  3. 1
      docker-compose.yml

5
app.json

@ -29,6 +29,11 @@
"description": "Debug mode or not.", "description": "Debug mode or not.",
"required": false, "required": false,
"value": "False" "value": "False"
},
"ALLOW_SIGNUP": {
"description": "Allow users to signup themselves or not",
"required": false,
"value": "True"
} }
}, },
"scripts": { "scripts": {

3
app/app/settings.py

@ -35,6 +35,9 @@ SECRET_KEY = env('SECRET_KEY',
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.bool('DEBUG', True) DEBUG = env.bool('DEBUG', True)
# True if you want to allow users to be able to create an account
ALLOW_SIGNUP = env.bool('ALLOW_SIGNUP', True)
# ALLOWED_HOSTS = [] # ALLOWED_HOSTS = []

1
docker-compose.yml

@ -12,6 +12,7 @@ services:
ADMIN_PASSWORD: "password" ADMIN_PASSWORD: "password"
ADMIN_EMAIL: "admin@example.com" ADMIN_EMAIL: "admin@example.com"
DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable" DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable"
ALLOW_SIGNUP: "True"
ports: ports:
- 8000:8000 - 8000:8000

Loading…
Cancel
Save