Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ body:
required: false
- type: textarea
attributes:
label: Environment
label: Environment (if applicable)
description: |
examples:
- **OS**: iOS
- **Browser**: Chrome
- **Python version**: 3.12
- **Software versions**: [release/branch/commit]
Provide details about your environment to help us reproduce the issue.

**For all users:**
- **OS**: The operating system you're using (e.g., Windows, macOS, Linux, iOS, Android)
- **Browser**: The browser you're using (e.g., Chrome 124, Safari 17, Firefox 123)

**For developers contributing to this project** (optional):
- **Python version**: The Python version running the server (e.g., 3.12)
- **Software versions**: The release, branch, or commit you're running (e.g., main, v0.1.0)
value: |
- OS:
- Browser:
- Python version:
- Software versions:
- **OS**:
- **Browser**:
- **Python version** (developers only):
- **Software versions** (developers only):
render: markdown
validations:
required: false
Expand Down
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature request
description: Suggest an idea for this project
title: '[FEATURE] <title>'
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if a similar feature request already exists.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: false
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context, screenshots, or references about the feature request here.
validations:
required: false
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/technical_work.md

This file was deleted.

29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/technical_work.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Technical work
description: Technical work that needs to be done to complete work on a (large) user story or feature
title: '[TECHNICAL] <title>'
labels: [technical]
body:
- type: textarea
attributes:
label: Related user story or feature
description: Links to the user story or feature issue this technical work is related to.
validations:
required: false
- type: textarea
attributes:
label: Description
description: A clear and concise description of what you plan to do in this technical work and why it's needed.
validations:
required: false
- type: textarea
attributes:
label: Implementation approach (if known)
description: Optional. Describe your planned approach to solving this technical work.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context, diagrams, or references about the technical work here.
validations:
required: false
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
hooks:
- id: codespell
args: [-I, .codespell_ignore.txt]
exclude: ^main/static/assets/|^package-lock.json$
exclude: ^main/static/assets/|^package-lock.json$|^direct_webapp/fixtures/framework-2-0.json$
- repo: https://github.com/djlint/djLint
rev: v1.36.4
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r prod-requirements.txt

COPY --chown=nobody:nogroup . .

Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ This Django project uses:

## Installation

You must have **Python version 3.12 or later** installed.

To get started:

1. Create and activate a [virtual environment](https://docs.python.org/3/library/venv.html):
Expand Down Expand Up @@ -63,7 +65,19 @@ To get started:
pre-commit install
```

5. Run the webapp:
5. 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`

6. Run the webapp:

```bash
python manage.py runserver
Expand All @@ -81,22 +95,22 @@ To get started:

then restart it.

6. Run the tests:
7. Run the tests:

```bash
pytest
```

7. Create an admin account to access admin backend:
8. Create an admin account to access admin backend:

```bash
python manage.py createsuperuser
```

8. To populate the db with Categories and Skills from a yaml or json version of the framework
9. 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 -m scripts.populate_db [-j data.json]|[-y data.yaml]
python manage.py loaddata direct_webapp/fixtures/framework-2-0.json
```

### Installation with Docker
Expand Down
4 changes: 1 addition & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --extra=dev --output-file=dev-requirements.txt
Expand Down Expand Up @@ -102,8 +102,6 @@ mypy==1.20.0
# django-stubs
mypy-extensions==1.1.0
# via mypy
mysqlclient==2.2.8
# via direct_webapp (pyproject.toml)
nh3==0.3.4
# via direct_webapp (pyproject.toml)
nodeenv==1.10.0
Expand Down
25 changes: 25 additions & 0 deletions direct_webapp/fixtures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Fixtures

This folder contains Django [fixtures](https://docs.djangoproject.com/en/6.0/topics/db/fixtures/#fixtures-explanation) - files that contain the serialized contents of the database. These can be used to quickly load data into a freshly initialised database (in development or in production).

## Creating / updating the fixtures

The fixtures were originally created by the following process:

1. manually gather the CSV files from <https://github.com/direct-framework/digital-research-competencies-framework/tree/main/framework>
2. load each CSV into a fresh dev database through the Django admin interface. Ordering is important as some tables reference others:
1. competency domains
1. competencies
1. providers
1. learning resources
1. skill levels
1. tools, languages, and methodologies
1. skills
3. on the command line, "dump" the data to json in fixture format: `python manage.py dumpdata -o direct_webapp/fixtures/data.json main --exclude main.user`
* `-o` sets the output location to `direct_webapp/fixtures/data.json`
* `main` selects the app to export
* `--exclude` selects models to exclude from the export (in this case the user table)

The fixtures can then be loaded in a fresh database with `python manage.py loaddata direct_webapp/fixtures/framework-2-0.json`.

The process can be repeated to update the fixtures. In future a script could be developed to automate updating the fixture when the framework is updated, if we decide to keep them in sync.
Loading
Loading