Changeset - 05323a307d3e
[Not reviewed]
0 6 1
Ben Sturmfels (bsturmfels) - 8 months ago 2023-09-12 00:59:45
ben@sturm.com.au
Add support for Debian Bullseye

Added `on_delete` attributes, updated ForceCanonicalHostnameMiddleware for
compatibility and added Dockerfile for Bullseye.
7 files changed with 27 insertions and 9 deletions:
0 comments (0 inline, 0 general)
Dockerfile-debian-bullseye
Show inline comments
 
new file 100644
 
# docker build --tag sfconservancy.org-bullseye - < Dockerfile-debian-bullseye
 
# docker run --tty --interactive --rm=true --publish=8000:8000 --mount type=bind,source=$(pwd),target=/var/www/website --mount type=bind,source=$(pwd)/conservancy-website.sqlite3,target=/var/lib/www/database/conservancy-website.sqlite3 sfconservancy.org-bullseye:latest
 

	
 
ARG DEBIAN_FRONTEND=noninteractive
 

	
 
FROM debian:bullseye
 
RUN apt-get update && apt-get upgrade -y
 
RUN apt-get install -y python3 python3-pip python3-wheel sqlite3
 
RUN apt-get install -y python3-django python3-bs4 python3-django-countries
 
RUN python3 -m pip freeze
 
WORKDIR /var/www/website/www
 
ENTRYPOINT ["python3", "/var/www/website/www/manage.py", "runserver", "0.0.0.0:8000"]
Dockerfile-debian-stretch
Show inline comments
 
# docker build --tag sfconservancy.org - < Dockerfile-debian-stretch
 
# docker run --tty --interactive --rm=true --publish=8000:8000 --mount type=bind,source=$(pwd),target=/var/www/website --mount type=bind,source=$(pwd)/conservancy-website.sqlite3,target=/var/lib/www/database/conservancy-website.sqlite3 sfconservancy.org:latest
 
# docker build --tag sfconservancy.org-stretch - < Dockerfile-debian-stretch
 
# docker run --tty --interactive --rm=true --publish=8000:8000 --mount type=bind,source=$(pwd),target=/var/www/website --mount type=bind,source=$(pwd)/conservancy-website.sqlite3,target=/var/lib/www/database/conservancy-website.sqlite3 sfconservancy.org-stretch:latest
 

	
www/conservancy/apps/blog/models.py
Show inline comments
...
 
@@ -29,3 +29,3 @@ class Entry(models.Model, bsoup.SoupModelMixin):
 
    pub_date = models.DateTimeField()
 
    author = models.ForeignKey(Person)
 
    author = models.ForeignKey(Person, on_delete=models.PROTECT)
 
    tags = models.ManyToManyField(EntryTag, blank=True)
www/conservancy/apps/ccs_upload/urls.py
Show inline comments
...
 
@@ -4,2 +4,3 @@ from . import views
 

	
 
app_name = "ccs_upload"
 
urlpatterns = [
www/conservancy/apps/events/models.py
Show inline comments
...
 
@@ -41,4 +41,6 @@ class Event(models.Model):
 
    location = models.CharField(max_length=1000)
 
    earth_location = models.ForeignKey(EarthLocation, null=True, blank=True,
 
                                       help_text="Label will not be displayed")
 
    earth_location = models.ForeignKey(
 
        EarthLocation, null=True, blank=True, help_text="Label will not be displayed",
 
        on_delete=models.CASCADE
 
    )
 
    tags = models.ManyToManyField(EventTag, blank=True)
...
 
@@ -73,3 +75,3 @@ class EventMedia(models.Model):
 

	
 
    event = models.ForeignKey(Event)
 
    event = models.ForeignKey(Event, on_delete=models.CASCADE)
 
    format = models.CharField(max_length=1,
www/conservancy/apps/news/models.py
Show inline comments
...
 
@@ -99,4 +99,4 @@ class ExternalArticle(models.Model):
 
    people = models.ManyToManyField(Person, blank=True)
 
    event = models.ForeignKey(Event, null=True, blank=True)
 
    press_release = models.ForeignKey(PressRelease, null=True, blank=True)
 
    event = models.ForeignKey(Event, null=True, blank=True, on_delete=models.CASCADE)
 
    press_release = models.ForeignKey(PressRelease, null=True, blank=True, on_delete=models.CASCADE)
 

	
www/conservancy/middleware.py
Show inline comments
...
 
@@ -3,4 +3,7 @@ from django.conf import settings
 
from django.utils.cache import patch_response_headers
 
from django.utils.deprecation import MiddlewareMixin
 

	
 
class ForceCanonicalHostnameMiddleware:
 

	
 
class ForceCanonicalHostnameMiddleware(MiddlewareMixin):
 
    # MiddlewareMixin provides compatiiblity for Django 1.10 style middleware.
 

	
0 comments (0 inline, 0 general)