コード例 #1
0
ファイル: startup.py プロジェクト: DevCode1/edx-platform
def run():
    """
    Executed during django startup
    """

    # Patch the xml libs.
    from safe_lxml import defuse_xml_libs
    defuse_xml_libs()

    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()

    # Initialize Segment.io analytics module. Flushes first time a message is received and 
    # every 50 messages thereafter, or if 10 seconds have passed since last flush
    if settings.FEATURES.get('SEGMENT_IO_LMS') and hasattr(settings, 'SEGMENT_IO_LMS_KEY'):
        analytics.init(settings.SEGMENT_IO_LMS_KEY, flush_at=50)
コード例 #2
0
ファイル: startup.py プロジェクト: jswope00/griffinx
def run():
    """
    Executed during django startup
    """
    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()

    # Initialize Segment.io analytics module. Flushes first time a message is received and
    # every 50 messages thereafter, or if 10 seconds have passed since last flush
    if settings.FEATURES.get('SEGMENT_IO_LMS') and hasattr(settings, 'SEGMENT_IO_LMS_KEY'):
        analytics.init(settings.SEGMENT_IO_LMS_KEY, flush_at=50)

    # Monkey patch the keyword function map
    if keyword_substitution.keyword_function_map_is_empty():
        keyword_substitution.add_keyword_function_map(get_keyword_function_map())
        # Once keyword function map is set, make update function do nothing
        keyword_substitution.add_keyword_function_map = lambda x: None
コード例 #3
0
def run():
    """
    Executed during django startup
    """
    autostartup()

    add_mimetypes()
コード例 #4
0
def run():
    """
    Executed during django startup
    """
    autostartup()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #5
0
ファイル: startup.py プロジェクト: skim-ks/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #6
0
def run():
    """
    Executed during django startup
    """
    django_utils_translation.patch()

    autostartup()

    add_mimetypes()
コード例 #7
0
ファイル: startup.py プロジェクト: GSeralin/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    # trigger a forced initialization of our modulestores since this can take a while to complete
    # and we want this done before HTTP requests are accepted
    for store_name in settings.MODULESTORE:
    	modulestore(store_name)
コード例 #8
0
def run():
    """
    Executed during django startup
    """
    global INITIALIZED
    if INITIALIZED:
        return

    INITIALIZED = True
    autostartup()
コード例 #9
0
def run():
    """
    Executed during django startup
    """
    autostartup()

    # Trigger a forced initialization of our modulestores since this can take a while to complete
    # and we want this done before HTTP requests are accepted.
    if settings.INIT_MODULESTORE_ON_STARTUP:
        for store_name in settings.MODULESTORE:
            modulestore(store_name)
コード例 #10
0
ファイル: startup.py プロジェクト: akbargumbira/Labster.EdX
def run():
    """
    Executed during django startup
    """
    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

    if settings.FEATURES.get("USE_CUSTOM_THEME", False):
        enable_theme()
コード例 #11
0
ファイル: startup.py プロジェクト: jswope00/griffinx
def run():
    """
    Executed during django startup
    """
    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #12
0
def run():
    """
    Executed during django startup
    """
    # Patch the xml libs.
    from safe_lxml import defuse_xml_libs
    defuse_xml_libs()

    django_utils_translation.patch()

    autostartup()

    add_mimetypes()
コード例 #13
0
ファイル: startup.py プロジェクト: HyHaa/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    # Trigger a forced initialization of our modulestores since this can take a
    # while to complete and we want this done before HTTP requests are accepted.
    if settings.INIT_MODULESTORE_ON_STARTUP:
        for store_name in settings.MODULESTORE:
            modulestore(store_name)

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #14
0
ファイル: startup.py プロジェクト: ybergner/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()
コード例 #15
0
ファイル: startup.py プロジェクト: SnowGeekOrg/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    # Trigger a forced initialization of our modulestores since this can take a
    # while to complete and we want this done before HTTP requests are accepted.
    if settings.INIT_MODULESTORE_ON_STARTUP:
        for store_name in settings.MODULESTORE:
            modulestore(store_name)

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #16
0
ファイル: startup.py プロジェクト: BeiLuoShiMen/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()
コード例 #17
0
ファイル: startup.py プロジェクト: Gfirey/edx-platform
def run():
    """
    Executed during django startup
    """
    global INITIALIZED
    if INITIALIZED:
        return

    INITIALIZED = True
    autostartup()

    # Do the patching here
    from ifmo_mod.patch import patch
    patch()
コード例 #18
0
def run():
    """
    Executed during django startup
    """
    autostartup()

    # Trigger a forced initialization of our modulestores since this can take a while to complete
    # and we want this done before HTTP requests are accepted.
    if settings.INIT_MODULESTORE_ON_STARTUP:
        for store_name in settings.MODULESTORE:
            modulestore(store_name)

    # Do the patching here
    from ifmo_mod.patch import patch
    patch()
コード例 #19
0
ファイル: startup.py プロジェクト: mrvinceo/edx-platform
def run():
    """
    Executed during django startup
    """
    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

	if settings.FEATURES.get('USE_CUSTOM_THEME'):
        theme_root = settings.ENV_ROOT / 'themes' / settings.THEME_NAME
        settings.STATICFILES_DIRS.append(
            (u'themes/{}'.format(settings.THEME_NAME), theme_root / 'static')
        )
コード例 #20
0
ファイル: startup.py プロジェクト: aoifec/edx-platform
def run():
    """
    Executed during django startup
    """
    # Patch the xml libs.
    from safe_lxml import defuse_xml_libs
    defuse_xml_libs()

    django_utils_translation.patch()

    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()
コード例 #21
0
ファイル: startup.py プロジェクト: AdityaKashyap/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()

    # Initialize Segment.io analytics module. Flushes first time a message is received and 
    # every 50 messages thereafter, or if 10 seconds have passed since last flush
    if settings.FEATURES.get('SEGMENT_IO_LMS') and settings.SEGMENT_IO_LMS_KEY:
        analytics.init(settings.SEGMENT_IO_LMS_KEY, flush_at=50)
コード例 #22
0
ファイル: startup.py プロジェクト: xiandiancloud/edx-platform
def run():
    """
    Executed during django startup
    """
    autostartup()

    add_mimetypes()

    if settings.FEATURES.get('USE_CUSTOM_THEME', False):
        enable_theme()

    if settings.FEATURES.get('USE_MICROSITES', False):
        enable_microsites()

    if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH', False):
        enable_third_party_auth()

    # Initialize Segment.io analytics module. Flushes first time a message is received and
    # every 50 messages thereafter, or if 10 seconds have passed since last flush
    if settings.FEATURES.get('SEGMENT_IO_LMS') and settings.SEGMENT_IO_LMS_KEY:
        analytics.init(settings.SEGMENT_IO_LMS_KEY, flush_at=50)
コード例 #23
0
def run():
    """
    Executed during django startup
    """
    autostartup()
コード例 #24
0
from time import strptime, strftime
from datetime import datetime
from zipfile import ZipFile, is_zipfile

from dogapi import dog_http_api
from pytz import UTC

from django.core.management.base import BaseCommand, CommandError
from django.conf import settings

import django_startup

from student.models import TestCenterUser, TestCenterRegistration


django_startup.autostartup()


class Command(BaseCommand):

    args = '<input zip file>'
    help = """
    Import Pearson confirmation files and update TestCenterUser
    and TestCenterRegistration tables with status.
    """

    @staticmethod
    def datadog_error(string, tags):
        dog_http_api.event("Pearson Import", string, alert_type='error', tags=[tags])

    def handle(self, *args, **kwargs):
コード例 #25
0
from optparse import make_option
import os
from stat import S_ISDIR

import boto
from dogapi import dog_http_api, dog_stats_api
import paramiko

from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError

import django_startup

django_startup.autostartup()


class Command(BaseCommand):
    help = """
    This command handles the importing and exporting of student records for
    Pearson.  It uses some other Django commands to export and import the
    files and then uploads over SFTP to Pearson and stuffs the entry in an
    S3 bucket for archive purposes.

    Usage: ./manage.py pearson-transfer --mode [import|export|both]
    """

    option_list = BaseCommand.option_list + (make_option(
        '--mode',
        action='store',
        dest='mode',