Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ketankshukla committed Oct 8, 2024
1 parent b93e511 commit 443464c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
21 changes: 14 additions & 7 deletions core_django/settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
"""
Django settings for core_django project.
Expand Down Expand Up @@ -25,7 +26,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['.vercel.app', 'localhost']


# Application definition
Expand All @@ -41,13 +42,14 @@
]

MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware',
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = "core_django.urls"
Expand Down Expand Up @@ -123,3 +125,8 @@
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

# Static files configuration
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ django-environ==0.11.2 # Manage environment variables in Django projects.
djangorestframework==3.15.2 # API framework for building REST APIs in Django.
djangorestframework-simplejwt==5.2.2 # JWT-based authentication for DRF (REST APIs).
drf-yasg==1.21.6 # Auto-generate Swagger/OpenAPI documentation for DRF APIs.
gunicorn==20.1.0 # WSGI server for running Django in production.
whitenoise==6.4.0 # Simplified static file serving in production for Django apps.

# Database & ORM
# psycopg2-binary==2.9.9 # PostgreSQL database adapter for Django.
Expand Down Expand Up @@ -52,3 +50,5 @@ sentry-sdk==1.30.0 # Error tracking and monitoring for Django apps using Sentry
# Testing & Development Tools
factory-boy==3.2.1 # Factory pattern library for generating test data.
django-test-plus==1.4.0 # Additional testing utilities for Django.
whitenoise==6.5.0
gunicorn==21.2.0
18 changes: 18 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"builds": [
{
"src": "manage.py",
"use": "@vercel/python",
"config": {
"maxLambdaSize": "15mb",
"runtime": "python3.9"
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "manage.py"
}
]
}

0 comments on commit 443464c

Please sign in to comment.