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
1 change: 1 addition & 0 deletions .github/workflows/django-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}

steps:
- name: Checkout code
Expand Down
12 changes: 9 additions & 3 deletions backend/bitmatch/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-b4wn$=0zp6j)8%uejmc)hp&3$j3myn$(&i_69(c@shw1i285*v'
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DJANGO_ENV = os.getenv("DJANGO_ENV", "DEV").upper()

ALLOWED_HOSTS = ["*"]
DEBUG = DJANGO_ENV == "DEV"

if DJANGO_ENV == "PROD":
ALLOWED_HOSTS = ["bitmatchapp.com", "www.bitmatchapp.com"]
else:
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
Expand Down Expand Up @@ -178,6 +183,7 @@
"http://localhost:5173",
"http://localhost:5174",
"https://bitmatchapp.com",
"https://www.bitmatchapp.com",
"https://api.bitmatchapp.com",
]

Expand Down
2 changes: 1 addition & 1 deletion backend/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# PROJECTS MODEL
class Project(models.Model):
# Auto generated
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
id=models.CharField(primary_key=True,default=uuid.uuid4, editable=False, max_length=36)

# REQUIRED
title = models.CharField(max_length=255, blank=False, null=False)
Expand Down
16 changes: 14 additions & 2 deletions backend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ def post(self, request):
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
else:
print(serializer.errors)
error_details = {
"message": "Invalid project data provided.",
"errors": serializer.errors,
}
return Response(error_details, status=status.HTTP_400_BAD_REQUEST)

# Get a single project by ID (GET)
def get(self, request, pk):
Expand All @@ -42,7 +48,13 @@ def put(self, request, pk):
if serializer.is_valid():
serializer.save()
return Response(serializer.data)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
else:
print(serializer.errors)
error_details = {
"message": "Invalid project data provided.",
"errors": serializer.errors,
}
return Response(error_details, status=status.HTTP_400_BAD_REQUEST)

# Delete a project by ID (DELETE)
def delete(self, request, pk):
Expand Down
1 change: 1 addition & 0 deletions frontend/bitmatch/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default [
"warn",
{ allowConstantExport: true },
],
"react/prop-types": "warn",
},
},
];
2 changes: 1 addition & 1 deletion frontend/bitmatch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BitMatch</title>
</head>
Expand Down
Loading
Loading