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 ...@@ -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! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = ["localhost", "127.0.0.1", ".vercel.app"] ALLOWED_HOSTS = ["localhost", "127.0.0.1", ".vercel.app", ".now.sh"]
# Application definition # Application definition
...@@ -136,6 +136,7 @@ USE_TZ = True ...@@ -136,6 +136,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/ # https://docs.djangoproject.com/en/5.0/howto/static-files/
STATICFILES_DIRS = BASE_DIR / "static"
STATIC_ROOT = BASE_DIR / "staticfiles" STATIC_ROOT = BASE_DIR / "staticfiles"
STATIC_URL = "/static/" STATIC_URL = "/static/"
......
...@@ -17,8 +17,9 @@ Including another URLconf ...@@ -17,8 +17,9 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from django.conf.urls import include from django.conf.urls import include, static
from dashboards.views import home from dashboards.views import home
from django.conf import settings
urlpatterns = [ urlpatterns = [
path("", home, name="homepage"), path("", home, name="homepage"),
...@@ -26,3 +27,6 @@ urlpatterns = [ ...@@ -26,3 +27,6 @@ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("auth/", include("authentications.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": [ "routes": [
{
"src": "/static/(.*)",
"dest": "/static/$1"
},
{ {
"src": "/(.*)", "src": "/(.*)",
"dest": "config/wsgi.py" "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