diff --git a/docs/2-local-development/developing-locally.rst b/docs/2-local-development/developing-locally.rst index cfb4cb4e..85abf6b4 100644 --- a/docs/2-local-development/developing-locally.rst +++ b/docs/2-local-development/developing-locally.rst @@ -14,16 +14,6 @@ Make sure to have the following on your host: * Redis_, if using Celery * Cookiecutter_ -First things first. - -#. Create a virtualenv: :: - - $ python3.12 -m venv - -#. Activate the virtualenv you have just created: :: - - $ source /bin/activate - #. .. include:: generate-project-block.rst #. Install development requirements: :: @@ -31,7 +21,7 @@ First things first. $ cd $ uv sync $ git init # A git repo is required for pre-commit to install - $ pre-commit install + $ uv run pre-commit install .. note:: @@ -71,15 +61,15 @@ First things first. #. Apply migrations: :: - $ python manage.py migrate + $ uv run python manage.py migrate #. If you're running synchronously, see the application being served through Django development server: :: - $ python manage.py runserver 0.0.0.0:8000 + $ uv run python manage.py runserver 0.0.0.0:8000 or if you're running asynchronously: :: - $ uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html' + $ uv run uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html' If you've opted for Webpack or Gulp as frontend pipeline, please see the :ref:`dedicated section ` below. @@ -136,7 +126,7 @@ Following this structured approach, here's how to add a new app: #. **Create the app** using Django's ``startapp`` command, replacing ```` with your desired app name: :: - $ python manage.py startapp + $ uv run python manage.py startapp #. **Move the app** to the Django Project Root, maintaining the project's two-tier structure: :: @@ -203,14 +193,14 @@ Next, make sure `redis-server` is installed (per the `Getting started with Redis Start the Celery worker by running the following command in another terminal:: - $ celery -A config.celery_app worker --loglevel=info + $ uv run celery -A config.celery_app worker --loglevel=info That Celery worker should be running whenever your app is running, typically as a background process, so that it can pick up any tasks that get queued. Learn more from the `Celery Workers Guide`_. The project comes with a simple task for manual testing purposes, inside `/users/tasks.py`. To queue that task locally, start the Django shell, import the task, and call `delay()` on it:: - $ python manage.py shell + $ uv run python manage.py shell >> from .users.tasks import get_users_count >> get_users_count.delay()