Skip to content

Commit 87bb79c

Browse files
authored
Create django-uv-workflow.md
1 parent 59c991d commit 87bb79c

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

python/django-uv-workflow.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Django and UV workflow
2+
3+
Create a project folder
4+
5+
```
6+
mkdir django-uv-test
7+
```
8+
9+
Update uv:
10+
11+
```
12+
uv self update
13+
14+
```
15+
16+
Start uv project:
17+
18+
```
19+
uv init django-project --python 3.11
20+
21+
```
22+
23+
Add packages:
24+
25+
```
26+
cd django-project
27+
uv add Django django-extensions
28+
```
29+
30+
31+
Start Django project:
32+
33+
```
34+
uv run django-admin startproject myproject .
35+
```
36+
37+
38+
Run Django management commands:
39+
40+
```
41+
uv run manage.py runserver
42+
uv run manage.py startapp appname
43+
uv run manage.py makemigrations
44+
uv run manage.py migrate
45+
uv run manage.py shell_plus # from django-extensions
46+
```
47+
48+
49+
Working with development dependencies:
50+
51+
```
52+
uv add --dev black
53+
uv run black path\to\file.py
54+
```
55+
56+
57+
Deploying the project to production excluding dev dependencies:
58+
59+
```
60+
uv sync --no-dev
61+
```
62+
63+
64+
References
65+
66+
- [https://www.youtube.com/watch?v=hm-rDxSMzSw](https://www.youtube.com/watch?v=hm-rDxSMzSw)

0 commit comments

Comments
 (0)