Skip to content

Commit ea25b13

Browse files
add new tagline for description and flesh out some config options
1 parent c9650a1 commit ea25b13

File tree

2 files changed

+45
-10
lines changed

2 files changed

+45
-10
lines changed

README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<!-- django-4.2 | 5.0 | 5.1-#44B78B -->
88
<!-- labelColor=%23092E20 -->
99

10-
A Django app for building GitHub Apps, providing the foundational components needed to receive webhooks and interact with GitHub's API.
10+
A Django toolkit providing the batteries needed to build GitHub Apps - from webhook handling to API integration.
1111

1212
Built on [gidgethub](https://github.com/gidgethub/gidgethub) and [httpx](https://github.com/encode/httpx), django-github-app handles the boilerplate of GitHub App development. Features include webhook event routing and storage, an async-first API client with automatic authentication, and models for managing GitHub App installations, repositories, and webhook event history.
1313

14-
The library is async-only at the moment (following gidgethub), with sync support planned to better integrate with Django projects.
14+
The library is async-only at the moment (following gidgethub), with sync support planned to better integrate with the majority of Django projects.
1515

1616
## Requirements
1717

@@ -288,7 +288,9 @@ The GitHub App's unique identifier. Obtained when registering your GitHub App.
288288
289289
> **Optional** | `bool` | Default: `True`
290290
291-
Boolean flag to enable automatic cleanup of old webhook events.
291+
Boolean flag to enable automatic cleanup of old webhook events. If enabled, `EventLog` instances older than [`DAYS_TO_KEEP_EVENTS`](#days_to_keep_events) (default: 7 days) are deleted during webhook processing.
292+
293+
Set to `False` to either retain events indefinitely or manage cleanup separately using `EventLog.objects.acleanup_events` with a task runner like [Django-Q2](https://github.com/django-q2/django-q2) or [Celery](https://github.com/celery/celery).
292294
293295
### `CLIENT_ID`
294296
@@ -300,7 +302,7 @@ The GitHub App's client ID. Obtained when registering your GitHub App.
300302
301303
> **Optional** | `int` | Default: `7`
302304
303-
Number of days to retain webhook events before cleanup.
305+
Number of days to retain webhook events before cleanup. Used by both automatic cleanup (when [`AUTO_CLEANUP_EVENTS`](#auto_cleanup_events) is `True`) and the `EventLog.objects.acleanup_events` manager method.
304306
305307
### `NAME`
306308
@@ -312,10 +314,43 @@ The GitHub App's name as registered on GitHub.
312314
313315
> ❗ **Required** | `str`
314316
315-
The GitHub App's private key for authentication. Can be provided as:
317+
The contents of the GitHub App's private key for authentication. Can be provided as:
318+
319+
You can provide the key contents directly:
320+
321+
```python
322+
from environs import Env
323+
324+
env = Env()
325+
326+
# Direct key contents from environment variable
327+
GITHUB_APP = {
328+
"PRIVATE_KEY": env.str("GITHUB_PRIVATE_KEY"),
329+
}
330+
```
331+
332+
Or read it from a file:
333+
334+
```python
335+
from pathlib import Path
336+
337+
from environs import Env
338+
339+
# Using pathlib.Path and a local path directly
340+
GITHUB_APP = {
341+
"PRIVATE_KEY": Path("path/to/private-key.pem").read_text(),
342+
}
343+
344+
345+
env = Env()
346+
347+
# Or with environs for environment-based path
348+
GITHUB_APP = {
349+
"PRIVATE_KEY": Path(env.path("GITHUB_PRIVATE_KEY_PATH")).read_text(),
350+
}
351+
```
316352
317-
- Raw key contents in environment variable
318-
- File contents read from disk: `Path("path/to/key.pem").read_text()`
353+
Note that the private key should be kept secure and never committed to version control. Using environment variables or secure file storage is recommended.
319354
320355
### `WEBHOOK_SECRET`
321356

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ authors = [
3131
{name = "Josh Thomas", email = "josh@joshthomas.dev"}
3232
]
3333
classifiers = [
34-
"Development Status :: 3 - Alpha",
34+
"Development Status :: 4 - Beta",
3535
"Framework :: Django",
3636
"Framework :: Django :: 4.2",
3737
"Framework :: Django :: 5.0",
@@ -53,15 +53,15 @@ dependencies = [
5353
"gidgethub>=5.3.0",
5454
"httpx>=0.27.2"
5555
]
56-
description = "Add your description here"
56+
description = "A Django toolkit for GitHub Apps with batteries included."
5757
dynamic = ["version"]
5858
license = {file = "LICENSE"}
5959
name = "django-github-app"
6060
readme = "README.md"
6161
requires-python = ">=3.10"
6262

6363
[project.urls]
64-
Documentation = "https://django-github-app.readthedocs.io/"
64+
Documentation = "https://github.com/joshuadavidthomas/django-github-app#README"
6565
Issues = "https://github.com/joshuadavidthomas/django-github-app/issues"
6666
Source = "https://github.com/joshuadavidthomas/django-github-app"
6767

0 commit comments

Comments
 (0)