An open API service indexing awesome lists of open source software.

https://github.com/illmilo/neondjango

Template repository setup for Vercel projects based on Django & Neon DB.
https://github.com/illmilo/neondjango

django neon postgresql python serverless template vercel

Last synced: about 2 months ago
JSON representation

Template repository setup for Vercel projects based on Django & Neon DB.

Awesome Lists containing this project

README

          

# NeonDjango

Template repository to deploy Django projects with PostgreSQL serverless (NeonDB) integration on Vercel.

## Requirements

- Vercel-CLI
- Django

## Usage

1. Use this repository as a template to create your new GitHub repository
2. Clone your new repository with `git clone`
3. Copy & paste files `vercel.json`, `build.sh`, `.gitignore`, `requirements.txt` (if you have one, copy & paste content of the file to your existing file)
4. Activate `venv`
5. `pip install -r requirements.txt`
6. Open `settings.py` of both projects
7. Copy & paste variables `ALLOWED_HOSTS`, `DEBUG`, `DATABASES`, `STATIC_URL`, `STATICFILES_DIRS`, `STATIC_ROOT`
8. Copy & paste imports
9. Replace `neondjango` with your project name in `STATICFILES_DIRS` variable
10. Place **all the static files** inside `$rootApplicationFolder$/static`
11. In `wsgi.py`, put `app = application` in the end of the file
12. In `vercel.json`, replace `neondjango` with the name of your project
13. `python manage.py migrate`
14. `python manage.py createsuperuser` (if needed)
15. `vercel`

View [this YouTube video tutorial](https://neondjango.vercel.app). It shows the same procedure in a more convenient way.

If everything's fine in preview, you can deploy it to production via `git push` or `vercel --prod`.

> Preview logs might indicate the absence of `requirements.txt`, ignore it. You should only care about `Inspect` page `Logs` & output of `Preview` page

> MAKE SURE THAT `.env` IS ADDED TO YOUR `.gitignore` FILE!

## License
This project is licensed under MIT License. Feel free to use this template. See [LICENSE](license) to learn more.