DIRECT Framework Webapp¤
A Django webapp implementing the DIRECT competencies framework as a website that can:
- Allow browsing of all the skills.
- Allow people to score their own skills and view their skill wheels.
- Display and link the professional development resources curated for each skill.
This Django project uses:
- [
pip-tools] for packaging and dependency management. pre-commitfor various linting, formatting and static type checking. Pre-commit hooks are automatically kept updated with pre-commit.ci.pytestand GitHub Actions.
[pip-tools] is chosen as a lightweight dependency manager that adheres to the latest standards using pyproject.toml.
Related links¤
- DIRECT framework
- History of the project - including competency wheels UI
- Skills and competencies - definitions
- Contributors
Current Status¤
- [x] Initial research
- [x] Initial development <-- We are here
- [x] Minimum viable product
- [x] Alpha release
- [ ] Feature-complete release
Installation¤
You must have Python version 3.12 or later installed.
To get started:
- Create and activate a virtual environment:
bash
python -m venv .venv
source .venv/bin/activate # with Powershell on Windows: `.venv\Scripts\Activate.ps1`
- Install development requirements:
bash
pip install -r dev-requirements.txt
- (Optionally) install tools for building documentation:
bash
pip install -r doc-requirements.txt
- Install the git hooks:
bash
pre-commit install
- First-time database setup:
Before running the server for the first time, initialise the database tables as follows:
bash
python manage.py migrate
If you run into the following error, then you've missed this step:
django.db.utils.OperationalError: no such table: main_skilllevel
- Run the webapp:
bash
python manage.py runserver
When running the webapp for the first time you may get a warning similar to:
You have 19 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, main, sessions.
If this is the case, stop your webapp (with CONTROL-C) and apply the migrations with:
bash
python manage.py migrate
then restart it.
- Run the tests:
bash
pytest
- Create an admin account to access admin backend:
bash
python manage.py createsuperuser
- Populate the database using a snapshot of v2.0 of the framework (this is not necessarily the latest live version, so this is only used for development).
bash
python manage.py loaddata direct_webapp/fixtures/framework-2-0.json
Installation with Docker¤
The app can be run within a Docker container and a docker-compose.yml file is provided
to make this easy for development.
Requirements:
- You have a modern version of Docker installed.
- You have a JSON version of the framework saved at
data/skills-competencies-framework.json.
To launch the server run:
docker compose up
The app will be available at http://127.0.0.1:8000/
As above, create a superuser with
docker compose exec app python manage.py createsuperuser
The framework should be automatically loaded into the database.
Updating Dependencies¤
To add or remove dependencies:
- Edit the
dependenciesvariables in thepyproject.tomlfile (aim to keep development tools separate from the project requirements). - Update the requirements files:
pip-compileforrequirements.txt- the project requirements.pip-compile --extra dev -o dev-requirements.txtfor the development requirements.pip-compile --extra doc -o doc-requirements.txtfor the documentation tools.- Sync the files with your installation (install packages):
pip-sync *requirements.txt
To upgrade pinned versions, use the --upgrade flag with pip-compile.
Versions can be restricted from updating within the pyproject.toml using standard python package version specifiers, i.e. "black<23" or "pip-tools!=6.12.2"
Frontend Node¤
This project includes an NPM-based setup for managing front-end assets like styles, scripts, and other resources. The package.json file contains predefined scripts to help with building and managing assets. You don't need to run these NPM commands if you are developing the Django app locally. You should only run these commands when needed, for example if you are changing javascript dependencies or modifying SCSS files.
See Frontend Node for details on working with the NPM-based frontend asset pipeline.
Acknowledgements¤
This work was supported by the DisCouRSE Network+, which received funding through the UKRI Digital Research Infrastructure Programme