Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ilham Maulana
library-app-django
Commits
248aec80
Commit
248aec80
authored
Jul 02, 2024
by
impfundev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup vercel deployment
parent
9cf59144
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
2 deletions
+28
-2
build_files.sh
build_files.sh
+2
-0
settings.py
config/settings.py
+2
-1
urls.py
config/urls.py
+5
-1
vercel.json
vercel.json
+19
-0
No files found.
build_files.sh
0 → 100644
View file @
248aec80
pip
install
-r
requirements.txt
python3.9 manage.py collectstatic
--noinput
\ No newline at end of file
config/settings.py
View file @
248aec80
...
@@ -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/"
...
...
config/urls.py
View file @
248aec80
...
@@ -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
)
vercel.json
View file @
248aec80
{
{
"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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment