# Flask variables | # Flask variables | ||||
FLASK_APP=app | FLASK_APP=app | ||||
FLASK_RUN_HOST=0.0.0.0 | FLASK_RUN_HOST=0.0.0.0 | ||||
FLASK_ENV=development | |||||
FLASK_DEBUG= | |||||
SECRET_KEY= | SECRET_KEY= | ||||
DATABASE_URL=sqlite:///db.sqlite | DATABASE_URL=sqlite:///db.sqlite | ||||
For creating database and user in production: | For creating database and user in production: | ||||
`docker-compose exec -it db mysql -u root -p` | |||||
`CREATE DATABASE toolkit;` | `CREATE DATABASE toolkit;` | ||||
`CREATE USER 'flask'@'%' IDENTIFIED BY '[PASSWORD]';` | `CREATE USER 'flask'@'%' IDENTIFIED BY '[PASSWORD]';` | ||||
`GRANT CREATE, INSERT, UPDATE, SELECT, DELETE ON toolkit.* TO 'flask'@'%';` | `GRANT CREATE, INSERT, UPDATE, SELECT, DELETE ON toolkit.* TO 'flask'@'%';` |
# if the above check passes, then we know the user has the right credentials | # if the above check passes, then we know the user has the right credentials | ||||
login_user(user, remember=remember) | login_user(user, remember=remember) | ||||
flash(url_for('main.profile',_external=True)) | |||||
return redirect(url_for('main.profile',_external=True)) | return redirect(url_for('main.profile',_external=True)) | ||||
# routes for signup page | # routes for signup page |