Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af8e4b6ca7 | |||
| b881f9162f | |||
| 9dd94c033c | |||
| 14751d3ff0 | |||
| a08f818a5f | |||
| e6a9d51160 | |||
| c8de9671d7 |
4 changed files with 14 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
|||
FROM python:3.9
|
||||
FROM python:3.12
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
RUN mkdir /app /app/static
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -133,16 +133,16 @@ class Groups(View):
|
|||
|
||||
|
||||
class Newsletters(View):
|
||||
"""browse the list of groups"""
|
||||
"""browse the list of newsletters"""
|
||||
|
||||
def get(self, request, category=None):
|
||||
"""here they are"""
|
||||
if category:
|
||||
news = models.Newsletter.objects.filter(
|
||||
approved=True, category=category
|
||||
approved=True, active=True, category=category
|
||||
).order_by("name")
|
||||
else:
|
||||
news = models.Newsletter.objects.filter(approved=True).order_by("name")
|
||||
news = models.Newsletter.objects.filter(approved=True, active=True).order_by("name")
|
||||
|
||||
for letter in news:
|
||||
letter.category_name = models.Category(letter.category).label
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@ services:
|
|||
db:
|
||||
image: postgres:13
|
||||
env_file: .env
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
timeout: 10s
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
networks:
|
||||
|
|
@ -15,7 +21,9 @@ services:
|
|||
volumes:
|
||||
- .:/app
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: true
|
||||
networks:
|
||||
- main
|
||||
ports:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
beautifulsoup4==4.12.2
|
||||
gunicorn==22.0.0
|
||||
Django==4.2.14
|
||||
environs==9.5.0
|
||||
environs==14.1.1
|
||||
feedparser==6.0.10
|
||||
psycopg2==2.9.5
|
||||
requests==2.32.3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue