@@ -20,76 +20,75 @@ Start a local multi-container application with Postgres, Redis, Celery, and Djan
2020
2121 $ make dockerserve
2222
23- To get a shell into the Django container where you can run ``./manage.py createsuperuser ``,
23+ To get a shell into the Django container where you can run ``uv run ./manage.py createsuperuser ``,
2424get a Django shell, or run other commands:
2525
2626.. code-block :: bash
2727
2828 $ make dockershell
2929 ...
30- /app # ./manage.py createsuperuser
30+ /app # uv run ./manage.py createsuperuser
3131
3232 After setting up your super user account on your local development instance,
3333you'll still need to set the :ref: `install/installation:Set the ad server URL `
3434to something like ``localhost:5000 ``.
3535
3636
37- Developing locally
38- ------------------
37+ Development tips
38+ ----------------
3939
4040Docker compose is the recommended way to do development consistently.
41- This section is more to document steps than to encourage you to develop outside of Docker.
41+ This step documents commands for code style, building static assets, and more.
42+ These commands can be run inside Docker (``make dockershell ``).
4243
4344Requirements
4445~~~~~~~~~~~~
4546
46- - Python 3.12
47+ - ` uv < https://docs.astral.sh/uv/getting-started/installation/ >`_
4748- Nodejs (tested with v20)
4849
49- Front-end assets
50- ~~~~~~~~~~~~~~~~
5150
52- To build the assets::
51+ Managing the ad server and setup
52+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5353
54- $ npm clean-install
55- $ npm run build
56-
57- Install Python dependencies
58- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
59-
60- First, install uv if you haven't already:
54+ Run migrations:
6155
6256.. code-block :: bash
6357
64- $ curl -LsSf https://astral.sh/uv/install.sh | sh
58+ $ uv run ./manage.py migrate
6559
66- Then install dependencies :
60+ Create a superuser :
6761
6862.. code-block :: bash
6963
70- $ uv sync --all-extras # Install all dependencies including dev tools
71- $ uv run pre-commit install # Install a code style pre-commit hook
64+ $ uv run ./manage.py createsuperuser
7265
73- Run the server
74- ~~~~~~~~~~~~~~
66+ Front-end assets
67+ ~~~~~~~~~~~~~~~~
7568
76- Run migrations :
69+ To build the assets: :
7770
7871.. code-block :: bash
7972
80- $ uv run ./manage.py migrate
73+ $ npm clean-install
74+ $ npm run build
8175
82- Create a superuser:
76+ Pre-commit and code style
77+ ~~~~~~~~~~~~~~~~~~~~~~~~~
78+
79+ Setup pre-commit:
8380
8481.. code-block :: bash
8582
86- $ uv run ./manage.py createsuperuser
83+ $ uv tool install pre-commit --with pre-commit-uv
84+ $ uvx pre-commit install # Install a code style pre-commit hook
8785
88- Run the server :
86+ You can run all code style checks with teh following :
8987
9088.. code-block :: bash
9189
92- $ uv run ./manage.py runserver
90+ $ uvx pre-commit run --all-files
91+
9392
9493 Running the tests
9594-----------------
@@ -105,4 +104,4 @@ Run a specific test:
105104
106105.. code-block :: bash
107106
108- $ tox -e py3 -- adserver/auth/tests.py
107+ $ tox -e py3 -- adserver/auth/tests.py
0 commit comments