Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change gunicorn #60

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/users/views/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_simplejwt.tokens import RefreshToken
Expand Down Expand Up @@ -41,7 +40,7 @@ def post(self, request, *args, **kwargs):


class CustomTokenRefreshView(APIView):
permission_classes = [IsAuthenticated]
permission_classes = [AllowAny]
serializer_class = CustomTokenRefreshSerializer

def post(self, request, *args, **kwargs):
Expand Down
7 changes: 3 additions & 4 deletions core/config/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
AWS_STORAGE_BUCKET_NAME = os.getenv("S3_BUCKET_NAME", "mystories")
AWS_S3_ENDPOINT_URL = os.getenv("S3_ENDPOINT_URL", "https://eu2.contabostorage.com")
AWS_S3_REGION_NAME = os.getenv("S3_REGION", "eu-central-1")
AWS_S3_SIGNATURE_VERSION = None
AWS_S3_SIGNATURE_VERSION = os.getenv("S3_SIGNATURE_VERSION", "s3v4")
AWS_QUERYSTRING_AUTH = False
AWS_S3_FILE_OVERWRITE = False
AWS_S3_VERIFY = os.getenv("S3_VERIFY", "True").lower() == "true"

DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"

MEDIA_URL = os.getenv(
"MEDIA_URL",
f"{AWS_S3_ENDPOINT_URL}",
f"{AWS_S3_ENDPOINT_URL}{AWS_STORAGE_BUCKET_NAME}/",
)

AWS_S3_VERIFY = True
4 changes: 2 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
},
]

# WSGI_APPLICATION = "core.wsgi.application"
ASGI_APPLICATION = "core.asgi.application"
WSGI_APPLICATION = "core.wsgi.application"
# ASGI_APPLICATION = "core.asgi.application"

# DATABASES = {
# "default": {
Expand Down
2 changes: 1 addition & 1 deletion core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
path("api/v1/", include("apps.users.urls")),
path("api/v1/", include("apps.mystories.urls")),
path("rosetta/", include("rosetta.urls")),
# path("silk/", include("silk.urls", namespace="silk")),
path("silk/", include("silk.urls", namespace="silk")),
# Media and static files
re_path(r"static/(?P<path>.*)", serve, {"document_root": settings.STATIC_ROOT}),
re_path(r"media/(?P<path>.*)", serve, {"document_root": settings.MEDIA_ROOT}),
Expand Down
4 changes: 2 additions & 2 deletions deployments/compose/django/start
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ python manage.py migrate
python manage.py collectstatic --noinput

# Run Gunicorn server with increased timeout
#exec gunicorn core.wsgi:application --bind 0.0.0.0:8000 --timeout 120
exec gunicorn core.wsgi:application --bind 0.0.0.0:8000 --timeout 120

# Run Uvicorn server using ASGI
exec uvicorn core.asgi:application --host 0.0.0.0 --port 8000 --reload
#exec uvicorn core.asgi:application --host 0.0.0.0 --port 8000 --reload



Loading