https://github.com/clevercloud/python-django-uv-example
Deploy a Django app, blazing fast, using uv on Clever Cloud
https://github.com/clevercloud/python-django-uv-example
clevercloud-example python runtime
Last synced: 8 months ago
JSON representation
Deploy a Django app, blazing fast, using uv on Clever Cloud
- Host: GitHub
- URL: https://github.com/clevercloud/python-django-uv-example
- Owner: CleverCloud
- Created: 2024-12-09T11:43:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-09T12:36:55.000Z (over 1 year ago)
- Last Synced: 2025-09-30T05:48:42.662Z (9 months ago)
- Topics: clevercloud-example, python, runtime
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django with Uvicorn deployed from `uv` on Clever Cloud
You'll need a Clever Cloud account and [Clever Tools](https://github.com/CleverCloud/clever-tools/) to deploy this application, using our Python image [now including](https://developers.clever-cloud.com/changelog/2024-10-01-python-image-changes/) `uv`.
## Clone this repository and configure a Clever Cloud application
```bash
git clone https://github.com/CleverCloud/python-django-uv-example.git
cd python-django-uv-example
clever create -t python
clever env set CC_RUN_COMMAND "uv run -- uvicorn --host 0.0.0.0 --port 9000 myDjango.asgi:application"
clever deploy && clever open
```
## How this app was created
To create the same app as this one on a machine with `uv` installed, you can use the following commands:
```bash
uv init myDjango --no-readme # Create a new uv project
cd myDjango && rm hello.py # Enters the project and clean it
uv add django uvicorn # Adds Django and Uvicorn to dependencies
uv run django-admin startproject myDjango . # Creates the Django project in the current directory
```
Edit `myDjango/settings.py` to add `ALLOWED_HOSTS` (`*` in this example), change secret key, etc. Commit changes to the local git repository, and then you can create and deploy this app on Clever Cloud as mentioned above.