Skip to main content

Python, Flask, Sqlalchemy, Marshmallow, Postgresql Step by Step



Postgresql

pip install pipenv

go inside the environment

pipenv shell

pip install -r requirements.txt

#setup environment variables
#Windows


set FLASK_ENV=development
set DATABASE_URL=postgresql://postgres:test@localhost/PythonStarterDB
set DATABASE_TEST_URL=postgresql://postgres:test@localhost/PythonStarterDBTest
set FLASK_APP=run

#Run the app
flask run

#Run unit tests
python test_users.py

MY SQL
pip install pipenv

pipenv shell

pip install -r requirements.txt


set FLASK_ENV=development
set DATABASE_URL=mysql+pymysql://root:test@localhost/PythonStarterDB
set DATABASE_TEST_URL=mysql+pymysql://root:test@localhost/PythonStarterDBTest
set FLASK_APP=run.py

#Run the app
flask run

#Run unit tests
python test_users.py


Mongo DB

pip install pipenv

pipenv shell


pip install -r requirements.txt

set FLASK_ENV=development
set DATABASE_URL=mongodb://localhost:27017/StarterPacksDB
set DATABASE_TEST_URL=mongodb://localhost:27017/StarterPacksDBTest
set FLASK_APP=run.py

#Run the app
flask run

#Run unit tests
python test_users.py




Comments