Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Latest commit

 

History

History
112 lines (99 loc) · 3.41 KB

README.md

File metadata and controls

112 lines (99 loc) · 3.41 KB

CityWok Manager

Tests codecov license Uptime Robot status Code style: black

Introduction

A website base management system for a restaurante.

Usage

Prepare

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

Install

$ 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

Launch

$ flask run

Test

# Test all files
$ python -m pytest

# Test with output
$ python -m pytest -s

# Test with coverage report
$ python -m pytest --cov-report term-missing

Database Migration

Commands provided by flask-migrate

# Generate a migration
flask db migrate
# Apply the migration to the database
flask db upgrade

Utils

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

Tools

References

Changelog

Here

License

MIT