Skip to content

web-pal/flask-rest-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-rest-boilerplate

##Setup Instll packages:

$ pip install -r requirements.txt

##Configuration

Config file

Path to the config file stores in environment variable "FLASK_REST_BOILERPLATE_SETTINGS"

$ export FLASK_REST_BOILERPLATE_SETTINGS =/path_to_project/flask-rest-boilerplate/settings/developers_name.py

Sample with export env variable using postactivate script:

$ cat ~/.Envs/pdl/bin/postactivate
#!/bin/zsh

export FLASK_REST_BOILERPLATE_SETTINGS=/path_to_project/flask-rest-boilerplate/settings/developers_name.py
cd /path_to_project/

###Database Creating database and user in PostgreSQL:

CREATE DATABASE db_name;
CREATE USER user_name WITH password ‘password‘;
GRANT ALL ON DATABASE db_name TO user_name;

###Database migrations For migrations ise alembic with flask-migrate
Link to documentation - flask-migrate.readthedocs.org

Run migration

$ python app.py db upgrade

Creating migration's file(run only after creating new models or changing old)

$ python app.py db migrate

Run dev server

$ python app.py runserver

##Создание кастомных команд ##Creating custom commands http://flask-script.readthedocs.org
Current custom commands:

$ python app.py add_user
$ python app.py change_expire_user
$ python app.py change_password

##Debug using konch Run konch console:

$ konch

https://github.com/sloria/konch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published