You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aebebd4
Browse filesBrowse the repository at this point in the historyBrowse files
docs: add prek installation and hook setup to every setup guide
List uv and prek as prerequisites (pinned in mise.toml) and add the
`uv sync --all-groups && prek install` step to the Docker and local setup
guides in README.md, CONTRIBUTING.md and DEVELOPMENT.md: the hooks run on
the host even when developing with Docker. README.md gets a Git Hooks
section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+44-17Lines changed: 44 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,49 +4,55 @@ Website for Python Ireland (python.ie / pycon.ie) community, built with Django 6
4
4
5
5
## Prerequisites
6
6
7
-
- Python 3.13 (see `mise.toml`)
7
+
- Python 3.13, [uv](https://docs.astral.sh/uv/) and [prek](https://github.com/j178/prek) (git hooks), all pinned in `mise.toml`: run `mise install`, or see [Git Hooks](#git-hooks-prek) for other ways to install prek
8
8
- Docker & Docker Compose (for containerized development - recommended)
9
9
-[Task](https://taskfile.dev/) (optional but recommended)
10
10
- Redis (only for local non-Docker development)
11
11
- Environment variables file as per [the instructions here](#environment-variables)
12
12
13
13
## Quick Start (Docker - Recommended)
14
14
15
-
1. Build the Docker image:
15
+
1. Install the git hooks (the ruff and Django hooks run on the host through `uv run`):
16
+
```bash
17
+
uv sync --all-groups
18
+
prek install
19
+
```
20
+
21
+
2. Build the Docker image:
16
22
```bash
17
23
task docker:build
18
24
# or: make docker-build
19
25
```
20
26
21
-
2. Start supporting services:
27
+
3. Start supporting services:
22
28
```bash
23
29
docker compose up -d postgres redis minio
24
30
```
25
31
26
-
3. Run database migrations:
32
+
4. Run database migrations:
27
33
```bash
28
34
task django:migrate
29
35
```
30
36
31
-
4. Generate sample data (creates pages, navigation, meetups):
37
+
5. Generate sample data (creates pages, navigation, meetups):
32
38
```bash
33
39
task django:generate-sample-data
34
40
# or: docker compose run --rm web python pythonie/manage.py generate_sample_data --settings=pythonie.settings.dev
35
41
```
36
42
37
-
5. Create a superuser:
43
+
6. Create a superuser:
38
44
```bash
39
45
docker compose run --rm web python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev
40
46
```
41
47
42
-
6. Start the development server:
48
+
7. Start the development server:
43
49
```bash
44
50
task run
45
51
# or: docker compose run --rm --service-ports web python pythonie/manage.py runserver 0.0.0.0:8000
46
52
```
47
53
48
-
7. Visit http://127.0.0.1:8000/ to see the site with sample content
49
-
8. Access Wagtail admin at http://127.0.0.1:8000/admin/
54
+
8. Visit http://127.0.0.1:8000/ to see the site with sample content
55
+
9. Access Wagtail admin at http://127.0.0.1:8000/admin/
50
56
51
57
## Local Setup (Without Docker)
52
58
@@ -56,14 +62,15 @@ If you prefer to develop without Docker:
56
62
2. Clone your fork: `git clone git@github.com:YourGitHubName/website.git`
57
63
3. Ensure you are running Python 3.13: `python -V` should output `Python 3.13.x`
58
64
4. Install dependencies: `uv sync --all-groups` (creates and populates a `.venv` automatically)
59
-
5. Set up the database: `uv run python pythonie/manage.py migrate --settings=pythonie.settings.dev`
8. Create a superuser: `uv run python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev`
69
+
9. Install and run Redis server locally: `redis-server`
70
+
10. Set Redis environment variable: `export REDISCLOUD_URL=127.0.0.1:6379`
71
+
11. Run the server: `uv run python pythonie/manage.py runserver --settings=pythonie.settings.dev`
72
+
12. Visit http://127.0.0.1:8000/ to see the site with sample content
73
+
13. Visit http://127.0.0.1:8000/admin/ to log in to Wagtail admin
67
74
68
75
## Project Structure
69
76
@@ -185,6 +192,26 @@ task code:lint
185
192
task code:check
186
193
```
187
194
195
+
### Git Hooks (prek)
196
+
197
+
The repository uses [prek](https://github.com/j178/prek), a fast drop-in replacement for pre-commit, to run ruff, django-upgrade, the Django system checks, the missing migrations check and generic file checks on every commit. Like uv, prek is not a project dependency: install it on your machine, then enable the hooks in your clone.
198
+
199
+
```bash
200
+
# 1. Install prek (once per machine), with one of:
201
+
mise install # installs the versions pinned in mise.toml
202
+
brew install prek
203
+
uv tool install prek
204
+
205
+
# 2. Enable the git hooks (once per clone)
206
+
uv sync --all-groups # the ruff and Django hooks run through `uv run`
207
+
prek install
208
+
209
+
# Run every hook on the whole repository (same as CI)
210
+
prek run --all-files
211
+
```
212
+
213
+
See [CONTRIBUTING.md](CONTRIBUTING.md#git-hooks-prek) for the list of hooks and how to skip one in an emergency.
214
+
188
215
## Environment Variables
189
216
190
217
For Docker development, create/edit `development.env`:
0 commit comments