You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,25 @@ To get all static files, the image runs the command:
59
59
Lastly, the image will start the production server with the command:
60
60
`uv run gunicorn djangoapp.wsgi:application --bind 0.0.0.0:8000 --workers 3 --log-level info`
61
61
62
+
### Common tasks (using uv)
63
+
64
+
- Create a superuser
65
+
`uv run python manage.py createsuperuser`
66
+
67
+
- Run migrations
68
+
`uv run python manage.py migrate`
69
+
70
+
- Switch the database to Postgres instead of SQLite
71
+
1. Install the Postgres driver (already present in `pyproject.toml`, but if missing run `uv add "psycopg2-binary"`).
72
+
2. In `djangoapp/settings.py`, set `DATABASES["default"]` to read from `DATABASE_URL` (e.g. using `env.dj_db_url` if `environs[django]` is installed). A typical value:
Copy file name to clipboardExpand all lines: djangoapp/settings.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,9 @@
29
29
# THIS KEY IS UNSAFE AND ONLY MEANT TO BE USED WHEN TESTING, generate your own SECRET_KEY. You can use https://djecrety.ir/ to generate a new SECRET_KEY
0 commit comments