A website base management system for a restaurante.
Create a .env
file under root directory with following context
SECRET_KEY=...
ADMIN_NAME=...
ADMIN_EMAIL=...
ADMIN_PASSWORD=...
MAIL_USERNAME=...
MAIL_PASSWORD=...
DATABASE_URL=...
Change the FLASK_ENV
in .flaskenv
in production
...
FLASK_ENV=production
$ sudo apt install ghostscript redis-server
# Upgrade pip
$ python -m pip install --upgrade pip
# Install libraries
$ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
$ flask run
# Test all files
$ python -m pytest
# Test with output
$ python -m pytest -s
# Test with coverage report
$ python -m pytest --cov-report term-missing
Commands provided by flask-migrate
# Generate a migration
flask db migrate
# Apply the migration to the database
flask db upgrade
Some utils commands created using click
# Create the database
$ flask dev create
# Load some example data
$ flask dev load_example
# Drop the database and filse
$ flask dev drop
# Add a new user
$ flask dev add_user USERNAME EMAIL PASSWORD ROLE [CONFIRMED]
# Initialize translation file for a language
$ flask i18n init LANG
# Update the translation file
$ flask i18n update
# Compile the translation file
$ flask i18n compile
- Flask
- Flask-SQLAlchemy
- SQLAlchemy
- SQLite3
- SQLAlchemy-Utils
- Flask-Migrate
- Flask-Babel
- Flask-Login
- Flask-Principal
- Flask-WTF
- WTForms
- Flask-Mail
- Flask-Moment
- Click
- Pytest
- Pytest-Mock
- Pytest-Cov
- Pytest-flask
- Sentry.io
- Miguel Grinberg's The Flask Mega-Tutorial
- Corey Schafer's Python Flask Tutorial