- If using mysql as a database, login as a root like:
mysql -u root -p
CREATE DATABASE <database-name>;
quit;
Set DATABASE_URL as environmental variable. DATABASE_URL should have the following format:
DATABASE_URL=mysql+pymysql://<database-name>:<database-password>@localhost/<database-name>
- Create virtual environment
virtualenv -p python3 flask
- Enter virtual environment
. flask/bin/activate
- Install requirements
pip install -r requirements.txt
pip install pymysql
- Create databse and make first migration (on the last line in the file init.py in the app/ folder delete views module, fix pending)
python manage.py db init
pyhton manage.py db migrate
python manage.py db upgrade
return views module in init.py
- Using create_user.py script create users like:
python create_user.py <username> <password>
-
Start apache or whatever server
-
Enjoy :)