Skip to content

Deploy a Django app, blazing fast, using uv on Clever Cloud

Notifications You must be signed in to change notification settings

CleverCloud/python-django-uv-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django with Uvicorn deployed from uv on Clever Cloud

You'll need a Clever Cloud account and Clever Tools to deploy this application, using our Python image now including uv.

Clone this repository and configure a Clever Cloud application

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:

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.

About

Deploy a Django app, blazing fast, using uv on Clever Cloud

Topics

Resources

Stars

Watchers

Forks

Languages