Skip to content

Commit

Permalink
Merge pull request #1952 from TabbycatDebate/dependency/django-4.0
Browse files Browse the repository at this point in the history
Upgrade to Python 3.9 and Django 4.0
  • Loading branch information
czlee authored Apr 16, 2022
2 parents 3c9e93c + c11dfbd commit 9024b2a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
node-version: [12.x]

services:
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.6
3.9.12
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# run the application specified. docker-compose does not use this.

# Grab a python image
FROM python:3.8
FROM python:3.9

# Just needed for all things python (note this is setting an env variable)
ENV PYTHONUNBUFFERED 1
Expand Down
16 changes: 8 additions & 8 deletions config/requirements_core.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# The necessary dependencies to run Tabbycat

# Django
Django==3.2.9
Django==4.0
django-appconf==1.0.4 # Helper for handling app configs
django-better-admin-arrayfield==1.4.2 # Admin widget for ArrayField
django-dynamic-preferences==1.10.1 # Settings management
django-dynamic-preferences==1.11.0 # Settings management
django-extensions==3.1.5 # For the generate secret command
django-formtools==2.3 # Form wizards
django-ipware==3.0.2 # IP Address logging
django-gfklookupwidget==1.0.9 # Replaces object_id field with a search link
djangorestframework==3.12.4 # For serialising objects
django-polymorphic==3.0.0 # Permits model polymorphism
django-polymorphic==3.1 # Permits model polymorphism
django-split-settings==1.0.1 # Modularise settings files
django-statici18n==2.1.1 # Compile translations files as static file
django-summernote==0.8.11.6 # WYSIWYG editor
django-summernote==0.8.20.0 # WYSIWYG editor
dj-cmd==1.0 # Provides the dj command alias
django-redis==5.1.0 # Use redis for cache (on heroku; local optional)
django-cors-headers==3.10.0 # CORS headers for API endpoints
Expand All @@ -27,8 +27,8 @@ psycopg2==2.9.2 # For Django to talk to postgres
# http://initd.org/psycopg/docs/install.html#binary-install-from-pypi

# Channels
asgiref==3.3.4 # Must set version to avoid Channels bug #1713
channels==2.4.0 # Channels; also includes the Daphne server
asgiref==3.5.0 # Part of channels; lock version to avoid unexpected issues
channels==3.0.4 # Channels; also includes the Daphne server
channels_redis==3.2.0 # Channels Layer

# Misc
Expand All @@ -41,5 +41,5 @@ defusedxml==0.7.1 # Protection against XML vulnerabilities

# Django admin (Jet)
# This is an unofficial fork of no-longer-maintained geex-arts/django-jet,
# patched to support Django 3.
r-django-jet==2.0.9
# patched to support Django 4.
django-jet-reboot==1.3.0
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.8.6
python-3.9.12
3 changes: 1 addition & 2 deletions tabbycat/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.conf.urls import url
from django.urls import include, path
from rest_framework.routers import SimpleRouter

Expand Down Expand Up @@ -203,7 +202,7 @@
name='api-venuecategory-detail'),
])),

url('/', include(pref_router.urls)), # Preferences
path('/', include(pref_router.urls)), # Preferences
])),


Expand Down
24 changes: 13 additions & 11 deletions tabbycat/routing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from channels.auth import AuthMiddlewareStack
from channels.routing import ChannelNameRouter, ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from django.core.asgi import get_asgi_application
from django.urls import path

from actionlog.consumers import ActionLogEntryConsumer
from adjallocation.consumers import AdjudicatorAllocationWorkerConsumer, PanelEditConsumer
Expand All @@ -17,28 +18,29 @@

application = ProtocolTypeRouter({

# HTTP handled automatically
# HTTP handler
"http": get_asgi_application(),

# WebSocket handlers
"websocket": AuthMiddlewareStack(
URLRouter([
# TournamentOverviewContainer
url(r'^ws/(?P<tournament_slug>[-\w_]+)/action_logs/$', ActionLogEntryConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_results/$', BallotResultConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/ballot_statuses/$', BallotStatusConsumer),
path('ws/<slug:tournament_slug>/action_logs/', ActionLogEntryConsumer.as_asgi()),
path('ws/<slug:tournament_slug>/ballot_results/', BallotResultConsumer.as_asgi()),
path('ws/<slug:tournament_slug>/ballot_statuses/', BallotStatusConsumer.as_asgi()),
# CheckInStatusContainer
url(r'^ws/(?P<tournament_slug>[-\w_]+)/checkins/$', CheckInEventConsumer),
path('ws/<slug:tournament_slug>/checkins/', CheckInEventConsumer.as_asgi()),
# Draw and Preformed Panel Edits
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/debates/$', DebateEditConsumer),
url(r'^ws/(?P<tournament_slug>[-\w_]+)/round/(?P<round_seq>[-\w_]+)/panels/$', PanelEditConsumer),
path('ws/<slug:tournament_slug>/round/<int:round_seq>/debates/', DebateEditConsumer.as_asgi()),
path('ws/<slug:tournament_slug>/round/<int:round_seq>/panels/', PanelEditConsumer.as_asgi()),
]),
),

# Worker handlers (which don't need a URL/protocol)
"channel": ChannelNameRouter({
# Name used in runworker cmd : SyncConsumer responsible
"notifications": NotificationQueueConsumer, # Email sending
"adjallocation": AdjudicatorAllocationWorkerConsumer,
"venues": VenuesWorkerConsumer,
"notifications": NotificationQueueConsumer.as_asgi(), # Email sending
"adjallocation": AdjudicatorAllocationWorkerConsumer.as_asgi(),
"venues": VenuesWorkerConsumer.as_asgi(),
}),
})

0 comments on commit 9024b2a

Please sign in to comment.