Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.9 KB

File metadata and controls

43 lines (28 loc) · 1.9 KB

Using Frameworks with usethis

If you are adopting a specific framework like Django, FastAPI, or Dagster, the following approaches may be useful to you. They require that you have uv installed. Please open an issue is you use a framework which is not listed below.

Django

Django has a built-in initialization command. It is recommended that you run the following sequence of commands to initialize a new Django project with usethis.

You should replace myproject with the name of your project, and run these commands from a new, empty directory (usually sharing your project name and set as the git repository root).

uvx --from django django-admin startproject myproject .
uv init --bare
uv add django
usethis init

You will be able to run the server with uv run manage.py runserver.

FastAPI

FastAPI has an official CLI tool for initializing new projects called fastapi-new which you can use alongside usethis.

You should replace myproject with the name of your project, and run these commands from a new, empty directory (usually sharing your project name and set as the git repository root).

uvx fastapi-new myproject .
uvx usethis init

You will then be able to run the server with uv run fastapi dev.

Dagster

Dagster has an official CLI tool for initializing new projects called create-dagster which you can use alongside usethis.

You should run these commands from a new, empty directory (usually sharing your project name and set as the git repository root).

uvx create-dagster project .
# At this point you will be prompted whether you want to use uv; answer 'y'.
uvx usethis init