Skip to content

Flask Structure with mysql connection and with simple api

Notifications You must be signed in to change notification settings

sagarsalvi2011/FlaskTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Applications

Flask Applications

Steps to Install

  1. Install the dependencies.

sudo apt-get install libmysqlclient-dev -y sudo apt-get install python-dev -y pip install --ignore-installed -r requirements.txt

  1. Set up MySQL.

sudo apt-get install mysql-server (Enter the password when prompted)

  1. Check the status of the service. It should be running.

service mysql status

  1. Log in to MySQL and create a database named deployment.

mysql -u root -p"" create database demo;

  1. Create Virtual Env if it is not created virtualenv venv

  2. activate Virtual Env source venv/bin/activate

  3. Install the requirement.txt pip install --ignore-installed -r requirements.txt

  4. Export environment variables.

export DB_HOST="127.0.0.1" export DB_USER="root" export DB_PASS=""

  1. Set up database.

python db.py db init python db.py db migrate python db.py db upgrade python db.py seed

  1. Run the application.

python run.py

  1. Go to the postman and test signup api which is given for test URL : http://localhost/ums/api/v1/users POST : { "email":"sagarsalvi2011@gmail.com", "password":"Opcito@123"

} Response : { "data": "", "message": "Your account has been successfully registered" }

About

Flask Structure with mysql connection and with simple api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages