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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12-5Lines changed: 12 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,13 +73,14 @@ Windows users will need to adjust commands accordingly, though the core workflow
73
73
Alternatively, any Python package manager that supports installing from `pyproject.toml` ([PEP 621](https://peps.python.org/pep-0621/)) can be used. If not using `uv`, ensure you have Python installed from [python.org](https://www.python.org/).
74
74
75
75
1. Fork the repository and clone it locally.
76
+
76
77
2. Use `uv` too bootstrap your development environment:
77
78
78
-
```bash
79
-
uv python install
80
-
uv sync --locked
81
-
# just bootstrap
82
-
```
79
+
```bash
80
+
uv python install
81
+
uv sync --locked
82
+
# just bootstrap
83
+
```
83
84
84
85
This will install the correct Python version, create and configure a virtual environment, and install all dependencies.
85
86
@@ -140,14 +141,17 @@ uv run nox --session test -- --integration
140
141
#### Setting up a Test GitHub App
141
142
142
143
1. Create a new GitHub App.
144
+
143
145
- Go to GitHub Developer Settings > GitHub Apps > New GitHub App
144
146
- Name: `@<username> - django-github-app tests` (must be unique on GitHub, max 34 characters)
145
147
- Homepage URL: Your fork's URL (e.g., `https://github.com/<username>/django-github-app`)
146
148
- Webhooks: Disable by unchecking "Active" (no webhook tests currently implemented)
147
149
- Permissions:
148
150
- Repository: Metadata (Read-only)
149
151
- Installation: "Only on this account"
152
+
150
153
2. After creation, collect these values:
154
+
151
155
- App ID (from app settings)
152
156
- Client ID (from app settings)
153
157
- Private key (generate and download)
@@ -177,8 +181,11 @@ See [`.env.example`](.env.example) for all required variables and their descript
177
181
If you want integration tests to run in CI on your fork:
178
182
179
183
1. Go to your fork's repository settings on GitHub
184
+
180
185
2. Under "Environments", create a new environment named `integration`
186
+
181
187
3. Add the following secrets and variables to the environment:
Copy file name to clipboardExpand all lines: README.md
+86-86Lines changed: 86 additions & 86 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,92 +76,92 @@ The library is async-only at the moment (following gidgethub), with sync support
76
76
77
77
All examples below use [environs](https://github.com/sloria/environs) to load the values from an `.env` file. Adjust the code to your preferred way of loading Django settings.
78
78
79
-
> [!NOTE]
80
-
> By default, examples use the private key contents loaded directly from environment. To use a key file instead:
> django-github-app will automatically detect if `GITHUB_APP["PRIVATE_KEY"]` is a path and load the file contents.
94
-
95
-
- **Option A: Create a new Github App**
96
-
97
-
1. Register a new GitHub App, following [these instructions](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) from the GitHub Docs. For a more detailed tutorial, there is also [this page](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events) -- in particular the section on [Setup](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events#setup).
98
-
99
-
For the Private Key, you will be able to use either the file contents or the file itself to authenticate with GitHub, as described in the note above.
100
-
101
-
For the Webhook URL, use the endpoint you configured in step 4 (e.g., `<your project's base url>/gh/`).
102
-
103
-
2. Configure your Django settings by adding the following dictionary to your `DJANGO_SETTINGS_MODULE`, filling in the values from the previous setup.
When you install the app, django-github-app will automatically create the necessary `Installation` and `Repository` models when it receives the `installation.created` webhook event.
128
-
129
-
- **Option B: Use an existing GitHub App and Installation**
130
-
131
-
1. Collect your existing app and installation's information:
132
-
133
-
- All GitHub App information and credentials listed above
134
-
- Make sure the Webhook URL matches the endpoint configured in step 4
135
-
- Account type where installed (`org` or `user`)
136
-
- Account name (username or organization name)
137
-
- Installation ID (e.g. `https://github.com/settings/installations/<ID>`for an user installation)
138
-
139
-
2. Configure your Django settings by adding the following dictionary to your `DJANGO_SETTINGS_MODULE`, filling in the values from your existing GitHub App.
> django-github-app will automatically detect if `GITHUB_APP["PRIVATE_KEY"]` is a path and load the file contents.
94
+
95
+
**Option A: Create a new Github App**
96
+
97
+
1. Register a new GitHub App, following [these instructions](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) from the GitHub Docs. For a more detailed tutorial, there is also [this page](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events) -- in particular the section on [Setup](https://docs.github.com/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events#setup).
98
+
99
+
For the Private Key, you will be able to use either the file contents or the file itself to authenticate with GitHub, as described in the note above.
100
+
101
+
For the Webhook URL, use the endpoint you configured in step 4 (e.g., `<your project's base url>/gh/`).
102
+
103
+
2. Configure your Django settings by adding the following dictionary to your `DJANGO_SETTINGS_MODULE`, filling in the values from the previous setup.
When you install the app, django-github-app will automatically create the necessary `Installation` and `Repository` models when it receives the `installation.created` webhook event.
128
+
129
+
**Option B: Use an existing GitHub App and Installation**
130
+
131
+
1. Collect your existing app and installation's information:
132
+
133
+
- All GitHub App information and credentials listed above
134
+
- Make sure the Webhook URL matches the endpoint configured in step 4
135
+
- Account type where installed (`org` or `user`)
136
+
- Account name (username or organization name)
137
+
- Installation ID (e.g. `https://github.com/settings/installations/<ID>`for an user installation)
138
+
139
+
2. Configure your Django settings by adding the following dictionary to your `DJANGO_SETTINGS_MODULE`, filling in the values from your existing GitHub App.
0 commit comments