-
Windows
-
Linux
- Install MySQL or PostgreSQL (10+) and follow GUI instructions
- Install Python3.7 and follow GUI instructions
- Create user and database
- Create .env file inside the project folder and add the following:
SQLALCHEMY_TRACK_MODIFICATIONS=1
SECRET_KEY=28419842198412894
SQL_USERNAME=database_username
SQL_PASSWORD=database_username_password
SQL_DATABASE=database_name
SQL_CHARSET=utf8mb4
SQL_PORT=database_port
SQL_DRIVER=mysql+pymysql
OR
SQL_DRIVER=postgresql+psycopg2
Depending on which database you chose to install.
(Point the system path to MySQL or PostgreSQL executable)
-
Create database via CLI
- MySQL
mysql -h localhost -u username -p
CREATE DATABASE database_name;
quit;
- PostgreSQL
psql -U postgres -c "CREATE ROLE database_user WITH ENCRYPTED PASSWORD 'password';"
psql -U postgres -c "CREATE DATABASE database_name;"
- MySQL
-
Windows
git clone https://github.com/digipointtku/viuhka-flask.git
cd viuhka-flask
python -m venv env
call env/scripts/activate
pip install -r requirements.txt
python main.py --create
python main.py --createsuperuser
python main.py --import
python main.py
-
Linux
$ git clone https://github.com/digipointtku/viuhka-flask.git
$ cd viuhka-flask
$ python3 -m venv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ python main.py --create
$ python main.py --createsuperuser
$ python main.py --import
$ python main.py
-
Windows
call env/scripts/activate
python main.py
-
Linux
$ source env/bin/activate
$ python main.py