Commit 248aec80 authored by impfundev's avatar impfundev

setup vercel deployment

parent 9cf59144
pip install -r requirements.txt
python3.9 manage.py collectstatic --noinput
\ No newline at end of file
......@@ -30,7 +30,7 @@ SECRET_KEY = "django-insecure-3-$!7+86e)2ps3i+3=da5(7-a=gt$p_@+=)fuh2jj-2!eym$3y
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["localhost", "127.0.0.1", ".vercel.app"]
ALLOWED_HOSTS = ["localhost", "127.0.0.1", ".vercel.app", ".now.sh"]
# Application definition
......@@ -136,6 +136,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATICFILES_DIRS = BASE_DIR / "static"
STATIC_ROOT = BASE_DIR / "staticfiles"
STATIC_URL = "/static/"
......
......@@ -17,8 +17,9 @@ Including another URLconf
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from django.conf.urls import include, static
from dashboards.views import home
from django.conf import settings
urlpatterns = [
path("", home, name="homepage"),
......@@ -26,3 +27,6 @@ urlpatterns = [
path("admin/", admin.site.urls),
path("auth/", include("authentications.urls")),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
{
"version": 2,
"builds": [
{
"src": "config/wsgi.py",
"use": "@vercel/python",
"config": { "maxLambdaSize": "15mb", "runtime": "python3.9" }
},
{
"src": "build_files.sh",
"use": "@vercel/static-build",
"config": {
"distDir": "staticfiles"
}
}
],
"routes": [
{
"src": "/static/(.*)",
"dest": "/static/$1"
},
{
"src": "/(.*)",
"dest": "config/wsgi.py"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment