This project is the repository for the LMS application.
Make sure you have docker running locally, otherwise download the desktop application from the docker website.
Create the config file:
cp .env.example .env
Spin up compose:
docker compose up
Create a launch.json file inside .vscode if you want hot-reload and debugging:
{
"version": "0.2.0",
"configurations": [
{
"name": "Flask via Docker",
"type": "python",
"request": "attach",
"port": 5678,
"host": "0.0.0.0",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
}
]
}
Run the tests:
docker exec -it lms python3 -m pytest -v
Launch the CLI App: By default, we create a admin user for ease of use, (username: admin, password: admin)
docker exec -it lms python3 cli.py
You're good to go 🎉
You can now select Flask via Docker in the Run And Debug tab and start debugging away 🤗
Stop docker-compose:
docker-compose down -v --remove-orphans
Make sure you have python 3.11 installed and running on your computer, otherwise download the latest version either via pyenv or via the python website
Click here and follow step 2, 3 and 4
Install python (we currently run 3.11.6) and make it your default version:
pyenv install 3.11.6
pyenv global 3.11.6
Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate
Install the python requirements:
python3 -m pip install -r requirements.txt -r tests/requirements.txt
You should now be able to run the app locally:
Visual Studio Code configuration
Create a new launch.json
inside .vscode
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "lms/app.py",
"FLASK_ENV": "development",
"DEBUG": "1"
},
"args": [
"run",
"--port=5002"
],
"jinja": true
}
]
}
You'll then be able to start the application via the debugger
The app should be running on http://127.0.0.1:5002