Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide for healthchecks #1738

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add venv prefix for each command that requires the venv
MetroMarv committed Jan 19, 2025
commit 7102fa778629ad0b33ca16c2cf38fc1610702b39
14 changes: 7 additions & 7 deletions source/guide_healthchecks.rst
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ later.

[isabell@stardust ~]$ python3.11 -m venv venv
[isabell@stardust ~]$ source venv/bin/activate
[isabell@stardust ~]$ pip3.11 install -r requirements.txt
(venv) [isabell@stardust ~]$ pip3.11 install -r requirements.txt
Collecting aiosmtpd==1.4.4.post2 (from -r requirements.txt (line 1))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to keep all the log output from that command? Or should I somehow abbreviate it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty long, please abbreviate it like in the Kimai Guide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abbreviate it now. Could you resolve the conversation if you like it?

Obtaining dependency information for aiosmtpd==1.4.4.post2 from https://files.pythonhosted.org/packages/ef/b3/f4cce9da53b02aa7d4c0662ca344421023feefc5c8f815b90d1c7514702e/aiosmtpd-1.4.4.post2-py3-none-any.whl.metadata
Downloading aiosmtpd-1.4.4.post2-py3-none-any.whl.metadata (6.8 kB)
@@ -334,7 +334,7 @@ Once we set the correct settings we can initialize the database:

::

[isabell@stardust ~]$ python3.11 ./manage.py migrate
(venv) [isabell@stardust ~]$ python3.11 ./manage.py migrate
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (and also in some of the following listings) I assume that the user is still in the active virtualenv. Do you want me to repeat the source venv/bin/activate command before each of the commands requiring the virtualenv?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. If this was my guide I would provide a note before the first use of the venv with something like that:

.. note:: All following commands require the virtualenv, you can activate it with ``source venv/bin/activate`` in a new SSH-session

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefixed all the commands that require a virtual env with (venv). I assume that's clear for every reader.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for me:

(venv) [isabell@stardust healthchecks]$ python3.11 ./manage.py migrate
Traceback (most recent call last):
  File "/home/isabell/apps/healthchecks/./manage.py", line 9, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

System check identified some issues:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again long log output that could be abbreviated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it makes sense to abbreviate, there is no upside in keeping all of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abbreviated.


WARNINGS:
@@ -537,12 +537,12 @@ the email, if you do not plan to use it inside Django. You should pick a decent
.. code-block:: console
:emphasize-lines: 2,3,4

[isabell@stardust ~]$ python3.11 ./manage.py createsuperuser
(venv) [isabell@stardust ~]$ python3.11 ./manage.py createsuperuser
Email address:isabell@uber.space
Password:
Password (again):
Superuser created successfully.
[isabell@stardust ~]$
(venv) [isabell@stardust ~]$

Generate static files
-----------------
@@ -551,12 +551,12 @@ Healthchecks uses a couple of static files. We need to generate this as follows:

::

[isabell@stardust ~]$ python3.11 ./manage.py collectstatic
(venv) [isabell@stardust ~]$ python3.11 ./manage.py collectstatic
347 static files copied to '/home/isabell/apps/healthchecks/static-collected'.
[isabell@stardust ~]$ python3.11 ./manage.py compress
(venv) [isabell@stardust ~]$ python3.11 ./manage.py compress
Compressing... done
Compressed 26 block(s) from 147 template(s) for 1 context(s).
[isabell@stardust ~]$
(venv) [isabell@stardust ~]$

Set up the daemons
-----------------