Add support for Debian Bullseye
Added `on_delete` attributes, updated ForceCanonicalHostnameMiddleware for compatibility and added Dockerfile for Bullseye.
This commit is contained in:
parent
aa6d3626be
commit
05323a307d
7 changed files with 27 additions and 9 deletions
12
Dockerfile-debian-bullseye
Normal file
12
Dockerfile-debian-bullseye
Normal file
|
@ -0,0 +1,12 @@
|
|||
# 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"]
|
|
@ -1,5 +1,5 @@
|
|||
# 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
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class Entry(models.Model, bsoup.SoupModelMixin):
|
|||
summary = models.TextField(help_text="Use raw HTML. Unlike in the press release model, this summary is not included at the beginning of the body when the entry is displayed.")
|
||||
body = models.TextField(help_text="Use raw HTML. Include the full body of the post.")
|
||||
pub_date = models.DateTimeField()
|
||||
author = models.ForeignKey(Person)
|
||||
author = models.ForeignKey(Person, on_delete=models.PROTECT)
|
||||
tags = models.ManyToManyField(EntryTag, blank=True)
|
||||
|
||||
date_created = models.DateTimeField(auto_now_add=True)
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.conf.urls import url
|
|||
|
||||
from . import views
|
||||
|
||||
app_name = "ccs_upload"
|
||||
urlpatterns = [
|
||||
url(r'^$', views.upload, name='form')
|
||||
]
|
||||
|
|
|
@ -39,8 +39,10 @@ class Event(models.Model):
|
|||
description = models.TextField(blank=True)
|
||||
people = models.ManyToManyField(Person, blank=True)
|
||||
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)
|
||||
|
||||
date_created = models.DateTimeField(auto_now_add=True)
|
||||
|
@ -71,7 +73,7 @@ class EventMedia(models.Model):
|
|||
includes transcripts, audio, and video pieces
|
||||
"""
|
||||
|
||||
event = models.ForeignKey(Event)
|
||||
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
||||
format = models.CharField(max_length=1,
|
||||
choices=(('T', 'Transcript'),
|
||||
('A', 'Audio'),
|
||||
|
|
|
@ -97,8 +97,8 @@ class ExternalArticle(models.Model):
|
|||
|
||||
tags = models.ManyToManyField(ExternalArticleTag, blank=True)
|
||||
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)
|
||||
|
||||
date_created = models.DateField(auto_now_add=True)
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
from django import http
|
||||
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.
|
||||
|
||||
def process_request(self, request):
|
||||
"""Modified common middleware for Conservancy site
|
||||
|
|
Loading…
Reference in a new issue