Skip to content

Commit

Permalink
merge from template
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii committed Mar 21, 2024
2 parents a0eb9bb + 87f7ac0 commit 66ae7c8
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ postgresql-*.tgz
redis-*.tgz

db.sqlite3
.secrets.env
*.spec
File renamed without changes.
1 change: 1 addition & 0 deletions docker/modules/runner/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
concurrent = 1
check_interval = 0
shutdown_timeout = 0

[session_server]
session_timeout = 1800
4 changes: 2 additions & 2 deletions web/main/middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import TYPE_CHECKING, Optional
from zoneinfo import ZoneInfo

import pytz
from django.conf import settings
from django.http import HttpResponse
from django.utils import timezone
Expand All @@ -22,7 +22,7 @@ def __init__(self, get_response) -> None:

def __call__(self, request: 'HttpRequest'):
if tzname := request.COOKIES.get(getattr(settings, 'TIMEZONE_COOKIE_NAME', 'timezone')):
timezone.activate(pytz.timezone(tzname))
timezone.activate(ZoneInfo(tzname))
else:
timezone.deactivate()
return self.get_response(request)
8 changes: 2 additions & 6 deletions web/main/tasks.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from os import path
from smtplib import SMTPRecipientsRefused
from typing import Any, Optional

from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template import loader
from django.utils.html import strip_tags
from django.utils.translation import activate

from src.celery import app
from src import celery_app as app


class SendingEmailTaskArgs(app.Task):
Expand Down Expand Up @@ -49,8 +47,6 @@ def send_information_email(
cc=kwargs.get('cc'),
reply_to=kwargs.get('reply_to'),
)
if file_path := kwargs.get('file_path'):
file_path = path.join(settings.BASE_DIR, file_path)
email_message.attach_file(file_path, kwargs.get('mimetype'))
email_message.attach_alternative(html_email, 'text/html')
email_message.send()
return True
12 changes: 0 additions & 12 deletions web/main/tests/test_template_tags.py

This file was deleted.

10 changes: 10 additions & 0 deletions web/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
[tool.poetry]
name = "Django Template"
version = "0.1.0"
description = ""
authors = ["Nazarii <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.12"


[build-system]
requires = ["setuptools>=64.0.0"]
build-backend = "setuptools.build_meta"
Expand Down
3 changes: 3 additions & 0 deletions web/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .celery import app as celery_app

__all__ = ('celery_app',)
4 changes: 4 additions & 0 deletions web/src/additional_settings/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .celery_settings import *
from .smtp_settings import *
from .jwt_settings import *
from .summernote_settings import *
9 changes: 3 additions & 6 deletions web/src/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ django~=4.2
psycopg[binary]~=3.1
redis~=5.0
djangorestframework~=3.14
drf-spectacular~=0.26
drf-spectacular~=0.27
celery~=5.3
graphene-django==3.0

### Optional dependencies ###

# AMQP for RabbitMQ
pyamqp==0.1.0.7

# Filtering
django-filter~=23.3
django-filter~=23.5

# Cors headers
django-cors-headers~=4.3
Expand All @@ -33,7 +30,7 @@ pillow~=10.1
django-rosetta~=0.9

# Monitoring System
sentry-sdk~=1.32
sentry-sdk~=1.40

# MicroService Requests
django-microservice-request~=0.5
Expand Down
10 changes: 5 additions & 5 deletions web/src/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ django-debug-toolbar~=4.2
django-debug-toolbar-request-history~=0.1

# Linters
black~=23.10
flake8~=6.1
isort~=5.12
black~=24.2
flake8~=7.0
isort~=5.13

pytest~=7.4
pytest-django~=4.5
pytest~=8.0
pytest-django~=4.8
pytest-cov~=4.1
pytest-freezegun~=0.4
2 changes: 1 addition & 1 deletion web/src/requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
gunicorn==21.2.0
uvicorn[standard]~=0.23
uvicorn[standard]~=0.27

0 comments on commit 66ae7c8

Please sign in to comment.