Merge pull request #21164 from edx/INCR-347-2

INCR-347 python3 compatibility
This commit is contained in:
Ayub
2019-07-23 13:00:08 +05:00
committed by GitHub
7 changed files with 50 additions and 25 deletions

View File

@@ -2,6 +2,9 @@
Specific overrides to the base prod settings to make development easier. Specific overrides to the base prod settings to make development easier.
""" """
from __future__ import absolute_import
import logging
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from .production import * # pylint: disable=wildcard-import, unused-wildcard-import from .production import * # pylint: disable=wildcard-import, unused-wildcard-import
@@ -19,7 +22,6 @@ HTTPS = 'off'
################################ LOGGERS ###################################### ################################ LOGGERS ######################################
import logging
# Disable noisy loggers # Disable noisy loggers
for pkg_name in ['track.contexts', 'track.middleware']: for pkg_name in ['track.contexts', 'track.middleware']:
@@ -180,7 +182,10 @@ IDA_LOGOUT_URI_LIST = [
] ]
##################################################################### #####################################################################
from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants
# pylint: disable=wrong-import-order, wrong-import-position
from openedx.core.djangoapps.plugins import constants as plugin_constants, plugin_settings
plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.DEVSTACK) plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.DEVSTACK)
############################################################################### ###############################################################################

View File

@@ -11,6 +11,8 @@ In two separate processes on devstack:
./manage.py cms celery worker --settings=devstack_with_worker ./manage.py cms celery worker --settings=devstack_with_worker
""" """
from __future__ import absolute_import
import os import os
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and

View File

@@ -4,22 +4,25 @@ This is the default template for our main set of AWS servers.
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import, wrong-import-order
from __future__ import absolute_import
import codecs import codecs
import os import os
import yaml import yaml
from path import Path as path
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed
from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy
from path import Path as path
from .common import * from .common import *
from openedx.core.lib.derived import derive_settings # pylint: disable=wrong-import-order from openedx.core.djangoapps.plugins import constants as plugin_constants
from openedx.core.lib.logsettings import get_logger_config # pylint: disable=wrong-import-order from openedx.core.djangoapps.plugins import plugin_settings
from openedx.core.lib.derived import derive_settings
from openedx.core.lib.logsettings import get_logger_config
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed
def get_env_setting(setting): def get_env_setting(setting):
@@ -442,7 +445,7 @@ CELERY_QUEUES.update(
{ {
alternate: {} alternate: {}
for alternate in ALTERNATE_QUEUES for alternate in ALTERNATE_QUEUES
if alternate not in CELERY_QUEUES.keys() if alternate not in list(CELERY_QUEUES.keys())
} }
) )

View File

@@ -11,33 +11,37 @@ sessions. Assumes structure:
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import, wrong-import-order
from django.utils.translation import ugettext_lazy from __future__ import absolute_import
from .common import * from .common import *
import os import os
from path import Path as path
from uuid import uuid4 from uuid import uuid4
from util.db import NoOpMigrationModules
from django.utils.translation import ugettext_lazy
from path import Path as path
from openedx.core.lib.derived import derive_settings from openedx.core.lib.derived import derive_settings
from util.db import NoOpMigrationModules
# import settings from LMS for consistent behavior with CMS # import settings from LMS for consistent behavior with CMS
# pylint: disable=unused-import # pylint: disable=unused-import
from lms.envs.test import ( from lms.envs.test import (
WIKI_ENABLED,
PLATFORM_NAME,
PLATFORM_DESCRIPTION,
SITE_NAME,
DEFAULT_FILE_STORAGE,
MEDIA_ROOT,
MEDIA_URL,
COMPREHENSIVE_THEME_DIRS, COMPREHENSIVE_THEME_DIRS,
DEFAULT_FILE_STORAGE,
ECOMMERCE_API_URL,
ENABLE_COMPREHENSIVE_THEMING, ENABLE_COMPREHENSIVE_THEMING,
JWT_AUTH, JWT_AUTH,
MEDIA_ROOT,
MEDIA_URL,
PLATFORM_DESCRIPTION,
PLATFORM_NAME,
REGISTRATION_EXTRA_FIELDS, REGISTRATION_EXTRA_FIELDS,
ECOMMERCE_API_URL,
GRADES_DOWNLOAD, GRADES_DOWNLOAD,
SITE_NAME,
WIKI_ENABLED
) )
@@ -352,6 +356,7 @@ VIDEO_TRANSCRIPTS_SETTINGS = dict(
####################### Plugin Settings ########################## ####################### Plugin Settings ##########################
# pylint: disable=wrong-import-position
from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants
plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.TEST) plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.TEST)

View File

@@ -11,9 +11,13 @@ from the same directory.
""" """
# Start with the common settings # Start with the common settings
from __future__ import absolute_import
from .common import * # pylint: disable=wildcard-import, unused-wildcard-import from .common import * # pylint: disable=wildcard-import, unused-wildcard-import
from openedx.core.lib.derived import derive_settings from openedx.core.lib.derived import derive_settings
# Use an in-memory database since this settings file is only used for updating assets # Use an in-memory database since this settings file is only used for updating assets
DATABASES = { DATABASES = {
'default': { 'default': {

View File

@@ -2,6 +2,8 @@
Module for code that should run during Studio startup (deprecated) Module for code that should run during Studio startup (deprecated)
""" """
from __future__ import absolute_import
import django import django
from django.conf import settings from django.conf import settings

View File

@@ -1,19 +1,23 @@
"""
Urls of Studio.
"""
from __future__ import absolute_import
from django.conf import settings from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from openedx.core.openapi import schema_view from ratelimitbackend import admin
import contentstore.views import contentstore.views
from cms.djangoapps.contentstore.views.organization import OrganizationListView
import openedx.core.djangoapps.common_views.xblock import openedx.core.djangoapps.common_views.xblock
import openedx.core.djangoapps.debug.views import openedx.core.djangoapps.debug.views
import openedx.core.djangoapps.lang_pref.views import openedx.core.djangoapps.lang_pref.views
from cms.djangoapps.contentstore.views.organization import OrganizationListView
from openedx.core.djangoapps.password_policy import compliance as password_policy_compliance from openedx.core.djangoapps.password_policy import compliance as password_policy_compliance
from openedx.core.djangoapps.password_policy.forms import PasswordPolicyAwareAdminAuthForm from openedx.core.djangoapps.password_policy.forms import PasswordPolicyAwareAdminAuthForm
from openedx.core.openapi import schema_view
from ratelimitbackend import admin
django_autodiscover() django_autodiscover()
admin.site.site_header = _('Studio Administration') admin.site.site_header = _('Studio Administration')