You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

412 lines
16 KiB

10 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
5 years ago
update Readme with pip install dependencies pip install will fail when you cannot compile some of the dependencies. one is gcc the other is the Python.h ``` Building wheels for collected packages: rcssmin, rjsmin Running setup.py bdist_wheel for rcssmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rcssmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-u0q6mggl --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rcssmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rcssmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rcssmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rcssmin.c -o build/temp.linux-x86_64-3.6/rcssmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for rcssmin Running setup.py clean for rcssmin Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-axnaq3w9 --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ``` ``` Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-cfntw7bo/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ytqxu9_b --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:10: fatal error: Python.h: No such file or directory #include "Python.h" ^~~~~~~~~~ compilation terminated. ```
6 years ago
update Readme with pip install dependencies pip install will fail when you cannot compile some of the dependencies. one is gcc the other is the Python.h ``` Building wheels for collected packages: rcssmin, rjsmin Running setup.py bdist_wheel for rcssmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rcssmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-u0q6mggl --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rcssmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rcssmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rcssmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rcssmin.c -o build/temp.linux-x86_64-3.6/rcssmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for rcssmin Running setup.py clean for rcssmin Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-axnaq3w9 --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ``` ``` Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-cfntw7bo/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ytqxu9_b --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:10: fatal error: Python.h: No such file or directory #include "Python.h" ^~~~~~~~~~ compilation terminated. ```
6 years ago
10 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Healthchecks
  2. ![Build Status](https://github.com/healthchecks/healthchecks/workflows/Django%20CI/badge.svg)
  3. [![Coverage Status](https://coveralls.io/repos/healthchecks/healthchecks/badge.svg?branch=master&service=github)](https://coveralls.io/github/healthchecks/healthchecks?branch=master)
  4. ![Screenshot of My Checks page](/static/img/my_checks.png?raw=true "My Checks Page")
  5. ![Screenshot of Period/Grace dialog](/static/img/period_grace.png?raw=true "Period/Grace Dialog")
  6. ![Screenshot of Cron dialog](/static/img/cron.png?raw=true "Cron Dialog")
  7. ![Screenshot of Check Details page](/static/img/check_details.png?raw=true "My Checks Page")
  8. ![Screenshot of Badges page](/static/img/badges.png?raw=true "Integrations Page")
  9. Healthchecks is a cron job monitoring service. It listens for HTTP requests
  10. and email messages ("pings") from your cron jobs and scheduled tasks ("checks").
  11. When a ping does not arrive on time, Healthchecks sends out alerts.
  12. Healthchecks comes with a web dashboard, API, 25+ integrations for
  13. delivering notifications, monthly email reports, WebAuthn 2FA support,
  14. team management features: projects, team members, read-only access.
  15. The building blocks are:
  16. * Python 3.6+
  17. * Django 3
  18. * PostgreSQL or MySQL
  19. Healthchecks is licensed under the BSD 3-clause license.
  20. Healthchecks is available as a hosted service
  21. at [https://healthchecks.io/](https://healthchecks.io/).
  22. ## Setting Up for Development
  23. To set up Healthchecks development environment:
  24. * Install dependencies (Debian/Ubuntu):
  25. $ sudo apt-get update
  26. $ sudo apt-get install -y gcc python3-dev python3-venv libpq-dev
  27. * Prepare directory for project code and virtualenv. Feel free to use a
  28. different location:
  29. $ mkdir -p ~/webapps
  30. $ cd ~/webapps
  31. * Prepare virtual environment
  32. (with virtualenv you get pip, we'll use it soon to install requirements):
  33. $ python3 -m venv hc-venv
  34. $ source hc-venv/bin/activate
  35. $ pip3 install wheel # make sure wheel is installed in the venv
  36. * Check out project code:
  37. $ git clone https://github.com/healthchecks/healthchecks.git
  38. * Install requirements (Django, ...) into virtualenv:
  39. $ pip install -r healthchecks/requirements.txt
  40. * Create database tables and a superuser account:
  41. $ cd ~/webapps/healthchecks
  42. $ ./manage.py migrate
  43. $ ./manage.py createsuperuser
  44. With the default configuration, Healthchecks stores data in a SQLite file
  45. `hc.sqlite` in the checkout directory (`~/webapps/healthchecks`).
  46. To use PostgreSQL or MySQL, see the section **Database Configuration** section
  47. below.
  48. * Run tests:
  49. $ ./manage.py test
  50. * Run development server:
  51. $ ./manage.py runserver
  52. The site should now be running at `http://localhost:8000`.
  53. To access Django administration site, log in as a superuser, then
  54. visit `http://localhost:8000/admin/`
  55. ## Configuration
  56. Healthchecks reads configuration from environment variables.
  57. [Full list of configuration parameters](https://healthchecks.io/docs/self_hosted_configuration/).
  58. ## Accessing Administration Panel
  59. Healthchecks comes with Django's administration panel where you can manually
  60. view and modify user accounts, projects, checks, integrations etc. To access it,
  61. * if you haven't already, create a superuser account: `./manage.py createsuperuser`
  62. * log into the site using superuser credentials
  63. * in the top navigation, "Account" dropdown, select "Site Administration"
  64. ## Sending Emails
  65. Healthchecks must be able to send email messages, so it can send out login
  66. links and alerts to users. Specify your SMTP credentials using the following
  67. environment variables:
  68. ```python
  69. EMAIL_HOST = "your-smtp-server-here.com"
  70. EMAIL_PORT = 587
  71. EMAIL_HOST_USER = "smtp-username"
  72. EMAIL_HOST_PASSWORD = "smtp-password"
  73. EMAIL_USE_TLS = True
  74. ```
  75. For more information, have a look at Django documentation,
  76. [Sending Email](https://docs.djangoproject.com/en/1.10/topics/email/) section.
  77. ## Receiving Emails
  78. Healthchecks comes with a `smtpd` management command, which starts up a
  79. SMTP listener service. With the command running, you can ping your
  80. checks by sending email messages
  81. to `[email protected]` email addresses.
  82. Start the SMTP listener on port 2525:
  83. $ ./manage.py smtpd --port 2525
  84. Send a test email:
  85. $ curl --url 'smtp://127.0.0.1:2525' \
  86. --mail-from '[email protected]' \
  87. --mail-rcpt '[email protected]' \
  88. -F '='
  89. ## Sending Status Notifications
  90. healtchecks comes with a `sendalerts` management command, which continuously
  91. polls database for any checks changing state, and sends out notifications as
  92. needed. Within an activated virtualenv, you can manually run
  93. the `sendalerts` command like so:
  94. $ ./manage.py sendalerts
  95. In a production setup, you will want to run this command from a process
  96. manager like [supervisor](http://supervisord.org/) or systemd.
  97. ## Database Cleanup
  98. Healthchecks deletes old entries from `api_ping` and `api_notification`
  99. tables automatically. By default, Healthchecks keeps the 100 most recent
  100. pings for every check. You can set the limit higher to keep a longer history:
  101. go to the Administration Panel, look up user's **Profile** and modify its
  102. "Ping log limit" field.
  103. For each check, Healthchecks removes notifications that are older than the
  104. oldest stored ping for same check.
  105. Healthchecks also provides management commands for cleaning up
  106. `auth_user`, `api_tokenbucket` and `api_flip` tables.
  107. * Remove user accounts that match either of these conditions:
  108. * Account was created more than 6 months ago, and user has never logged in.
  109. These can happen when user enters invalid email address when signing up.
  110. * Last login was more than 6 months ago, and the account has no checks.
  111. Assume the user doesn't intend to use the account any more and would
  112. probably *want* it removed.
  113. ```
  114. $ ./manage.py pruneusers
  115. ```
  116. * Remove old records from the `api_tokenbucket` table. The TokenBucket
  117. model is used for rate-limiting login attempts and similar operations.
  118. Any records older than one day can be safely removed.
  119. ```
  120. $ ./manage.py prunetokenbucket
  121. ```
  122. * Remove old records from the `api_flip` table. The Flip
  123. objects are used to track status changes of checks, and to calculate
  124. downtime statistics month by month. Flip objects from more than 3 months
  125. ago are not used and can be safely removed.
  126. ```
  127. $ ./manage.py pruneflips
  128. ```
  129. When you first try these commands on your data, it is a good idea to
  130. test them on a copy of your database, not on the live database right away.
  131. In a production setup, you should also have regular, automated database
  132. backups set up.
  133. ## Two-factor Authentication
  134. Healthchecks optionally supports two-factor authentication using the WebAuthn
  135. standard. To enable WebAuthn support, set the `RP_ID` (relying party identifier )
  136. setting to a non-null value. Set its value to your site's domain without scheme
  137. and without port. For example, if your site runs on `https://my-hc.example.org`,
  138. set `RP_ID` to `my-hc.example.org`.
  139. Note that WebAuthn requires HTTPS, even if running on localhost. To test WebAuthn
  140. locally with a self-signed certificate, you can use the `runsslserver` command
  141. from the `django-sslserver` package.
  142. ## External Authentication
  143. Healthchecks supports external authentication by means of HTTP headers set by
  144. reverse proxies or the WSGI server. This allows you to integrate it into your
  145. existing authentication system (e.g., LDAP or OAuth) via an authenticating proxy.
  146. When this option is enabled, **healtchecks will trust the header's value implicitly**,
  147. so it is **very important** to ensure that attackers cannot set the value themselves
  148. (and thus impersonate any user). How to do this varies by your chosen proxy,
  149. but generally involves configuring it to strip out headers that normalize to the
  150. same name as the chosen identity header.
  151. To enable this feature, set the `REMOTE_USER_HEADER` value to a header you wish to
  152. authenticate with. HTTP headers will be prefixed with `HTTP_` and have any dashes
  153. converted to underscores. Headers without that prefix can be set by the WSGI server
  154. itself only, which is more secure.
  155. When `REMOTE_USER_HEADER` is set, Healthchecks will:
  156. - assume the header contains user's email address
  157. - look up and automatically log in the user with a matching email address
  158. - automatically create an user account if it does not exist
  159. - disable the default authentication methods (login link to email, password)
  160. ## Integrations
  161. ### Slack
  162. To enable the Slack "self-service" integration, you will need to create a "Slack App".
  163. To do so:
  164. * Create a _new Slack app_ on https://api.slack.com/apps/
  165. * Add at least _one scope_ in the permissions section to be able to deploy the app in your workspace (By example `incoming-webhook` for the `Bot Token Scopes`
  166. https://api.slack.com/apps/APP_ID/oauth?).
  167. * Add a _redirect url_ in the format `SITE_ROOT/integrations/add_slack_btn/`.
  168. For example, if your SITE_ROOT is `https://my-hc.example.org` then the redirect URL would be
  169. `https://my-hc.example.org/integrations/add_slack_btn/`.
  170. * Look up your Slack app for the Client ID and Client Secret at https://api.slack.com/apps/APP_ID/general? . Put them
  171. in `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` environment
  172. variables.
  173. ### Discord
  174. To enable Discord integration, you will need to:
  175. * register a new application on https://discordapp.com/developers/applications/me
  176. * add a redirect URI to your Discord application. The URI format is
  177. `SITE_ROOT/integrations/add_discord/`. For example, if you are running a
  178. development server on `localhost:8000` then the redirect URI would be
  179. `http://localhost:8000/integrations/add_discord/`
  180. * Look up your Discord app's Client ID and Client Secret. Put them
  181. in `DISCORD_CLIENT_ID` and `DISCORD_CLIENT_SECRET` environment
  182. variables.
  183. ### Pushover
  184. Pushover integration works by creating an application on Pushover.net which
  185. is then subscribed to by Healthchecks users. The registration workflow is as follows:
  186. * On Healthchecks, the user adds a "Pushover" integration to a project
  187. * Healthchecks redirects user's browser to a Pushover.net subscription page
  188. * User approves adding the Healthchecks subscription to their Pushover account
  189. * Pushover.net HTTP redirects back to Healthchecks with a subscription token
  190. * Healthchecks saves the subscription token and uses it for sending Pushover
  191. notifications
  192. To enable the Pushover integration, you will need to:
  193. * Register a new application on Pushover via https://pushover.net/apps/build.
  194. * Within the Pushover 'application' configuration, enable subscriptions.
  195. Make sure the subscription type is set to "URL". Also make sure the redirect
  196. URL is configured to point back to the root of the Healthchecks instance
  197. (e.g., `http://healthchecks.example.com/`).
  198. * Put the Pushover application API Token and the Pushover subscription URL in
  199. `PUSHOVER_API_TOKEN` and `PUSHOVER_SUBSCRIPTION_URL` environment
  200. variables. The Pushover subscription URL should look similar to
  201. `https://pushover.net/subscribe/yourAppName-randomAlphaNumericData`.
  202. ### Signal
  203. Healthchecks uses [signal-cli](https://github.com/AsamK/signal-cli) to send Signal
  204. notifications. Healthcecks interacts with signal-cli over DBus.
  205. To enable the Signal integration:
  206. * Set up and configure signal-cli to listen on DBus system bus ([instructions](https://github.com/AsamK/signal-cli/wiki/DBus-service)).
  207. Make sure you can send test messages from command line, using the `dbus-send`
  208. example given in the signal-cli instructions.
  209. * Set the `SIGNAL_CLI_ENABLED` environment variable to `True`.
  210. ### Telegram
  211. * Create a Telegram bot by talking to the
  212. [BotFather](https://core.telegram.org/bots#6-botfather). Set the bot's name,
  213. description, user picture, and add a "/start" command.
  214. * After creating the bot you will have the bot's name and token. Put them
  215. in `TELEGRAM_BOT_NAME` and `TELEGRAM_TOKEN` environment variables.
  216. * Run `settelegramwebhook` management command. This command tells Telegram
  217. where to forward channel messages by invoking Telegram's
  218. [setWebhook](https://core.telegram.org/bots/api#setwebhook) API call:
  219. ```
  220. $ ./manage.py settelegramwebhook
  221. Done, Telegram's webhook set to: https://my-monitoring-project.com/integrations/telegram/bot/
  222. ```
  223. For this to work, your `SITE_ROOT` needs to be correct and use "https://"
  224. scheme.
  225. ### Apprise
  226. To enable Apprise integration, you will need to:
  227. * ensure you have apprise installed in your local environment:
  228. ```bash
  229. pip install apprise
  230. ```
  231. * enable the apprise functionality by setting the `APPRISE_ENABLED` environment variable.
  232. ### Shell Commands
  233. The "Shell Commands" integration runs user-defined local shell commands when checks
  234. go up or down. This integration is disabled by default, and can be enabled by setting
  235. the `SHELL_ENABLED` environment variable to `True`.
  236. Note: be careful when using "Shell Commands" integration, and only enable it when
  237. you fully trust the users of your Healthchecks instance. The commands will be executed
  238. by the `manage.py sendalerts` process, and will run with the same system permissions as
  239. the `sendalerts` process.
  240. ### Matrix
  241. To enable the Matrix integration you will need to:
  242. * Register a bot user (for posting notifications) in your preferred homeserver.
  243. * Use the [Login API call](https://www.matrix.org/docs/guides/client-server-api#login)
  244. to retrieve bot user's access token. You can run it as shown in the documentation,
  245. using curl in command shell.
  246. * Set the `MATRIX_` environment variables. Example:
  247. ```
  248. MATRIX_HOMESERVER=https://matrix.org
  249. MATRIX_USER_ID=@mychecks:matrix.org
  250. MATRIX_ACCESS_TOKEN=[a long string of characters returned by the login call]
  251. ```
  252. ### PagerDuty Simple Install Flow
  253. To enable PagerDuty [Simple Install Flow](https://developer.pagerduty.com/docs/app-integration-development/events-integration/),
  254. * Register a PagerDuty app at [PagerDuty](https://pagerduty.com/) › Developer Mode › My Apps
  255. * In the newly created app, add the "Events Integration" functionality
  256. * Specify a Redirect URL: `https://your-domain.com/integrations/add_pagerduty/`
  257. * Copy the displayed app_id value (PXXXXX) and put it in the `PD_APP_ID` environment
  258. variable
  259. ## Running in Production
  260. Here is a non-exhaustive list of pointers and things to check before launching a Healthchecks instance
  261. in production.
  262. * Environment variables, settings.py and local_settings.py.
  263. * [DEBUG](https://docs.djangoproject.com/en/2.2/ref/settings/#debug). Make sure it is
  264. set to `False`.
  265. * [ALLOWED_HOSTS](https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts).
  266. Make sure it contains the correct domain name you want to use.
  267. * Server Errors. When DEBUG=False, Django will not show detailed error pages, and
  268. will not print exception tracebacks to standard output. To receive exception
  269. tracebacks in email, review and edit the
  270. [ADMINS](https://docs.djangoproject.com/en/2.2/ref/settings/#admins) and
  271. [SERVER_EMAIL](https://docs.djangoproject.com/en/2.2/ref/settings/#server-email)
  272. settings. Consider setting up exception logging with [Sentry](https://sentry.io/for/django/).
  273. * Management commands that need to be run during each deployment.
  274. * `manage.py compress` – creates combined JS and CSS bundles and
  275. places them in the `static-collected` directory.
  276. * `manage.py collectstatic` – collects static files in the `static-collected`
  277. directory.
  278. * `manage.py migrate` – applies any pending database schema changes
  279. and data migrations.
  280. * Processes that need to be running constantly.
  281. * `manage.py runserver` is intended for development only.
  282. **Do not use it in production**, instead consider using
  283. [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) or
  284. [gunicorn](https://gunicorn.org/).
  285. * `manage.py sendalerts` is the process that monitors checks and sends out
  286. monitoring alerts. It must be always running, it must be started on reboot, and it
  287. must be restarted if it itself crashes. On modern linux systems, a good option is
  288. to [define a systemd service](https://github.com/healthchecks/healthchecks/issues/273#issuecomment-520560304)
  289. for it.
  290. * Static files. Healthchecks serves static files on its own, no configuration
  291. required. It uses the [Whitenoise library](http://whitenoise.evans.io/en/stable/index.html)
  292. for this.
  293. * General
  294. * Make sure the database is secured well and is getting backed up regularly
  295. * Make sure the TLS certificates are secured well and are getting refreshed regularly
  296. * Have monitoring in place to be sure the Healthchecks instance itself is operational
  297. (is accepting pings, is sending out alerts, is not running out of resources).