Skip to content

vasyagladush/wifi-controller-interface-backend

Repository files navigation

WiFi Controller Interface Backend

Requirements:

  • python >= 3.10.* and pip

Setting up

  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the created venv:
  • Linux/Mac command: source venv/bin/activate
  • Windows Command: .\venv\Scripts\activate
  1. Install dependencies (inside the venv from now on):
pip install -r requirements.txt
  1. Create a database.sqlite file (if using SQLite file)

Linux/Mac:

touch database.sqlite

Windows:

type NUL > database.sqlite
  1. Create a .env file
cp .env.sample .env
  1. Install pre-commit hooks:
pre-commit install
  1. Start the application:
invoke start

Next app starts

Traditional way:

  1. Activate venv
  • Linux/Mac command: source venv/bin/activate
  • Windows Command: .\venv\Scripts\activate
  1. Start the application:
invoke start

Alternative way:

Windows (requires PowerShell):

.\run

Note regarding alternative Windows start: App may not close with the terminal - make sure to terminate the app (CTRL + C) before closing terminal.

Migrations

  • add new models' imports to the end of the models module file so that Alembic detects that new tables have to be created, like:
from models.user import User
  • Generate a migration:
invoke migrationsGenerate --message=your_message_here
// or, if it throws an error on your machine (Windows especially),
// try using the direct alembic command:
alembic revision --autogenerate -m "your_message_here"
  • Run migrations:
invoke migrationsRun
// or
alembic upgrade head
  • Revert the last migration:
invoke migrationsRevert
// or
alembic downgrade -1

Sources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages