diff --git a/docs/dev/01_setup.rst b/docs/dev/01_setup.rst index c036f5c831a0b18f0c43bbb71a75b6b5edb475b0..8d4cd0d8b9cfae6c631d7803eec7565274f5149d 100644 --- a/docs/dev/01_setup.rst +++ b/docs/dev/01_setup.rst @@ -9,6 +9,7 @@ Poetry makes a lot of stuff very easy, especially managing a virtual environment that contains BiscuIT and everything you need to run the framework and selected apps. +Also, `Yarn`_ is needed to resolve JavaScript dependencies. Get the source tree ------------------- @@ -16,7 +17,7 @@ Get the source tree To download BiscuIT and all officially bundled apps in their development version, use Git like so:: - git clone --recurse-submodules https://edugit.org/Teckids/BiscuIT/BiscuIT-ng + git clone --recurse-submodules https://edugit.org/BiscuIT/BiscuIT-ng If you do not want to download the bundled apps, leave out the ``--recurse-submodules`` option. @@ -45,13 +46,36 @@ installing BiscuIT is a matter of:: poetry install -Running commands in the virtual environment -------------------------------------------- +Regular tasks +------------- -To run commands in the virtual environment, use Poetry's ``run`` -command:: +After making changes to the environment, e.g. installing apps or updates, +some maintenance tasks need to be done: - poetry run ./manage.py runserver +1. Download and install JavaScript dependencies +2. Collect static files +3. Run database migrations + +All three steps can be done with the ``poetry run`` command and +``manage.py``:: + + poetry run ./manage.py yarn install + poetry run ./manage.py collectstatic + poetry run ./manage.py migrate + +(You might need database settings for the `migrate` command; see below.) + +Running the development server +------------------------------ + +The development server can be started using Django's ``runserver`` command. +You can either configure BiscuIT like in a production environment, or pass +basic settings in as environment variable. Here is an example that runs the +development server against a local PostgreSQL database with password +`biscuit` (all else remains default) and with the `debug` setting enabled:: + + BISCUIT_debug=true BISCUIT_database__password=biscuit poetry run ./manage.py runserver .. _Poetry: https://poetry.eustace.io/ .. _Poetry installation methods: https://poetry.eustace.io/docs/#installation +.. _Yarn: https://yarnpkg.com diff --git a/docs/dev/02_install_apps.rst b/docs/dev/02_install_apps.rst index 9ecfcc595f24cf6a6577264aea617ce2088c1c37..b083baf6cb5710db1a84a7cb8255ee678e9db07e 100644 --- a/docs/dev/02_install_apps.rst +++ b/docs/dev/02_install_apps.rst @@ -17,11 +17,5 @@ This will install the Exlibris app (library management) app by using a shell for first ``cd``'ing into the app directory and then using poetry to install the app. - -Migrate the database --------------------- - -After installing or updating any apps, the database must be updated as -well by running Django's ``migrate`` command:: - - poetry run ./manage.py migrate +DO not forget to run the maintenance tasks described earlier after +installign any app. diff --git a/docs/dev/03_run.rst b/docs/dev/03_run.rst deleted file mode 100644 index ab28dc471cf7d90a74a1602c5eb5a571d131797a..0000000000000000000000000000000000000000 --- a/docs/dev/03_run.rst +++ /dev/null @@ -1,10 +0,0 @@ -Running BiscuIT in development mode -=================================== - -Using Django's development server ---------------------------------- - -After you installed the framework and all desired apps and migrated -the database, you are ready to run BiscuIT:: - - poetry run ./manage.py runserver