Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabicavalcante/flask-secret-santa
https://github.com/gabicavalcante/flask-secret-santa
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gabicavalcante/flask-secret-santa
- Owner: gabicavalcante
- Created: 2020-02-02T21:51:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T21:20:10.000Z (over 1 year ago)
- Last Synced: 2024-08-01T22:55:25.026Z (3 months ago)
- Language: Python
- Size: 78.1 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flask secret santa
This is a simple python bot to create a Secret Santa and send a text message to the participants.
### python code formartter
- [`black`](https://github.com/psf/black)
- [`flake8`](http://flake8.pycqa.org/en/latest/)### libs
- config: [`dynaconf`](https://dynaconf.readthedocs.io/en/latest/)
- log: [`logging`](https://flask.palletsprojects.com/en/1.0.x/logging/)
- db: [`flask_sqlalchemy`](https://flask-sqlalchemy.palletsprojects.com/en/2.x/) and [`flask_migrate`](https://flask-migrate.readthedocs.io/en/latest/)## setup
### create and configure .secrets.toml
```
$ cp .secrets.toml.sample .secrets.toml
```### configure the .settings.toml
Open the .settings.toml file and check all variables. See if you want change any thing. I set the `SQLALCHEMY_DATABASE_URI` to connect with the mysql credentials that I defined in docker-compose file. If you change one of these files, remenber to change other.
## flask run
#### virtualenv
```
# virtualenv
$ virtualenv -p python3 env
$ source env/bin/activate
# pyenv
$ pyenv virtualenv 3.7.4 secretsanta
$ pyenv activate secretsanta
```#### install requirements
```
$ cd secretsanta
$ pip install -r requirements.txt
```#### migrate
```
$ flask db init
$ flask db migrate
$ flask db upgrade
```#### run
```
$ flask run
```### docker-compose
You can run the app using the docker-compose file.
```
$ docker-compose up --build
```To test, run `ngrok` to expose your local server:
```
$ ./ngrok http 5000
ngrok by @inconshreveableSession Status online
Session Expires 7 hours, 59 minutes
Version 2.3.35
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://732498a9.ngrok.io -> http://localhost:5000
Forwarding https://732498a9.ngrok.io -> http://localhost:5000
```