Development tools

This page describes development-specific URLs and commands that may come in handy. Make sure your development server is running when you visit the pages linked below.

General

URL Command Description
/devtools/integrations None needed Test incoming webhook integrations
/emails None needed View outgoing and example emails.
/digest None needed View sample digest email.
/docs/index.html ./tools/build-docs Developer and production documentation (ReadTheDocs) built locally
/stats/realm/analytics/ ./manage.py populate_analytics_db
Run the command after changing analytics data population logic.
View the /stats page with some pre-populated data

Design system

URL Description
/devtools/buttons Test button styles
/devtools/banners Test banner styles
/devtools/inputs Test input styles

Test coverage

URL Command Description
/coverage/index.html ./tools/test-backend --coverage Backend (Django) test coverage report
/node-coverage/index.html ./tools/test-js-with-node --coverage Frontend (node) test coverage report

Useful management commands

Development-specific management commands live in zilencer/management/commands. Highlights include:

  • ./manage.py populate_db: Rebuilds database. Has options to, for example, create 3K users for testing.
  • ./manage.py mark_all_messages_unread: Useful for testing reading messages.
  • ./manage.py send_zulip_update_announcements: Send Zulip update notices drafted in zerver/lib/zulip_update_announcements.py.
  • ./manage.py add_mock_conversation: Add test messages, streams, images, emoji, etc. into the dev environment. First edit zilencer/management/commands/add_mock_conversation.py to add the data you're testing.

We also have documentation on testing LDAP, Google & GitHub authentication in the development environment.

Modifying and running the help center

If you're making changes to the help center files, be sure to test and provide screenshots in your pull request description. As with other code, untested documentation is often buggy.
  • To run just the help center dev server without running the rest of the metaopenchat app, use ./tools/run-dev --only-help-center.
  • To run the help center dev server alongside the Zulip app, use ./tools/run-dev --help-center-dev-server (requires more resources).
  • To test help center search, run ./tools/build-help-center followed by ./tools/run-dev --help-center-static-build. Hot reloads won't work: rerun ./tools/build-help-center and reload your browser to see updates. Search will not work with other methods of running the help center.

Viewing error pages

URL Command Description
/webpack/5xx.html None needed Error 5xx page served by nginx (used when Django is totally broken)
/errors/404 None needed Error 404 page served by Django
/errors/5xx None needed Error 5xx page served by Django
/accounts/do_confirm/invalid None needed Invalid confirmation link page

Connecting to the local PostgreSQL database

  • ./manage.py dbshell: Connect to PostgreSQL database via your terminal.
  • provision creates a ~/.pgpass file, so psql -U zulip -h localhost works too.
  • To connect using a graphical PostgreSQL client like pgAdmin, use the following credentials:

    • Host: 127.0.0.1 (don't use localhost)
    • Maintenance database: zulip
    • Username: zulip
    • password: stored as local_database_password in zulip/zproject/dev-secrets.conf