Auto-load commonly used modules in manage.py shell.

This automatically loads settings, zerver.models.* and
zerver.lib.actions.* when you start `manage.py shell`, which should
save a bit of time basically every time someone uses it.

Fixes #275.
This commit is contained in:
Tim Abbott
2016-03-11 00:26:44 -08:00
parent b06739df11
commit f9222de83e
3 changed files with 14 additions and 0 deletions

11
scripts/lib/pythonrc.py Normal file
View File

@@ -0,0 +1,11 @@
from __future__ import print_function
try:
from django.conf import settings
from zerver.models import *
from zerver.lib.actions import *
except Exception:
import traceback
print("\nException importing Zulip core modules on startup!")
traceback.print_exc()
else:
print("\nSuccessfully imported Zulip settings, models, and actions functions.")