Skip to content

Commit

Permalink
docs: Make it harder to screw up our manage.py commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
timabbott committed Feb 3, 2017
1 parent 43d3430 commit 21f09dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
21 changes: 13 additions & 8 deletions docs/prod-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ These settings include:
- `EMAIL_*`, `DEFAULT_FROM_EMAIL`, and `NOREPLY_EMAIL_ADDRESS`:
Regardless of which authentication backends you enable, you must
provide settings for an outgoing SMTP server so Zulip can send
emails when needed (and don't forget to set `email_password` in
the `zulip-secrets.conf` file). We highly recommend testing
your configuration using `manage.py send_test_email` to confirm
your outgoing email configuration is working correctly.
emails when needed (and don't forget to set `email_password` in the
`zulip-secrets.conf` file). We highly recommend testing your
configuration using `su zulip` and then
`/home/zulip/deployments/current/manage.py send_test_email` to
confirm your outgoing email configuration is working correctly.

## Step 4: Initialize Zulip database

Expand All @@ -109,16 +110,20 @@ in your Zulip installation.
## Step 5: Create a Zulip organization and login

* If you haven't already, verify that your server can send email using
`./manage.py send_test_email [email protected]`. You'll need
working outgoing email to complete the setup process.

```
su zulip
/home/zulip/deployments/current/manage.py send_test_email [email protected]
```

You'll need working outgoing email to complete the setup process.

* Run the organization (realm) creation [management
command](prod-maintain-secure-upgrade.html#management-commands) :

```
su zulip # If you weren't already the zulip user
cd /home/zulip/deployments/current
./manage.py generate_realm_creation_link
/home/zulip/deployments/current/manage.py generate_realm_creation_link
```

This will print out a secure 1-time use link that allows creation of a
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if __name__ == "__main__":
if 'posix' in os.name and os.geteuid() == 0:
from django.core.management.base import CommandError
raise CommandError("manage.py should not be run as root.")
raise CommandError("manage.py should not be run as root. Use `su zulip` to drop root.")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings")
os.environ.setdefault("PYTHONSTARTUP", os.path.join(BASE_DIR, "scripts/lib/pythonrc.py"))

Expand Down
3 changes: 2 additions & 1 deletion zproject/prod_settings_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
# https://support.google.com/mail/answer/14257.
#
# You can quickly test your sending email configuration using:
# ./manage.py send_test_email [email protected]
# su zulip
# /home/zulip/deployments/current/manage.py send_test_email [email protected]
#
# A common problem is hosting providers that block outgoing SMTP traffic.
#
Expand Down

0 comments on commit 21f09dc

Please sign in to comment.