OpenMOOC / moocng

MOOC Engine
Apache License 2.0
88 stars 43 forks source link

local_settings.py >> settings/local.py #52

Closed johnfelipe closed 11 years ago

johnfelipe commented 11 years ago

Hi to all,

My local.py:

from .common import *

DEBUG = False

import os
BASEDIR = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DEBUG = DEBUG

FFMPEG_DEBUG = DEBUG

ADMINS = (
    ('Admin', 'admin@felipeurrego.com'),
)

MANAGERS = ADMINS

EMAIL_SUBJECT_PREFIX = '[OpenMOOC] | '

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'moocng',                # Or path to database file if using sqlite3.
        'USER': 'moocng',                # Not used with sqlite3.
        'PASSWORD': 'acacontraseña',            # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

MONGODB_URI = 'mongodb://localhost:27017/moocng'

# Tastypie resource limit per page, 0 means unlimited
API_LIMIT_PER_PAGE = 0

#SMTP server
EMAIL_HOST = 'idp.felipeurrego.com'
SERVER_EMAIL = '127.0.0.1'
DEFAULT_FROM_EMAIL = 'info@felipeurrego.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''

EMAIL_SUBJECT_PREFIX = '[OpenMOOC] | '

# Amazon credentials
AWS_ACCESS_KEY_ID = "acaid"
AWS_SECRET_ACCESS_KEY = "acakey"
AWS_STORAGE_BUCKET_NAME = "acanombre"
AWS_S3_UPLOAD_EXPIRE_TIME = (60 * 5) # 5 minutes

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Madrid'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

gettext = lambda s: s

LANGUAGES = (
    ('en', gettext('English')),
    ('es', gettext('Spanish')),
)

# the default value is 'django_language' but changing this
# to 'language' makes it easier to integrate with the IdP
LANGUAGE_COOKIE_NAME = 'language'

LOCALE_PATHS = (
    os.path.join(BASEDIR, 'locale'),
    )

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# Use custom formats
FORMAT_MODULE_PATH = 'moocng.formats'

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
#MEDIA_ROOT = os.path.join(BASEDIR, 'media')
MEDIA_ROOT = '/var/www/moocng/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
#STATIC_ROOT = os.path.join(BASEDIR, 'collected_static')
STATIC_ROOT = '/var/www/moocng/static'

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASEDIR, 'static'),
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder'
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
#SECRET_KEY = 'r$=%l$j4(#5a%$rd*g+q5o7!m3z&b@z1+n*d!n2im-hf0n%730'
SECRET_KEY = 'amz84hsmmb31p8cgw2nwqfdolpm80vmz'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'moocng.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'moocng.wsgi.application'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASEDIR, 'templates'),
)

COMPRESS_CSS_FILTERS = [
    'compressor.filters.css_default.CssAbsoluteFilter',
    'compressor.filters.cssmin.CSSMinFilter',
]

COMPRESS_OFFLINE = False

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'grappelli',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'adminsortable',
    'djcelery',
    'tinymce',
    'tastypie',
    'compressor',
    'moocng.contact',
    'moocng.badges',  # this must be defined before moocng.courses
    'moocng.courses',
    'moocng.portal',
    'moocng.videos',
    'moocng.teacheradmin',
    'moocng.enrollment',
    'moocng.api',
    'moocng.categories',
    'moocng.peerreview',
    'djangosaml2',
    'south',
    'django_mathjax',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
        },
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'filters': ['require_debug_false'],
        },
    },
    'loggers': {
        'django.request': {
            'handlers': ['console', 'mail_admins'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'moocng.videos.download': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
        'moocng.videos.tasks': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
        'moocng.courses.admin': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
    }
}

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.core.context_processors.tz',
#    'django.core.context_processors.request',
    'django.contrib.messages.context_processors.messages',
    'moocng.context_processors.site',
    'moocng.context_processors.theme',
    'moocng.context_processors.extra_settings',
    'moocng.context_processors.idp_urls',
    'moocng.context_processors.google_analytics',
    'moocng.context_processors.certificate_url',
)

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'moocng.courses.backends.Saml2BackendExtension',
)

FIXTURE_DIRS = (
    os.path.join(BASEDIR, 'fixtures', 'django.contrib.flatpages'),
    os.path.join(BASEDIR, 'fixtures', 'django.contrib.auth'),
)

TINYMCE_DEFAULT_CONFIG = {
    'theme': 'advanced',
    'theme_advanced_toolbar_location': 'top',
    'theme_advanced_buttons1': 'bold,italic,underline,strikethrough,separator,link,unlink,separator,undo,redo,copy,paste,separator,cleanup,separator,bullist,numlist',
    'theme_advanced_buttons2' : '',
    'theme_advanced_buttons3' : '',
    }

GOOGLE_ANALYTICS_CODE = ''

GRAVATAR_URL_PREFIX = '//www.gravatar.com/'

MOOCNG_THEME = {
#    'logo': u'',
#    'subtitle': u'',
#    'top_banner': u'',
#    'right_banner1': u'',
#    'right_banner2': u'',
#    'bootstrap_css': u'',
#    'moocng_css': u'',
#    'cert_banner': u'',
    }

ENABLED_COMUNICATIONS = (
    'feedback',
    'incidence',
    'rights',
    'unsubscribe',
    'others'
)

#SHOW_TOS = True

FFMPEG = '/usr/bin/ffmpeg'

# Let authenticated users create their own courses
ALLOW_PUBLIC_COURSE_CREATION = False

# Make this unique, and don't share it with anybody else than payment system
# Override this in local settings
USER_API_KEY = '123456789'

# A list with the slugs of the courses that use the old qualification system
# where the normal units counted
#COURSES_USING_OLD_TRANSCRIPT = []
COURSES_USING_OLD_TRANSCRIPT = ['aleman-para-colombianos', 'tics-para-ensenar-y-aprender', 'empieza-con-el-ingles-aprende-las-mil-palabras-mas', 'ingles-profesional-professional-english']

# Enrollment methods
ENROLLMENT_METHODS = (
    'moocng.enrollment.methods.FreeEnrollment',
    )

# Celery settings
import djcelery
djcelery.setup_loader()

BROKER_URL = 'amqp://moocng:felipeurrego@localhost:5672/moocng'

REGISTRY_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/newUser.php'
PROFILE_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/reviewUser.php'
CHANGEPW_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/changePassword.php'
ASKBOT_URL_TEMPLATE = 'https://questions.felipeurrego.com/%s/'

#CERTIFICATE_URL = 'http://felipeurrego.com/idcourse/%(courseid)s/email/%(email)s'  # Example, to be overwritten in local settings
CERTIFICATE_URL = 'http://jhonfelipeurregomejia.com/idcourse/%(courseid)s/image.php?name=%(email)s'  # Example, to be overwritten in local settings

MASSIVE_EMAIL_BATCH_SIZE = 30

PEER_REVIEW_TEXT_MAX_SIZE = 5000  # in chars
PEER_REVIEW_FILE_MAX_SIZE = 5  # in MB
PEER_REVIEW_ASSIGNATION_EXPIRE = 24  # in hours

SESSION_EXPIRE_AT_BROWSER_CLOSE = True
LOGIN_URL = '/saml2/login/'
LOGIN_REDIRECT_URL = '/'
LOGOUT_URL = '/saml2/logout/'
LOGOUT_REDIRECT_URL = '/'

SAML_CREATE_UNKNOWN_USER = True
SAML_ATTRIBUTE_MAPPING = {
    'mail': ('username', 'email', ),
    'cn': ('first_name', ),
    'sn': ('last_name', ),
    'eduPersonAffiliation': ('groups', ),
    }

import saml2

SAML2_DIR = "/var/www/moocng/saml2"

SAML_CONFIG = {
    # full path to the xmlsec1 binary programm
    'xmlsec_binary': '/usr/bin/xmlsec1',

    # your entity id, usually your subdomain plus the url to the metadata view
    'entityid': 'http://moocng.felipeurrego.com/saml2/metadata/',

    # directory with attribute mapping
    'attribute_map_dir': os.path.join(SAML2_DIR, 'attribute-maps'),

    # this block states what services we provide
    'service': {
        # we are just a lonely SP
        'sp' : {
            'name': 'Moocng SP',
            'endpoints': {
                # url and binding to the assetion consumer service view
                # do not change the binding or service name
                'assertion_consumer_service': [
                    ('http://moocng.felipeurrego.com/saml2/acs/', saml2.BINDING_HTTP_POST),
                    ],
                # url and binding to the single logout service view
                # do not change the binding or service name
                'single_logout_service': [
                    ('http://moocng.felipeurrego.com/saml2/ls/', saml2.BINDING_HTTP_REDIRECT),
                    ],
                },

            # in this section the list of IdPs we talk to are defined
            'idp': {
                # we do not need a WAYF service since there is
                # only an IdP defined here. This IdP should be
                # present in our metadata

                # the keys of this dictionary are entity ids
                'https://idp.felipeurrego.com/simplesaml/saml2/idp/metadata.php': {
                    'single_sign_on_service': {
                        saml2.BINDING_HTTP_REDIRECT: 'https://idp.felipeurrego.com/simplesaml/saml2/idp/SSOService.php',
                        },
                    'single_logout_service': {
                        saml2.BINDING_HTTP_REDIRECT: 'https://idp.felipeurrego.com/simplesaml/saml2/idp/SingleLogoutService.php',
                        },
                    },
                },
            },
        },

    # where the remote metadata is stored
    'metadata': {
        'local': [os.path.join(SAML2_DIR, 'remote_metadata.xml')],
        },

    # set to 1 to output debugging information
    'debug': 1,

    # certificate
    'key_file': os.path.join(SAML2_DIR, 'certs/server.key'),  # private part
    'cert_file': os.path.join(SAML2_DIR, 'certs/server.crt'),  # public part

    # own metadata settings
    'contact_person': [
        {'given_name': 'Sysadmin',
         'sur_name': '',
         'company': 'Example CO',
         'email_address': 'sysadmin@felipeurrego.com',
         'contact_type': 'technical'},
        {'given_name': 'Boss',
         'sur_name': '',
         'company': 'Example CO',
         'email_address': 'admin@felipeurrego.com',
         'contact_type': 'administrative'},
        ],
    # you can set multilanguage information here
    'organization': {
        'name': [('Example CO', 'es'), ('Example CO', 'en')],
        'display_name': [('Example', 'es'), ('Example', 'en')],
        'url': [('http://www.felipeurrego.com', 'es'), ('http://www.felipeurrego.com', 'en')],
        },
    }

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    },
}

MATHJAX_ENABLED = False
MATHJAX_CONFIG_FILE = "TeX-AMS-MML_HTMLorMML"
MATHJAX_CONFIG_DATA = {
  "elements": ['false-id-to-not-proccess-by-default'],
  "tex2jax": {
    "inlineMath":
      [
          ['$','$'],
          ['\\(','\\)']
      ]
  }
}

try:
    from local_settings import *
except ImportError:
    pass

common.py:

# Copyright 2012 Rooter Analysis S.L.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Django settings for moocng project.

import os
BASEDIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

DEBUG = True
TEMPLATE_DEBUG = DEBUG

FFMPEG_DEBUG = DEBUG

ADMINS = (
    ('Admin', 'admin@felipeurrego.com'),
)

MANAGERS = ADMINS

EMAIL_SUBJECT_PREFIX = '[OpenMOOC] | '

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'moocng',                # Or path to database file if using sqlite3.
        'USER': 'moocng',                # Not used with sqlite3.
        'PASSWORD': 'acacontraseña',            # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

MONGODB_URI = 'mongodb://localhost:27017/moocng'

# Tastypie resource limit per page, 0 means unlimited
API_LIMIT_PER_PAGE = 0

#SMTP server
EMAIL_HOST = 'idp.felipeurrego.com'
SERVER_EMAIL = '127.0.0.1'
DEFAULT_FROM_EMAIL = 'info@felipeurrego.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''

EMAIL_SUBJECT_PREFIX = '[OpenMOOC] | '

# Amazon credentials
AWS_ACCESS_KEY_ID = "acaiid"
AWS_SECRET_ACCESS_KEY = "acakey"
AWS_STORAGE_BUCKET_NAME = "acanombre"
AWS_S3_UPLOAD_EXPIRE_TIME = (60 * 5) # 5 minutes

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Madrid'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

gettext = lambda s: s

LANGUAGES = (
    ('en', gettext('English')),
    ('es', gettext('Spanish')),
)

# the default value is 'django_language' but changing this
# to 'language' makes it easier to integrate with the IdP
LANGUAGE_COOKIE_NAME = 'language'

LOCALE_PATHS = (
    os.path.join(BASEDIR, 'locale'),
)

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# Use custom formats
FORMAT_MODULE_PATH = 'moocng.formats'

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
#MEDIA_ROOT = os.path.join(BASEDIR, 'media')
MEDIA_ROOT = '/var/www/moocng/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
#STATIC_ROOT = os.path.join(BASEDIR, 'collected_static')
STATIC_ROOT = '/var/www/moocng/static'

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASEDIR, 'static'),
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder'
    # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
#SECRET_KEY = 'r$=%l$j4(#5a%$rd*g+q5o7!m3z&b@z1+n*d!n2im-hf0n%730'
SECRET_KEY = 'amz84hsmmb31p8cgw2nwqfdolpm80vmz'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    # 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'moocng.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'moocng.wsgi.application'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASEDIR, 'templates'),
)

COMPRESS_CSS_FILTERS = [
    'compressor.filters.css_default.CssAbsoluteFilter',
    'compressor.filters.cssmin.CSSMinFilter',
]

COMPRESS_OFFLINE = False

INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'grappelli',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'adminsortable',
    'djcelery',
    'tinymce',
    'tastypie',
    'compressor',
    'moocng.contact',
    'moocng.badges',  # this must be defined before moocng.courses
    'moocng.courses',
    'moocng.assets',
    'moocng.portal',
    'moocng.videos',
    'moocng.teacheradmin',
    'moocng.enrollment',
    'moocng.api',
    'moocng.categories',
    'moocng.auth_handlers',
    'moocng.peerreview',
    'south',
    'django_mathjax',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'moocng.media_contents',
]

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
        },
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'filters': ['require_debug_false'],
        },
    },
    'loggers': {
        'django.request': {
            'handlers': ['console', 'mail_admins'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'moocng.videos.download': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
        'moocng.videos.tasks': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
        'moocng.courses.admin': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'propagate': True,
        },
    }
}

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.core.context_processors.tz',
    # 'django.core.context_processors.request',
    'django.contrib.messages.context_processors.messages',
    'moocng.context_processors.site',
    'moocng.context_processors.theme',
    'moocng.context_processors.extra_settings',
    'moocng.context_processors.google_analytics',
    'moocng.context_processors.certificate_url',
)

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'moocng.courses.backends.Saml2BackendExtension',
)

FIXTURE_DIRS = (
    os.path.join(BASEDIR, 'fixtures', 'django.contrib.flatpages'),
    os.path.join(BASEDIR, 'fixtures', 'django.contrib.auth'),
)

TINYMCE_DEFAULT_CONFIG = {
    'theme': 'advanced',
    'theme_advanced_toolbar_location': 'top',
    'theme_advanced_buttons1': 'bold,italic,underline,strikethrough,separator,link,unlink,separator,undo,redo,copy,paste,separator,cleanup,separator,bullist,numlist',
    'theme_advanced_buttons2': '',
    'theme_advanced_buttons3': '',
}

GOOGLE_ANALYTICS_CODE = ''

GRAVATAR_URL_PREFIX = '//www.gravatar.com/'

MOOCNG_THEME = {
    # 'cert_banner': u'',
}

ENABLED_COMUNICATIONS = (
    'feedback',
    'incidence',
    'rights',
    'unsubscribe',
    'others'
)

#SHOW_TOS = True

FFMPEG = '/usr/bin/ffmpeg'

# Let authenticated users create their own courses
ALLOW_PUBLIC_COURSE_CREATION = False

# Make this unique, and don't share it with anybody else than payment system
# Override this in local settings
USER_API_KEY = '123456789'

# A list with the slugs of the courses that use the old qualification system
# where the normal units counted
#COURSES_USING_OLD_TRANSCRIPT = []
COURSES_USING_OLD_TRANSCRIPT = ['aleman-para-colombianos', 'tics-para-ensenar-y-aprender', 'empieza-con-el-ingles-aprende-las-mil-palabras-mas', 'ingles-profesional-professional-english']

# Enrollment methods
ENROLLMENT_METHODS = (
    'moocng.enrollment.methods.FreeEnrollment',
)

# Celery settings
import djcelery
djcelery.setup_loader()
CELERY_CREATE_MISSING_QUEUES = True

BROKER_URL = 'amqp://moocng:felipeurrego@localhost:5672/moocng'

ASKBOT_URL_TEMPLATE = 'https://questions.felipeurrego.com/%s/'

#CERTIFICATE_URL = 'http://felipeurrego.com/idcourse/%(courseid)s/email/%(email)s'  # Example, to be overwritten in local settings
CERTIFICATE_URL = 'http://jhonfelipeurregomejia.com/idcourse/%(courseid)s/image.php?name=%(email)s'  # Example, to be overwritten in local settings

MASSIVE_EMAIL_BATCH_SIZE = 30

PEER_REVIEW_TEXT_MAX_SIZE = 5000  # in chars
PEER_REVIEW_FILE_MAX_SIZE = 5  # in MB
PEER_REVIEW_ASSIGNATION_EXPIRE = 24  # in hours

ASSET_SLOT_GRANULARITY = 5  # Slot time of assets should be a multiple of this value (in minutes)

SESSION_EXPIRE_AT_BROWSER_CLOSE = True

LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/'

FREE_ENROLLMENT_CONSISTENT = False

AUTH_HANDLER = "moocng.auth_handlers.handlers.SAML2"
INSTALLED_APPS.append('djangosaml2')
REGISTRY_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/newUser.php'
PROFILE_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/reviewUser.php'
CHANGEPW_URL = 'https://idp.felipeurrego.com/simplesaml/module.php/userregistration/changePassword.php'

from .saml_settings import *

### Example config for moocng.auth_handlers.handlers.DBAuth Auth Handler
# INSTALLED_APPS.append('moocng.auth_handlers.dbauth')
# INSTALLED_APPS.append('registration')
# ACCOUNT_ACTIVATION_DAYS = 15

MEDIA_CONTENT_TYPES = [
    {
        'id': 'youtube',
        'name': 'YouTube',
        'handler': 'moocng.media_contents.handlers.youtube.YoutubeMediaContentHandler',
        'can_get_last_frame': True,
    },
    {
        'id': 'vimeo',
        'name': 'Vimeo',
        'handler': 'moocng.media_contents.handlers.vimeo.VimeoMediaContentHandler',
        'can_get_last_frame': False,
    },
    {
        'id': 'scribd',
        'name': 'Scribd',
        'handler': 'moocng.media_contents.handlers.scribd.ScribdMediaContentHandler',
        'can_get_last_frame': False,
    },
    {
        'id': 'prezi',
        'name': 'Prezi',
        'handler': 'moocng.media_contents.handlers.prezi.PreziMediaContentHandler',
        'can_get_last_frame': False,
    },
]

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    },
}

MATHJAX_ENABLED = False
MATHJAX_LOCAL_PATH = STATIC_URL + 'js/libs/mathjax'
MATHJAX_CONFIG_FILE = "TeX-AMS-MML_HTMLorMML"
MATHJAX_CONFIG_DATA = {
    "elements": ['false-id-to-not-proccess-by-default'],
    "tex2jax": {
        "inlineMath": [
            ['$', '$'],
            ['\\(', '\\)']
        ]
    }
}

when i put python manage.py collectstatic, this is error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/staticfiles/management/commands/collectstatic.py", line 163, in handle_noargs
    collected = self.collect()
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/staticfiles/management/commands/collectstatic.py", line 104, in collect
    for path, storage in finder.list(self.ignore_patterns):
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/staticfiles/finders.py", line 105, in list
    for path in utils.get_files(storage, ignore_patterns):
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/staticfiles/utils.py", line 25, in get_files
    directories, files = storage.listdir(location)
  File "/var/www/moocng/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/files/storage.py", line 235, in listdir
    for entry in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/var/www/moocng/moocng/moocng/settings/static'

what I've done wrong?

Please help

TNks

jespino commented 11 years ago

The problem is your BASEDIR variable, now the BASEDIR must be calculate relative to the new position of the settings.

johnfelipe commented 11 years ago

Then what i can do?.

SAML2_DIR = "/var/www/moocng/saml2" i change for path saml2

Tnks.

johnfelipe commented 11 years ago

which would be the path in all cases whe show BASEDIR?

johnfelipe commented 11 years ago

How fix this, please some orientation

ablanco commented 11 years ago

You shouldn't have copied all the variables from the common.py file to the local.py. Just overwrite in the local.py file the variables you want to change the value of.

For example, don't overwrite the BASEDIR variable.

johnfelipe commented 11 years ago

Where overwrite the BASEDIR variable?

TNks

johnfelipe commented 11 years ago

My local.py

from .common import *

DEBUG = False

I show this error for login:

Server Error (500)
We are having technical problems at this moment.

We apologize for any inconvenience this may cause to you.

We are working on the fix and we hope to improve the service very soon.

Thank you for your patience.