Skip to content

Commit 893e9b5

Browse files
authored
Merge branch 'main' into ngwaf
2 parents b03a8de + 7eac335 commit 893e9b5

File tree

105 files changed

+875
-2691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+875
-2691
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Notify @EWDurbin for all opened Issues and Pull Requests
2+
* @EWDurbin @JacobCoffee

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
By submitting this pull request, you agree to:
3+
- follow the [PSF's Code of Conduct](https://www.python.org/psf/conduct/)
4+
-->
5+
#### Description
6+
7+
-
8+
9+
<!--
10+
If applicable, please add in issue numbers this pull request will close, if applicable
11+
Examples: Fixes #4321 or Closes #1234
12+
13+
Ensure you are using a supported keyword to properly link an issue:
14+
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
15+
-->
16+
#### Closes
17+
18+
-
19+

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
services:
77
postgres:
8-
image: postgres:10.1
8+
image: postgres:15.3
99
env:
1010
POSTGRES_USER: postgres
1111
POSTGRES_PASSWORD: postgres
@@ -31,7 +31,7 @@ jobs:
3131
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
3232
- uses: actions/setup-python@v5
3333
with:
34-
python-version: 3.9.16
34+
python-version-file: '.python-version'
3535
- name: Cache Python dependencies
3636
uses: actions/cache@v4
3737
env:

.github/workflows/static.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check collectstatic
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version-file: '.python-version'
12+
- name: Cache Python dependencies
13+
uses: actions/cache@v4
14+
env:
15+
cache-name: pythondotorg-cache-pip
16+
with:
17+
path: ~/.cache/pip
18+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
19+
restore-keys: |
20+
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
21+
${{ runner.os }}-${{ github.job }}-
22+
${{ runner.os }}-
23+
- name: Install Python dependencies
24+
run: |
25+
pip install -U pip setuptools wheel
26+
pip install -r requirements.txt -r prod-requirements.txt
27+
- name: Run Tests
28+
run: |
29+
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.16
1+
3.12.6

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bookworm
1+
FROM python:3.12.6-bookworm
22
ENV PYTHONUNBUFFERED=1
33
ENV PYTHONDONTWRITEBYTECODE=1
44

Dockerfile.cabotage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bullseye
1+
FROM python:3.12.6-bookworm
22
COPY --from=ewdurbin/nginx-static:1.25.x /usr/bin/nginx /usr/bin/nginx
33
ENV PYTHONUNBUFFERED=1
44
ENV PYTHONDONTWRITEBYTECODE=1

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ default:
44
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null\
55
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}'\
66
| sort\
7-
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
7+
| grep -E -v -e '^[^[:alnum:]]' -e '^$@$$'
88
@echo
99
@exit 1
1010

1111
.state/docker-build-web: Dockerfile dev-requirements.txt base-requirements.txt
1212
# Build web container for this project
13-
docker-compose build --force-rm web
13+
docker compose build --force-rm web
1414

1515
# Mark the state so we don't rebuild this needlessly.
1616
mkdir -p .state && touch .state/docker-build-web
@@ -24,35 +24,35 @@ default:
2424

2525
.state/db-initialized: .state/docker-build-web .state/db-migrated
2626
# Load all fixtures
27-
docker-compose run --rm web ./manage.py loaddata fixtures/*.json
27+
docker compose run --rm web ./manage.py loaddata fixtures/*.json
2828

2929
# Mark the state so we don't rebuild this needlessly.
3030
mkdir -p .state && touch .state/db-initialized
3131

3232
serve: .state/db-initialized
33-
docker-compose up --remove-orphans
33+
docker compose up --remove-orphans
3434

3535
migrations: .state/db-initialized
3636
# Run Django makemigrations
37-
docker-compose run --rm web ./manage.py makemigrations
37+
docker compose run --rm web ./manage.py makemigrations
3838

3939
migrate: .state/docker-build-web
4040
# Run Django migrate
41-
docker-compose run --rm web ./manage.py migrate
41+
docker compose run --rm web ./manage.py migrate
4242

4343
manage: .state/db-initialized
4444
# Run Django manage to accept arbitrary arguments
45-
docker-compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
45+
docker compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
4646

4747
shell: .state/db-initialized
48-
docker-compose run --rm web ./manage.py shell
48+
docker compose run --rm web ./manage.py shell
4949

5050
clean:
51-
docker-compose down -v
51+
docker compose down -v
5252
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated
5353

5454
test: .state/db-initialized
55-
docker-compose run --rm web ./manage.py test
55+
docker compose run --rm web ./manage.py test
5656

5757
docker_shell: .state/db-initialized
58-
docker-compose run --rm web /bin/bash
58+
docker compose run --rm web /bin/bash

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55

66
### General information
77

8-
This is the repository and issue tracker for [python.org](https://www.python.org).
9-
The repository for CPython itself is at https://github.com/python/cpython, and the
10-
issue tracker is at https://github.com/python/cpython/issues/.
8+
This is the repository and issue tracker for [python.org](https://www.python.org).
119

12-
Issues related to [Python's documentation](https://docs.python.org) can be filed in
13-
https://github.com/python/cpython/issues/.
10+
> [!NOTE]
11+
> The repository for CPython itself is at https://github.com/python/cpython, and the
12+
> issue tracker is at https://github.com/python/cpython/issues/.
13+
>
14+
> Similarly, issues related to [Python's documentation](https://docs.python.org) can be filed in
15+
> https://github.com/python/cpython/issues/.
1416
1517
### Contributing
1618

1719
* Source code: https://github.com/python/pythondotorg
1820
* Issue tracker: https://github.com/python/pythondotorg/issues
19-
* Documentation: https://pythondotorg.readthedocs.org/
21+
* Documentation: https://pythondotorg.readthedocs.io/
2022
* Mailing list: [pydotorg-www](https://mail.python.org/mailman/listinfo/pydotorg-www)
2123
* IRC: `#pydotorg` on Freenode
22-
* Staging site: https://staging.python.org/ (`main` branch)
2324
* License: Apache License

banners/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'banners.apps.BannersAppConfig'

base-requirements.txt

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
dj-database-url==0.5.0
2-
django-pipeline==2.0.6
3-
django-sitetree==1.18.0
2+
django-pipeline==3.0.0 # 3.0.0 is first version that supports Django 4.2
3+
django-sitetree==1.18.0 # >=1.17.1 is (?) first version that supports Django 4.2
44
django-apptemplates==1.5
55
django-admin-interface==0.24.2
66
django-translation-aliases==0.1.0
7-
Django==2.2.28
8-
docutils==0.12
9-
Markdown==3.3.4
7+
Django==4.2.16
8+
docutils==0.21.2
9+
Markdown==3.7
1010
cmarkgfm==0.6.0
11-
Pillow==9.4.0
12-
psycopg2-binary==2.8.6
11+
Pillow==10.4.0
12+
psycopg2-binary==2.9.9
1313
python3-openid==3.2.0
1414
python-decouple==3.4
1515
# lxml used by BeautifulSoup.
1616
lxml==5.2.2
1717
cssselect==1.1.0
18-
feedparser==6.0.8
19-
beautifulsoup4==4.11.2
18+
feedparser==6.0.11
19+
beautifulsoup4==4.12.3
2020
icalendar==4.0.7
2121
chardet==4.0.0
2222
celery[redis]==5.3.6
2323
django-celery-beat==2.5.0
2424
# TODO: We may drop 'django-imagekit' completely.
25-
django-imagekit==4.0.2
25+
django-imagekit==5.0 # 5.0 is first version that supports Django 4.2
2626
django-haystack==3.2.1
2727
elasticsearch>=7,<8
2828
# TODO: 0.14.0 only supports Django 1.8 and 1.11.
29-
django-tastypie==0.14.3
29+
django-tastypie==0.14.6 # 0.14.6 is first version that supports Django 4.2
3030

3131
pytz==2021.1
3232
python-dateutil==2.8.2
3333

3434
requests[security]>=2.26.0
3535

36-
django-honeypot==1.0.1
37-
django-markupfield==2.0.0
38-
django-markupfield-helpers==0.1.1
36+
django-honeypot==1.0.4 # 1.0.4 is first version that supports Django 4.2
37+
django-markupfield==2.0.1
3938

40-
django-allauth==0.50.0
39+
django-allauth==64.2.1
4140

4241
django-waffle==2.2.1
4342

44-
djangorestframework==3.12.2
43+
djangorestframework==3.14.0 # 3.14.0 is first version that supports Django 4.1, 4.2 support hasnt been "released"
4544
django-filter==2.4.0
4645
django-ordered-model==3.4.3
47-
django-widget-tweaks==1.4.8
46+
django-widget-tweaks==1.5.0
4847
django-countries==7.2.1
4948
num2words==0.5.10
50-
django-polymorphic==3.0.0
49+
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
5150
sorl-thumbnail==12.7.0
5251
django-extensions==3.1.4
5352
django-import-export==2.7.1

blogs/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'blogs.apps.BlogsAppConfig'

blogs/admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ class BlogEntryAdmin(admin.ModelAdmin):
1010
date_hierarchy = 'pub_date'
1111
actions = ['sync_new_entries']
1212

13+
@admin.action(
14+
description="Sync new blog entries"
15+
)
1316
def sync_new_entries(self, request, queryset):
1417
call_command('update_blogs')
1518
self.message_user(request, "Blog entries updated.")
1619

17-
sync_new_entries.short_description = "Sync new blog entries"
1820

1921

2022
@admin.register(FeedAggregate)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.11 on 2024-09-05 17:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('blogs', '0002_remove_translations_and_contributors'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='relatedblog',
18+
name='creator',
19+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_creator', to=settings.AUTH_USER_MODEL),
20+
),
21+
migrations.AlterField(
22+
model_name='relatedblog',
23+
name='last_modified_by',
24+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_modified', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

blogs/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from django.conf import settings
55
from django.template.loader import render_to_string
6-
from django.utils.timezone import make_aware, utc
6+
from django.utils.timezone import make_aware
77

88
from boxes.models import Box
99
from .models import BlogEntry, Feed
@@ -16,7 +16,7 @@ def get_all_entries(feed_url):
1616

1717
for e in d['entries']:
1818
published = make_aware(
19-
datetime.datetime(*e['published_parsed'][:7]), timezone=utc
19+
datetime.datetime(*e['published_parsed'][:7]), timezone=datetime.timezone.utc
2020
)
2121

2222
entry = {

boxes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'boxes.apps.BoxesAppConfig'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.11 on 2024-09-05 17:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('boxes', '0003_auto_20171101_2138'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='box',
18+
name='creator',
19+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_creator', to=settings.AUTH_USER_MODEL),
20+
),
21+
migrations.AlterField(
22+
model_name='box',
23+
name='last_modified_by',
24+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_modified', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

cms/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'cms.apps.CmsAppConfig'

codesamples/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'codesamples.apps.CodesamplesAppConfig'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.11 on 2024-09-05 17:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('codesamples', '0003_auto_20170821_2000'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='codesample',
18+
name='creator',
19+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_creator', to=settings.AUTH_USER_MODEL),
20+
),
21+
migrations.AlterField(
22+
model_name='codesample',
23+
name='last_modified_by',
24+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_modified', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

codesamples/tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ def setUp(self):
1616
is_published=False)
1717

1818
def test_published(self):
19-
self.assertQuerysetEqual(CodeSample.objects.published(),
20-
['<CodeSample: Copy One>'])
19+
self.assertQuerySetEqual(CodeSample.objects.published(),['<CodeSample: Copy One>'], transform=repr)
2120

2221
def test_draft(self):
23-
self.assertQuerysetEqual(CodeSample.objects.draft(),
24-
['<CodeSample: Copy Two>'])
22+
self.assertQuerySetEqual(CodeSample.objects.draft(),['<CodeSample: Copy Two>'], transform=repr)

community/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'community.apps.CommunityAppConfig'

0 commit comments

Comments
 (0)