Skip to content

Commit

Permalink
User
Browse files Browse the repository at this point in the history
Jayant Parashar committed Jul 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 88835fa commit c051b46
Showing 4 changed files with 51 additions and 1 deletion.
11 changes: 11 additions & 0 deletions build_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

echo "Building project packages..."
python3 -m pip install -r requirements.txt

echo "Migrating Database..."
python3 manage.py makemigrations-noinput
python3 manage.py migrate --noinput

echo "Collecting static files..."
python3 manage.py collectstatic-noinput
6 changes: 5 additions & 1 deletion todoproject/todoproject/settings.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['.vercel.app', '.now.sh']


# Application definition
@@ -125,3 +125,7 @@
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

import os
STATICFILES_DIRS = os.path.join(BASE_DIR, 'static'),
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles_build', 'static')
2 changes: 2 additions & 0 deletions todoproject/todoproject/wsgi.py
Original file line number Diff line number Diff line change
@@ -14,3 +14,5 @@
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todoproject.settings')

application = get_wsgi_application()

app = application
33 changes: 33 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": 2,
"builds": [
{
"src": "ToDO/todoproject/todoproject/wsgi.py",
"use": "@vercel/python",
"config": { "maxLambdaSize": "15mb",
"runtime": "python3.10" }

},

{
"src": "build_flies.sh",
"use": "@vercel/static-build",
"config":{
"distDir": "staticfiles_build"
}
}
],

"routes":[
{
"src": "/static/(.*)",
"dest": "/static/$1"
},
{
"src":"/(.*)",
"dest":"ToDO/todoproject/todoproject/wsgi.py"
}


]
}

0 comments on commit c051b46

Please sign in to comment.