py -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
FLASK_APP=app
FLASK_DEBUG=True
FLASK_RUN_PORT=5050
FLASK_RUN_HOST=0.0.0.0
# For Remote PostgreSQL Database : postgresql://username:password@hostname:port/database_name
SQLALCHEMY_DATABASE_URI=POSTGRESQL_REMOTE_URL
JWT_SECRET_KEY = SELECTED_SECRET_KEY
IMAGE_UPLOAD_FOLDER= PATH
TESSERACT_CMD = PATH
FLASK_SECRET_KEY = SELECTED_FLASK_SECRET_KEY
# For Different Databases
# For local SQLite Database
# SQLALCHEMY_DATABASE_URI=sqlite:///db.sqlite3
# For local MySQL Database
# SQLALCHEMY_DATABASE_URI=mysql://root:@localhost/flask
# For Remote MySQL Database
# SQLALCHEMY_DATABASE_URI=MYSQL_FREEDATABASE_URL
# For local PostgreSQL Database
# SQLALCHEMY_DATABASE_URI=POSTGRESQL_LOCAL_URL
Database | Pip |
---|---|
PostgreSQL | pip install psycopg2 or pip install psycopg2-binary |
MySQL | pip install mysqlclient |
flask shell
from app import db
db.create_all()
flask db init
flask db migrate -m "message"
flask db upgrade
flask --app script_file_name run
or
py script_file_name.py
Gautam Lathiya 💻 |
Sandip Kanzariya 💻 |
Prit Monpara 💻 |