vercel
This commit is contained in:
4
backend/server/build_files.sh
Normal file
4
backend/server/build_files.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# build_files.sh
|
||||||
|
|
||||||
|
pip install -r requirements.txt
|
||||||
|
python3.9 manage.py collectstatic --noinput
|
||||||
@@ -122,6 +122,9 @@ MEDIA_URL = '/media/'
|
|||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
# STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
|
# STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
|
||||||
|
|
||||||
|
|
||||||
|
STATIC_ROOT = os.path.join(BASE_DIR, "ui/staticfiles")
|
||||||
|
|
||||||
# TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
|
# TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
|
|||||||
28
backend/server/vercel.json
Normal file
28
backend/server/vercel.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"builds": [
|
||||||
|
{
|
||||||
|
"src": "demo/wsgi.py",
|
||||||
|
"use": "@vercel/python",
|
||||||
|
"config": { "maxLambdaSize": "15mb", "runtime": "python3.9" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "build_files.sh",
|
||||||
|
"use": "@vercel/static-build",
|
||||||
|
"config": {
|
||||||
|
"distDir": "ui/staticfiles"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"src": "/static/(.*)",
|
||||||
|
"dest": "/static/$1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/(.*)",
|
||||||
|
"dest": "demo/wsgi.py"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputDirectory": "ui/staticfiles"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user