'DEFAULT_NOTIFICATION_DELIVERY_SCHEDULE', default='w', choices=const.NOTIFICATION_DELIVERY_SCHEDULE_CHOICES, description=_('Default news notification frequency'), help_text=_('This option currently defines default frequency ' 'of emailed updates in the following five categories: ' 'questions asked by user, answered by user, individually ' 'selected, entire forum (per person tag filter applies) ' 'and posts mentioning the user and comment responses'))) settings.register( livesettings.BooleanValue( EMAIL, 'EMAIL_VALIDATION', default=False, hidden=True, description=_('Require email verification before allowing to post'), help_text= _('Active email verification is done by sending a verification key in email' ))) settings.register( livesettings.BooleanValue( EMAIL, 'EMAIL_UNIQUE', default=True, description=_('Allow only one account per email address'))) settings.register( livesettings.StringValue( EMAIL,
livesettings.StringValue( FORUM_DATA_RULES, 'COMMENTS_EDITOR_TYPE', default='plain-text', choices=COMMENTS_EDITOR_CHOICES, description=_('Editor for the comments') ) ) settings.register( livesettings.BooleanValue( FORUM_DATA_RULES, 'ASK_BUTTON_ENABLED', default=True, description=_('Enable big Ask button'), help_text=_( 'Disabling this button will reduce number of new questions. ' 'If this button is disabled, the ask button in the search menu ' 'will still be available.' ) ) ) settings.register( livesettings.BooleanValue( FORUM_DATA_RULES, 'ENABLE_VIDEO_EMBEDDING', default = False, description = _('Enable embedding videos. '), help_text = _(
'GOOGLE_ANALYTICS_KEY', description=_('Google Analytics key'), help_text=_( 'Obtain is at <a href="%(url)s">' 'Google Analytics</a> site, if you ' 'wish to use Google Analytics to monitor ' 'your site' ) % {'url': 'http://www.google.com/intl/%s/analytics/' \ % django_settings.LANGUAGE_CODE } ) ) settings.register( livesettings.BooleanValue( EXTERNAL_KEYS, 'USE_RECAPTCHA', description=_('Enable recaptcha (keys below are required)'), default=False)) settings.register( livesettings.StringValue(EXTERNAL_KEYS, 'RECAPTCHA_KEY', description=_('Recaptcha public key'))) settings.register( livesettings.StringValue( EXTERNAL_KEYS, 'RECAPTCHA_SECRET', description=_('Recaptcha private key'), help_text=_('Recaptcha is a tool that helps distinguish ' 'real people from annoying spam robots. '
settings.register( livesettings.StringValue( QA_SITE_SETTINGS, 'APP_URL', description=_( 'Base URL for your Q&A forum, must start with http or https'), update_callback=app_url_callback ) ) settings.register( livesettings.BooleanValue( QA_SITE_SETTINGS, 'ENABLE_GREETING_FOR_ANON_USER', default=True, description=_('Check to enable greeting for anonymous user') ) ) settings.register( livesettings.StringValue( QA_SITE_SETTINGS, 'GREETING_FOR_ANONYMOUS_USER', default=_('First time here? Check out the FAQ!'), localized=True, hidden=False, description=_( 'Text shown in the greeting message shown to the anonymous user'), help_text=_('Use HTML to format the message ') )
""" User policy settings """ from askbot.conf.settings_wrapper import settings from askbot.deps import livesettings from django.utils.translation import ugettext as _ USER_SETTINGS = livesettings.ConfigurationGroup( 'USER_SETTINGS', _('User policy settings') ) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'EDITABLE_SCREEN_NAME', default=True, description=_('Allow editing user screen name') ) ) settings.register( livesettings.IntegerValue( USER_SETTINGS, 'MIN_USERNAME_LENGTH', hidden=True, default=1, description=_('Minimum allowed length for screen name') ) ) settings.register(
""" External service key settings """ from askbot.conf.settings_wrapper import settings from askbot.deps import livesettings from django.utils.translation import ugettext as _ from django.conf import settings as django_settings LOGIN_PROVIDERS = livesettings.ConfigurationGroup('LOGIN_PROVIDERS', _('Login provider setings')) settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'PASSWORD_REGISTER_SHOW_PROVIDER_BUTTONS', default=True, description= _('Show alternative login provider buttons on the password "Sign Up" page' ), )) settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN', default=False, description=_( 'Always display local login form and hide "Askbot" button.'), )) providers = ( 'local',
from askbot.conf.super_groups import EXTERNAL_SERVICES from askbot.conf import settings as askbot_settings from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ SLACK_SETTINGS = livesettings.ConfigurationGroup( 'SLACK', _('Slack integration'), super_group=EXTERNAL_SERVICES ) askbot_settings.register( livesettings.BooleanValue( SLACK_SETTINGS, 'SLACK_ENABLED', default=False, description=_('Enable posting to Slack') ) ) askbot_settings.register( livesettings.StringValue( SLACK_SETTINGS, 'SLACK_USERNAME', default='', description=_('Slack user name'), ) ) askbot_settings.register( livesettings.StringValue(
""" User policy settings """ from askbot.conf.settings_wrapper import settings from askbot.deps import livesettings from django.utils.translation import ugettext as _ USER_SETTINGS = livesettings.ConfigurationGroup('USER_SETTINGS', _('User policy settings')) settings.register( livesettings.BooleanValue(USER_SETTINGS, 'EDITABLE_SCREEN_NAME', default=True, description=_('Allow editing user screen name'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'ALLOW_ACCOUNT_RECOVERY_BY_EMAIL', default=True, description=_('Allow account recovery by email'))) settings.register( livesettings.IntegerValue( USER_SETTINGS, 'MIN_USERNAME_LENGTH', hidden=True, default=1, description=_('Minimum allowed length for screen name')))
from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ ACCESS_CONTROL = livesettings.ConfigurationGroup( 'ACCESS_CONTROL', _('Access control settings'), super_group=LOGIN_USERS_COMMUNICATION) settings.register( livesettings.BooleanValue( ACCESS_CONTROL, 'ASKBOT_CLOSED_FORUM_MODE', default=False, description=_('Allow only registered user to access the forum'), )) EMAIL_VALIDATION_CASE_CHOICES = ( ('nothing', _('nothing - not required')), ('see-content', _('access to content')), #'post-content', _('posting content'), ) settings.register( livesettings.StringValue(ACCESS_CONTROL, 'REQUIRE_VALID_EMAIL_FOR', default='nothing', choices=EMAIL_VALIDATION_CASE_CHOICES, description=_('Require valid email for')))
super_group=LOGIN_USERS_COMMUNICATION) settings.register( livesettings.StringValue( EMAIL, 'EMAIL_SUBJECT_PREFIX', default=EMAIL_SUBJECT_PREFIX, description=_('Prefix for the email subject line'), help_text=_('This setting takes default from the django setting' 'EMAIL_SUBJECT_PREFIX. A value entered here will override' 'the default.'))) settings.register( livesettings.BooleanValue( EMAIL, 'ENABLE_EMAIL_ALERTS', default=True, description=_('Enable email alerts'), )) settings.register( livesettings.IntegerValue( EMAIL, 'MAX_ALERTS_PER_EMAIL', default=7, description=_('Maximum number of news entries in an email alert'))) settings.register( livesettings.StringValue( EMAIL, 'DEFAULT_NOTIFICATION_DELIVERY_SCHEDULE_Q_ALL', default='w',
return django_settings.ADMINS[0][1] except (AttributeError, IndexError): return '' settings.register( livesettings.StringValue( EMAIL, 'ADMIN_EMAIL', default=get_default_admin_email(), description=_('Site administrator email address'))) settings.register( livesettings.BooleanValue( EMAIL, 'ENABLE_EMAIL_ALERTS', default=True, description=_('Enable email alerts'), )) settings.register( livesettings.BooleanValue(EMAIL, 'INSTANT_EMAIL_ALERT_ENABLED', description=_('Enable instant email alerts'), default=True)) settings.register( livesettings.BooleanValue(EMAIL, 'WELCOME_EMAIL_ENABLED', description=_('Enable welcome email'), default=True))
""" User policy settings """ from askbot.conf.settings_wrapper import settings from askbot.deps import livesettings from django.utils.translation import ugettext as _ from askbot import const USER_SETTINGS = livesettings.ConfigurationGroup('USER_SETTINGS', _('User settings')) settings.register( livesettings.BooleanValue(USER_SETTINGS, 'EDITABLE_SCREEN_NAME', default=True, description=_('Allow editing user screen name'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'ALLOW_ACCOUNT_RECOVERY_BY_EMAIL', default=True, description=_('Allow account recovery by email'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'ALLOW_ADD_REMOVE_LOGIN_METHODS', default=True, description=_('Allow adding and removing login methods')))
Settings responsible for display of questions lists """ from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import DATA_AND_FORMATTING from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ QUESTION_LISTS = livesettings.ConfigurationGroup( 'QUESTION_LISTS', _('Listings of questions'), super_group=DATA_AND_FORMATTING) settings.register( livesettings.BooleanValue( QUESTION_LISTS, 'ALL_SCOPE_ENABLED', default=True, description=_('Enable "All Questions" selector'), help_text=_('At least one of these selectors must be enabled'))) settings.register( livesettings.BooleanValue( QUESTION_LISTS, 'UNANSWERED_SCOPE_ENABLED', default=True, description=_('Enable "Unanswered Questions" selector'), help_text=_('At least one of these selectors must be enabled'))) settings.register( livesettings.BooleanValue( QUESTION_LISTS, 'FOLLOWED_SCOPE_ENABLED',
from django.utils.translation import string_concat from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from askbot.skins import utils as skin_utils LOGIN_PROVIDERS = livesettings.ConfigurationGroup( 'LOGIN_PROVIDERS', _('Login provider setings'), super_group = LOGIN_USERS_COMMUNICATION ) settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'TERMS_CONSENT_REQUIRED', default=False, description=_('Acceptance of terms required at registration'), help_text=settings.get_related_settings_info(('FLATPAGES', 'TERMS', True)) ) ) #todo: remove this - we don't want the local login button #but instead always show the login/password field when used settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN', default = True, description=_('Always display local login form and hide "Askbot" button.'), ) )
Settings for askbot data display and entry """ from askbot.conf.settings_wrapper import settings from askbot.deps import livesettings from django.utils.translation import ugettext as _ from askbot import const FORUM_DATA_RULES = livesettings.ConfigurationGroup( 'FORUM_DATA_RULES', _('Settings for askbot data entry and display') ) settings.register( livesettings.BooleanValue( FORUM_DATA_RULES, 'WIKI_ON', default=True, description=_('Check to enable community wiki feature') ) ) settings.register( livesettings.BooleanValue( FORUM_DATA_RULES, 'ALLOW_ASK_ANONYMOUSLY', default=True, description=_('Allow asking questions anonymously'), help_text=_( 'Users do not accrue reputation for anonymous questions ' 'and their identity is not revealed until they change their ' 'mind' )
return django_settings.ADMINS[0][1] except: return '' settings.register( livesettings.StringValue( EMAIL, 'ADMIN_EMAIL', default=get_default_admin_email(), description=_('Site administrator email address'))) settings.register( livesettings.BooleanValue( EMAIL, 'ENABLE_EMAIL_ALERTS', default=True, description=_('Enable email alerts'), )) settings.register( livesettings.BooleanValue(EMAIL, 'INSTANT_EMAIL_ALERT_ENABLED', description=_('Enable instant email alerts'), default=True)) settings.register( livesettings.BooleanValue(EMAIL, 'WELCOME_EMAIL_ENABLED', description=_('Enable welcome email'), default=True))
'READ_ONLY_MODE_ENABLED', default=False, description=_('Make site read-only'), )) settings.register( StringValue(ACCESS_CONTROL, 'READ_ONLY_MESSAGE', default=_( 'The site is temporarily read-only. ' 'Only viewing of the content is possible at the moment.'))) settings.register( livesettings.BooleanValue( ACCESS_CONTROL, 'ASKBOT_CLOSED_FORUM_MODE', default=True, description=_('Allow only registered user to access the forum'), )) settings.register( livesettings.BooleanValue( ACCESS_CONTROL, 'NEW_REGISTRATIONS_DISABLED', default=False, description=_('Disable registration of new users'), )) settings.register( livesettings.LongStringValue( ACCESS_CONTROL, 'NEW_REGISTRATIONS_DISABLED_MESSAGE',
"""Settings for LDAP login for Askbot""" from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import EXTERNAL_SERVICES from askbot.deps import livesettings from django.utils.translation import ugettext as _ LDAP_SETTINGS = livesettings.ConfigurationGroup('LDAP_SETTINGS', _('LDAP login configuration'), super_group=EXTERNAL_SERVICES) settings.register( livesettings.BooleanValue( LDAP_SETTINGS, 'USE_LDAP_FOR_PASSWORD_LOGIN', description=_('Use LDAP authentication for the password login'), defaut=False)) settings.register( livesettings.StringValue(LDAP_SETTINGS, 'LDAP_URL', description=_('LDAP URL'), default="ldap://<host>:<port>")) settings.register( livesettings.StringValue(LDAP_SETTINGS, 'LDAP_BASEDN', description=_('LDAP BASE DN'))) settings.register( livesettings.StringValue(LDAP_SETTINGS, 'LDAP_SEARCH_SCOPE',
"""Settings for LDAP login for Askbot""" from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import EXTERNAL_SERVICES from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ LDAP_SETTINGS = livesettings.ConfigurationGroup('LDAP_SETTINGS', _('LDAP login configuration'), super_group=EXTERNAL_SERVICES) settings.register( livesettings.BooleanValue( LDAP_SETTINGS, 'USE_LDAP_FOR_PASSWORD_LOGIN', description=_('Use LDAP authentication for the password login'), defaut=True, update_callback=enable_ldap_callback)) settings.register( livesettings.BooleanValue( LDAP_SETTINGS, 'LDAP_AUTOCREATE_USERS', description=_('Automatically create user accounts when possible'), default=False, help_text=_( 'Potentially reduces number of steps in the registration process ' 'but can expose personal information, e.g. when LDAP login name is ' 'the same as email address or real name.'))) LDAP_PROTOCOL_VERSION_CHOICES = (('3', _('Version 3')), ('2',
from django.utils.translation import ugettext as _ from askbot import const USER_SETTINGS = livesettings.ConfigurationGroup( 'USER_SETTINGS', _('User settings'), super_group=LOGIN_USERS_COMMUNICATION) settings.register( livesettings.StringValue( USER_SETTINGS, 'NEW_USER_GREETING', default='', description=_('On-screen greeting shown to the new users'))) settings.register( livesettings.BooleanValue(USER_SETTINGS, 'EDITABLE_SCREEN_NAME', default=True, description=_('Allow editing user screen name'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'EDITABLE_EMAIL', default=True, description=_('Allow users change own email addresses'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'ALLOW_ACCOUNT_RECOVERY_BY_EMAIL', default=True, description=_('Allow account recovery by email')))
'DEFAULT_NOTIFICATION_DELIVERY_SCHEDULE', default='w', choices=const.NOTIFICATION_DELIVERY_SCHEDULE_CHOICES, description=_('Default news notification frequency'), help_text=_('This option currently defines default frequency ' 'of emailed updates in the following five categories: ' 'questions asked by user, answered by user, individually ' 'selected, entire forum (per person tag filter applies) ' 'and posts mentioning the user and comment responses'))) settings.register( livesettings.BooleanValue( EMAIL, 'ENABLE_UNANSWERED_REMINDERS', default=False, description=_('Send periodic reminders about unanswered questions'), help_text=_( 'NOTE: in order to use this feature, it is necessary to ' 'run the management command "send_unanswered_question_reminders" ' '(for example, via a cron job - with an appropriate frequency) ' 'and an IMAP server with a dedicated inbox must be configured '))) settings.register( livesettings.IntegerValue( EMAIL, 'DAYS_BEFORE_SENDING_UNANSWERED_REMINDER', default=1, description=_( 'Days before starting to send reminders about unanswered questions' ), ))
"""Group settings""" from django.utils.translation import ugettext_lazy as _ from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION from askbot.deps import livesettings GROUP_SETTINGS = livesettings.ConfigurationGroup( 'GROUP_SETTINGS', _('Group settings'), super_group=LOGIN_USERS_COMMUNICATION ) settings.register( livesettings.BooleanValue( GROUP_SETTINGS, 'GROUPS_ENABLED', default=False, description=_('Enable user groups'), ) ) # def group_name_update_callback(old_name, new_name): # from askbot.models.tag import clean_group_name # from askbot.models import Group # cleaned_new_name = clean_group_name(new_name.strip()) # # if new_name == '': # #name cannot be empty # return old_name # # group = Group.objects.get_global_group() # group.name = cleaned_new_name
'READ_ONLY_MODE_ENABLED', default=False, description=_('Make site read-only'), )) settings.register( StringValue(ACCESS_CONTROL, 'READ_ONLY_MESSAGE', default=_( 'The site is temporarily read-only. ' 'Only viewing of the content is possible at the moment.'))) settings.register( livesettings.BooleanValue( ACCESS_CONTROL, 'ASKBOT_CLOSED_FORUM_MODE', default=False, description=_('Allow only registered user to access the forum'), )) EMAIL_VALIDATION_CASE_CHOICES = ( ('nothing', _('nothing - not required')), ('see-content', _('access to content')), #'post-content', _('posting content'), ) settings.register( livesettings.StringValue(ACCESS_CONTROL, 'REQUIRE_VALID_EMAIL_FOR', default='nothing', choices=EMAIL_VALIDATION_CASE_CHOICES, description=_('Require valid email for')))
from askbot.conf.super_groups import LOGIN_USERS_COMMUNICATION from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from askbot.skins import utils as skin_utils LOGIN_PROVIDERS = livesettings.ConfigurationGroup( 'LOGIN_PROVIDERS', _('Login provider setings'), super_group = LOGIN_USERS_COMMUNICATION ) settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'PASSWORD_REGISTER_SHOW_PROVIDER_BUTTONS', default = True, description=_('Show alternative login provider buttons on the password "Sign Up" page'), ) ) #todo: remove this - we don't want the local login button #but instead always show the login/password field when used settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN', default = True, description=_('Always display local login form and hide "Askbot" button.'), ) )
"""Settings for content moderation and spam control""" from django.utils.translation import ugettext as _ from askbot import const from askbot.deps import livesettings from askbot.conf.settings_wrapper import settings SPAM_AND_MODERATION = livesettings.ConfigurationGroup( 'SPAM_AND_MODERATION', _('Spam control and content moderation')) settings.register( livesettings.BooleanValue( SPAM_AND_MODERATION, 'USE_AKISMET', description=_( 'Enable Akismet spam detection(keys below are required)'), default=False, help_text=_('To get an Akismet key please visit ' '<a href="%(url)s">Akismet site</a>') % {'url': const.DEPENDENCY_URLS['akismet']})) settings.register( livesettings.StringValue(SPAM_AND_MODERATION, 'AKISMET_API_KEY', description=_('Akismet key for spam detection')))
import re USER_SETTINGS = livesettings.ConfigurationGroup( 'USER_SETTINGS', _('User settings'), super_group=LOGIN_USERS_COMMUNICATION) settings.register( livesettings.LongStringValue( USER_SETTINGS, 'NEW_USER_GREETING', default='', description=_('On-screen greeting shown to the new users'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'ALLOW_ANONYMOUS_FEEDBACK', default=True, description=_('Allow anonymous users send feedback'))) settings.register( livesettings.BooleanValue(USER_SETTINGS, 'EDITABLE_SCREEN_NAME', default=True, description=_('Allow editing user screen name'))) settings.register( livesettings.BooleanValue( USER_SETTINGS, 'SHOW_ADMINS_PRIVATE_USER_DATA', default=False, description=_('Show email addresses to moderators')))
from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import CONTENT_AND_UI from askbot.deps import livesettings from askbot.skins import utils as skin_utils from django.utils.translation import ugettext as _ from django.conf import settings as django_settings LICENSE_SETTINGS = livesettings.ConfigurationGroup( 'LICENSE_SETTINGS', _('Content LicensContent License'), super_group=CONTENT_AND_UI) settings.register( livesettings.BooleanValue( LICENSE_SETTINGS, 'USE_LICENSE', description=_('Show license clause in the site footer'), default=True)) settings.register( livesettings.StringValue(LICENSE_SETTINGS, 'LICENSE_ACRONYM', description=_('Short name for the license'), default='cc-by-sa')) settings.register( livesettings.StringValue( LICENSE_SETTINGS, 'LICENSE_TITLE', description=_('Full name of the license'), default=_('Creative Commons Attribution Share Alike 3.0'),
from askbot.deps import livesettings from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from askbot.skins import utils as skin_utils LOGIN_PROVIDERS = livesettings.ConfigurationGroup( 'LOGIN_PROVIDERS', _('Login provider setings'), super_group = LOGIN_USERS_COMMUNICATION ) settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'TERMS_CONSENT_REQUIRED', default=False, description=_('Acceptance of terms required at registration'), help_text=settings.get_related_settings_info(('FLATPAGES', 'TERMS', True)) ) ) #todo: remove this - we don't want the local login button #but instead always show the login/password field when used settings.register( livesettings.BooleanValue( LOGIN_PROVIDERS, 'SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN', default = True, description=_('Always display local login form and hide "Askbot" button.'), ) )