Skip to content

Commit f57c2f9

Browse files
committed
Update local development docs
1 parent 4274147 commit f57c2f9

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

docs/2-local-development/developing-locally.rst

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,14 @@ Make sure to have the following on your host:
1414
* Redis_, if using Celery
1515
* Cookiecutter_
1616

17-
First things first.
18-
19-
#. Create a virtualenv: ::
20-
21-
$ python3.12 -m venv <virtual env path>
22-
23-
#. Activate the virtualenv you have just created: ::
24-
25-
$ source <virtual env path>/bin/activate
26-
2717
#. .. include:: generate-project-block.rst
2818

2919
#. Install development requirements: ::
3020

3121
$ cd <what you have entered as the project_slug at setup stage>
3222
$ uv sync
3323
$ git init # A git repo is required for pre-commit to install
34-
$ pre-commit install
24+
$ uv run pre-commit install
3525

3626
.. note::
3727

@@ -71,15 +61,15 @@ First things first.
7161

7262
#. Apply migrations: ::
7363

74-
$ python manage.py migrate
64+
$ uv run python manage.py migrate
7565

7666
#. If you're running synchronously, see the application being served through Django development server: ::
7767

78-
$ python manage.py runserver 0.0.0.0:8000
68+
$ uv run python manage.py runserver 0.0.0.0:8000
7969

8070
or if you're running asynchronously: ::
8171

82-
$ uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
72+
$ uv run uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
8373

8474
If you've opted for Webpack or Gulp as frontend pipeline, please see the :ref:`dedicated section <bare-metal-webpack-gulp>` below.
8575

@@ -136,7 +126,7 @@ Following this structured approach, here's how to add a new app:
136126

137127
#. **Create the app** using Django's ``startapp`` command, replacing ``<name-of-the-app>`` with your desired app name: ::
138128

139-
$ python manage.py startapp <name-of-the-app>
129+
$ uv run python manage.py startapp <name-of-the-app>
140130

141131
#. **Move the app** to the Django Project Root, maintaining the project's two-tier structure: ::
142132

@@ -203,14 +193,14 @@ Next, make sure `redis-server` is installed (per the `Getting started with Redis
203193

204194
Start the Celery worker by running the following command in another terminal::
205195

206-
$ celery -A config.celery_app worker --loglevel=info
196+
$ uv run celery -A config.celery_app worker --loglevel=info
207197

208198
That Celery worker should be running whenever your app is running, typically as a background process,
209199
so that it can pick up any tasks that get queued. Learn more from the `Celery Workers Guide`_.
210200

211201
The project comes with a simple task for manual testing purposes, inside `<project_slug>/users/tasks.py`. To queue that task locally, start the Django shell, import the task, and call `delay()` on it::
212202

213-
$ python manage.py shell
203+
$ uv run python manage.py shell
214204
>> from <project_slug>.users.tasks import get_users_count
215205
>> get_users_count.delay()
216206

0 commit comments

Comments
 (0)