Open edX Devstak加快开发者模式调试速度

来源:互联网 发布:苹果 看书软件 编辑:程序博客网 时间:2024/05/29 18:13

github地址:https://github.com/edx/edx-platform/wiki/Developing-on-the-edX-Developer-Stack

禁用Django工具栏等,可以加快本地的LMS和CMS调试!

一、创建lms/envs/private.py 和 cms/envs/private.py者两个文件

二、复制下面代码

DISABLE_DJANGO_TOOLBAR = TrueDISABLE_CONTRACTS = Trueif DISABLE_DJANGO_TOOLBAR:    from .common import INSTALLED_APPS, MIDDLEWARE_CLASSES    def tuple_without(source_tuple, exclusion_list):        """Return new tuple excluding any entries in the exclusion list. Needed because tuples        are immutable. Order preserved."""        return tuple([i for i in source_tuple if i not in exclusion_list])    INSTALLED_APPS = tuple_without(INSTALLED_APPS, ['debug_toolbar', 'debug_toolbar_mongo'])    MIDDLEWARE_CLASSES = tuple_without(MIDDLEWARE_CLASSES, [        'django_comment_client.utils.QueryCountDebugMiddleware',        'debug_toolbar.middleware.DebugToolbarMiddleware',    ])    DEBUG_TOOLBAR_MONGO_STACKTRACES = Falseif DISABLE_CONTRACTS:    import contracts    contracts.disable_all()

0 0
原创粉丝点击