This is built with Flask, Flask-RESTful, MongoDB, Redis and MySql
- step 1 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- step 2 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
-
step 3 restart the computer
-
step 4 (Download the Linux kernel update package): https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
-
step 5 (PowerShell Admin):
wsl --set-default-version 2
- step 6 (Install Docker): https://docs.docker.com/docker-for-windows/install/
- Into the local repository folder, run:
python3 -m venv venv
- After activate the Python venv
source venv/Scripts/activate
- Update pip package
python3 -m pip install -U pip
- Installing the Python project's dependency packages
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- If new or updated dependency package was added in the project structure, the requirements.txt must be updated
pip freeze > requirements.txt
- You will need to declare the database connection information in the config_app.py and mongo_serve in folder db file before running the application.
- The Flask app will be online in the port 5000
- The Redis Caching will be online in the port 6379 (details in docker-compose.yml file)
- The MSSQL Database will be online in the port 1433
- Start Redis with Docker:
# In the project root folder
cd docker
docker-compose up --force-recreate -d ; docker-compose logs -f
To stop docker:
docker stop
- Open the "flaskr" folder in console with following command:
cd ../flaskr
- If you want to run in development mode, run these commands in folder flaskr:
export FLASK_ENV=development
export FLASK_APP=app.py
export FLASK_DEBUG=1
- And finally execute:
flask run