Skip to content

SahilSK202/akatsuki-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

akatsuki-backend

Project setup

1. Create a virtual environment in your project directory called env

Open a shell and run the following command

python -m venv venv

This will create a virtual environment called 'venv' in your project directory

2. Create a .env file and add the following environment variables

  • SECRET_KEY

3. Create a .flaskenv file and add the following environment variables

  • FLASK_DEBUG
  • FLASK_APP
  • SQLALCHEMY_DATABASE_URI

Start the application server

In the root of your project directory, run the following command

flask run

Inserting Records in DB

Run flask shell

python -m flask shell

Import the db istance in shell environment

from src.database import db

Import Model in shell environment

from src.models.<ModelName> import <Model>

Add records

record=ModelConstructor(id=1, ...)

Add the records to the session and then commit the session

db.session.add(record)
db.session.commit()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 99.9%
  • Procfile 0.1%