diff --git a/manage.py b/manage.py index 325927414e..496e6f2701 100755 --- a/manage.py +++ b/manage.py @@ -2,7 +2,6 @@ from __future__ import (print_function) import os import sys -import types import configparser if sys.version_info <= (3, 0): print("Error: Zulip is a Python 3 project, and cannot be run with Python 2.") @@ -32,15 +31,6 @@ if __name__ == "__main__": print("Error accessing Zulip secrets; manage.py in production must be run as the zulip user.") sys.exit(1) - # Performance Hack: We make the pika.adapters.twisted_connection - # module unavailable, to save ~100ms of import time for most Zulip - # management commands for code we don't use. The correct - # long-term fix for this will be to get a setting integrated - # upstream to disable pika importing this. - # See https://github.com/pika/pika/issues/1128 - sys.modules['pika.adapters.twisted_connection'] = types.ModuleType( - 'pika.adapters.twisted_connection') - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings") from django.conf import settings from django.core.management import execute_from_command_line diff --git a/zproject/wsgi.py b/zproject/wsgi.py index b00e13ee3a..9fbbafc561 100644 --- a/zproject/wsgi.py +++ b/zproject/wsgi.py @@ -15,21 +15,11 @@ framework. """ import os import sys -import types BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) import scripts.lib.setup_path_on_import -# Performance Hack: We make the pika.adapters.twisted_connection -# module unavailable, to save ~100ms of import time for most Zulip -# management commands for code we don't use. The correct -# long-term fix for this will be to get a setting integrated -# upstream to disable pika importing this. -# See https://github.com/pika/pika/issues/1128 -sys.modules['pika.adapters.twisted_connection'] = types.ModuleType( - 'pika.adapters.twisted_connection') - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings") import django django.setup() # We need to call setup to load applications.