Note: The Mysql db is used by default for models unless other db is specified using __bind_key__ attribute.
pip3 install -e .
N.B. 1. You may install it inside venv or system-wide, that's your choice.
-
First export/set DATABASE_URL variable in your environment. Example command is given in next step. Don't copy paste given secret key. Create your own.
-
cdinto repo. Then, depending on your OS-
For Linux, use command
export DATABASE_URL_POSTGRESQL="postgresql://user:pass@localhost/dbname" export DATABASE_URL_MYSQL="mysql://user:pass@localhost:3306/dbname" export SECRET_KEY="3faf6054f65d7feb7c76f995fb940808" FLASK_APP=multidbapp FLASK_ENV=development flask run -
For Windows - CMD, use
set DATABASE_URL_POSTGRESQL="postgresql://user:pass@localhost/dbname" set DATABASE_URL_MYSQL="mysql://user:pass@localhost:3306/dbname" set SECRET_KEY="3faf6054f65d7feb7c76f995fb940808" set FLASK_APP=multidbapp set FLASK_ENV=development flask run -
For Windows - PS, use
$env:DATABASE_URL_POSTGRESQL="postgresql://user:pass@localhost/dbname" $env:DATABASE_URL_MYSQL="mysql://user:pass@localhost:3306/dbname" $env:SECRET_KEY="3faf6054f65d7feb7c76f995fb940808" $env:FLASK_APP=multidbapp $env:FLASK_ENV=development flask run
-
-
That's all!
-
In MySQL DB:
CREATE TABLE faculty ( id smallint(6) NOT NULL AUTO_INCREMENT, name varchar(50) NOT NULL, isAdmin boolean, CONSTRAINT fac_pkey_constraint PRIMARY KEY (id)) ENGINE=InnoDB; -
In PostgreSQL DB:
CREATE TABLE student ( id smallserial NOT NULL, name varchar(50) NOT NULL, semester smallint NOT NULL, roll_number varchar(15) NOT NULL UNIQUE, CONSTRAINT stud_pkey_constraint PRIMARY KEY (id)); -
Then insert some data into the above tables.
-
Python Language Server (
pyls) withflake8 -
Stylelint (for html)
-
Install them on your favourite text editor.
Vim,Sublime Text,Atom,VS Codeand many more are supported. -
The linters should automatically pick up the configuration file(s) present in the root directory. If not, create an issue, let's find out why?