Skip to content

Commit d7ccf57

Browse files
author
Guillim
committed
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
1 parent e1e82a0 commit d7ccf57

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

app.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
"description": "Debug mode or not.",
3030
"required": false,
3131
"value": "False"
32+
},
33+
"ALLOW_SIGNUP": {
34+
"description": "Allow users to signup themselves or not",
35+
"required": false,
36+
"value": "True"
3237
}
3338
},
3439
"scripts": {

app/app/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
# SECURITY WARNING: don't run with debug turned on in production!
3636
DEBUG = env.bool('DEBUG', True)
3737

38+
# True if you want to allow users to be able to create an account
39+
ALLOW_SIGNUP = env.bool('ALLOW_SIGNUP', True)
40+
3841
# ALLOWED_HOSTS = []
3942

4043

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
ADMIN_PASSWORD: "password"
1313
ADMIN_EMAIL: "[email protected]"
1414
DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable"
15+
ALLOW_SIGNUP: "True"
1516
ports:
1617
- 8000:8000
1718

0 commit comments

Comments
 (0)