Skip to content
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
5 changes: 4 additions & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ def _env_list(name, default=''):
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/6.0/howto/static-files/

STATIC_URL = 'static/'
STATIC_URL = os.environ.get('DJANGO_STATIC_URL', 'static/')
STATIC_ROOT = BASE_DIR / 'staticfiles'


# Deployment behind a reverse proxy (Nginx/Cloudflare) that terminates HTTPS.
# FORCE_SCRIPT_NAME lets the app be served under a sub-path (e.g. /backend) so
# reverse()-generated URLs include that prefix.

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
FORCE_SCRIPT_NAME = os.environ.get('DJANGO_FORCE_SCRIPT_NAME') or None

if not DEBUG:
SESSION_COOKIE_SECURE = True
Expand Down
3 changes: 2 additions & 1 deletion offers_app/api/serializers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.urls import reverse
from rest_framework import serializers

from offers_app.models import Offer, OfferDetail
Expand Down Expand Up @@ -32,7 +33,7 @@ class Meta:
]

def get_url(self, obj):
return f'/api/offerdetails/{obj.id}/'
return reverse('offerdetail-detail', kwargs={'pk': obj.id})


class UserDetailsSerializer(serializers.Serializer):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ django-stubs==6.0.6
django-stubs-ext==6.0.6
djangorestframework==3.17.1
djangorestframework-stubs==3.17.0
gunicorn==26.0.0
iniconfig==2.3.0
packaging==26.2
Pillow==12.2.0
Expand Down