jayhale / vercel-django-example Goto Github PK
View Code? Open in Web Editor NEWExample of running a Django application on Vercel
Home Page: vercel-django-example.vercel.app
Example of running a Django application on Vercel
Home Page: vercel-django-example.vercel.app
i create my Django Hello App
and i follow your Code and RUN SERVER LOCAL IS SUCCESS NO ERROR
and Deploy TO VERCEL . but i have 404 NOT FOUND
my example code
https://github.com/bobwatcherx/verceldjangoerror.git
how do I connect a database to a project?
I have a need to use a database in a project, how do I implement it?
I will be grateful for the answer.
Hi, I have been getting this error Error: Cannot convert undefined or null to object
Can't seem to understand what's problem here, Python version 3.9, Django is also latest version of 4.1.2.
Here I've attached a log from vercel
[19:19:37.832] Retrieving list of deployment files...
[19:19:44.677] Downloading 5694 deployment files...
[19:24:32.401] Looking up build cache...
[19:24:32.657] Build Cache not found
[19:24:32.760] Running "vercel build"
[19:24:33.417] Vercel CLI 28.4.10-6fa5d8b
[19:24:34.130] WARN! Due tobuilds
existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
[19:24:34.212] > Installing Builder: @ardnt/vercel-python-wsgi
[19:24:37.256] Starting build
[19:24:37.258] Build AMI version: Amazon Linux release 2 (Karoo)
[19:24:37.259] Lambda runtime: python3.9
[19:24:37.259] WSGI application: amancodes.wsgi.application
[19:24:37.259] ====> Selecting python version
[19:24:37.268] Found matching python (python3.9)
[19:24:37.269] ====> Installing pip
[19:24:37.269] ----> Installing pip
[19:24:37.346] Running "python3.9 get-pip.py"
[19:24:41.683] Collecting pip
[19:24:41.684] Downloading pip-22.3-py3-none-any.whl (2.1 MB)
[19:24:41.684] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 71.1 MB/s eta 0:00:00
[19:24:41.684] Collecting wheel
[19:24:41.684] Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
[19:24:41.685] Installing collected packages: wheel, pip
[19:24:41.685] Successfully installed pip-22.3 wheel-0.37.1
[19:24:41.685] ====> Downloading project
[19:24:45.179] ====> Installing handler
[19:24:45.180] ----> Installing python packages
[19:24:45.180] Running "pip install -t /tmp/5ba240c0 /vercel/path1/.vercel/builders/node_modules/@ardnt/vercel-python-wsgi"
[19:24:46.626] Processing ./.vercel/builders/node_modules/@ardnt/vercel-python-wsgi
[19:24:46.626] Preparing metadata (setup.py): started
[19:24:46.626] Preparing metadata (setup.py): finished with status 'done'
[19:24:46.627] Collecting Werkzeug==1.0.1
[19:24:46.627] Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
[19:24:46.627] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.6/298.6 kB 26.6 MB/s eta 0:00:00
[19:24:46.627] Building wheels for collected packages: vercel-python-wsgi
[19:24:46.628] Building wheel for vercel-python-wsgi (setup.py): started
[19:24:46.628] Building wheel for vercel-python-wsgi (setup.py): finished with status 'done'
[19:24:46.628] Created wheel for vercel-python-wsgi: filename=vercel_python_wsgi-1.1.1-py3-none-any.whl size=3891 sha256=d04be376bec741071725afc038b736e69c629bd4327dfe177b056cb5b6269b54
[19:24:46.628] Stored in directory: /vercel/.cache/pip/wheels/45/74/61/b48c4859feff53cd8f40a334dac76222c611094def81403007
[19:24:46.629] Installing collected packages: Werkzeug, vercel-python-wsgi
[19:24:46.629] Successfully installed Werkzeug-1.0.1 vercel-python-wsgi-1.1.1
[19:24:46.629] ====> Installing project requirements
[19:24:46.629] ----> Searching for "requirements.txt"
[19:24:46.629] Found global "requirements.txt"
[19:24:46.630] ----> Installing python packages
[19:24:46.630] Running "pip install -t /tmp/5ba240c0 -r /tmp/5ba240c0/requirements.txt"
[19:24:50.077] Collecting Django==4.1.2
[19:24:50.078] Downloading Django-4.1.2-py3-none-any.whl (8.1 MB)
[19:24:50.078] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 79.5 MB/s eta 0:00:00
[19:24:50.078] Collecting asgiref<4,>=3.5.2
[19:24:50.078] Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
[19:24:50.079] Collecting sqlparse>=0.2.2
[19:24:50.079] Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
[19:24:50.079] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 8.2 MB/s eta 0:00:00
[19:24:50.079] Installing collected packages: sqlparse, asgiref, Django
[19:24:50.079] Successfully installed Django-4.1.2 asgiref-3.5.2 sqlparse-0.4.3
[19:24:50.080] ====> Preparing lambda bundle
[19:24:59.626] Done!
[19:24:59.628] Error: Cannot convert undefined or null to object
Please look into this matter
This is good if we just want to display TemplateView a.k.a static website. But how can we use this to create dynamic website since Django is built primarily for dynamic ones?
When i use vercel to deploy django projects, i cant use the static files, it told me 404 Error
https://jay-hale.medium.com/django-static-files-on-zeit-now-fef2c51215d4 is right
While deploying on vercel, the build fails with error message ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.
I am not really sure exactly how to implement the workaround by using https://bootstrap.pypa.io/pip/3.6/get-pip.py
.
2022-02-12T08:42:23.682Z
2022-02-12T08:42:23.692Z Retrieving list of deployment files...
2022-02-12T08:42:25.202Z Downloading 15 deployment files...
2022-02-12T08:42:25.645Z Analyzing source code...
2022-02-12T08:42:25.710Z Warning: Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
2022-02-12T08:42:26.257Z Installing build runtime...
2022-02-12T08:42:31.536Z Build runtime installed: 5.279s
2022-02-12T08:42:32.259Z Looking up build cache...
2022-02-12T08:42:32.798Z Build Cache not found
2022-02-12T08:42:32.985Z Starting build
2022-02-12T08:42:32.987Z Build AMI version: Amazon Linux release 2 (Karoo)
2022-02-12T08:42:32.987Z Lambda runtime: python3.6
2022-02-12T08:42:32.987Z WSGI application: vercel_app.wsgi.application
2022-02-12T08:42:32.988Z ====> Selecting python version
2022-02-12T08:42:32.996Z Found matching python (python3.6)
2022-02-12T08:42:32.997Z ====> Installing pip
2022-02-12T08:42:32.997Z ----> Installing pip
2022-02-12T08:42:33.182Z Running "python3.6 get-pip.py"
2022-02-12T08:42:33.243Z ERROR Could not install pip
2022-02-12T08:42:33.245Z Error: Command failed: python3.6 /tmp/59bdc86b/get-pip.py --user
2022-02-12T08:42:33.245Z
2022-02-12T08:42:33.246Z ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.
2022-02-12T08:42:33.246Z
2022-02-12T08:42:33.246Z at makeError (/vercel/7aa035dc158d0642/.build-utils/.builder/node_modules/execa/index.js:174:9)
2022-02-12T08:42:33.246Z at /vercel/7aa035dc158d0642/.build-utils/.builder/node_modules/execa/index.js:278:16
2022-02-12T08:42:33.246Z at processTicksAndRejections (internal/process/task_queues.js:95:5)
2022-02-12T08:42:33.246Z at async Object.downloadAndInstallPip (/vercel/7aa035dc158d0642/.build-utils/.builder/node_modules/@ardnt/vercel-python-wsgi/build-utils/pip.js:35:17)
2022-02-12T08:42:33.247Z at async Object.exports.build (/vercel/7aa035dc158d0642/.build-utils/.builder/node_modules/@ardnt/vercel-python-wsgi/index.js:39:19)
2022-02-12T08:42:33.247Z at async Ttt (/var/task/sandbox.js:196:7754) {
2022-02-12T08:42:33.247Z code: 1,
2022-02-12T08:42:33.248Z stdout: 'ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.\n',
2022-02-12T08:42:33.248Z stderr: '',
2022-02-12T08:42:33.248Z failed: true,
2022-02-12T08:42:33.248Z signal: null,
2022-02-12T08:42:33.248Z cmd: 'python3.6 /tmp/59bdc86b/get-pip.py --user',
2022-02-12T08:42:33.248Z timedOut: false,
2022-02-12T08:42:33.248Z killed: false
2022-02-12T08:42:33.249Z }
2022-02-12T08:42:34.037Z
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.