コード例 #1
0
from forum.settings.base import Setting, SettingSet
from django.forms.widgets import Textarea
from django.core.urlresolvers import reverse
from forum.settings import APP_URL

MAGNATE_FUNDS = SettingSet('MAGNATE_FUNDS', 'Magnate Funds',
                           "Setttings for Magnate Funds", 3000)
MAGNATE_LOBBIES = SettingSet('MAGNATE_LOBBY', 'Magnate Lobbies',
                             "Settings for Magnate Lobbies", 3000)

MAGNATE_FUND_TEMPLATES = {}
MAGNATE_LOBBY_TEMPLATES = {}

# In case the table for MagnateFund has not been created yet...
from django.db.utils import ProgrammingError, OperationalError

from donations.models import MagnateFund
try:
    for fund in MagnateFund.objects.all():
        FUND_METRICS_TEMPLATE = Setting(
            'FUND_%d_METRICS_TEMPLATE' % (fund.pk),
            """        <div class="fund_metrics-container">
        <div class="metrics-contentinner">
			<div class="metric">
			<article>
			<div class="metric-text">
			<p>Number of new Investments</p>
			</div>
			<div class="metric-amount1 metric-resize">17</div>
			</article>       
			</div>
コード例 #2
0
import datetime

from forum.settings.base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

from base import generate_installation_key

STATS_SET = SettingSet('stats', _('Stats Settings'), _("OSQA Stats Settings."),
                       100)

CHECK_FOR_UPDATES = Setting(
    'CHECK_FOR_UPDATES', True, STATS_SET,
    dict(label="Check for updates",
         help_text=_("""
Use the OSQA stats server recieve notifications about the latest updates.
"""),
         required=False))

SITE_KEY = Setting('SITE_KEY', generate_installation_key())

UPDATE_MESSAGES_XML = Setting('UPDATE_MESSAGES_XML', '')

LATEST_UPDATE_DATETIME = Setting('LATEST_UPDATES_DATETIME',
                                 datetime.datetime.now())

# Update server. Do not edit.
UPDATE_SERVER_URL = 'https://updater.osqa.net'
コード例 #3
0
from forum.settings.base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

LDAP_SET = SettingSet('ldap', _('LDAP settings'), _("LDAP configuration for OSQA"), 4)

LDAP_SERVER = Setting('LDAP_SERVER', '', LDAP_SET, dict(
label = _("LDAP Server"),
help_text = _("The hostname of your organization's LDAP server"),
required = False))

LDAP_USE_TLS = Setting('LDAP_USE_TLS', False, LDAP_SET, dict(
label = _("Use TLS"),
help_text = _("Check to use TLS"),
required = False))

LDAP_BIND_DN = Setting('LDAP_BIND_DN', '', LDAP_SET, dict(
label = _("DN for binding"),
help_text = _("Enter the DN to use to bind to the LDAP server (leave blank for anonymous bind)"),
required = False))

LDAP_BIND_SECRET = Setting('LDAP_BIND_SECRET', '', LDAP_SET, dict(
label = _("Password for binding"),
help_text = _("Password for binding DN above"),
required = False))

LDAP_BASE_DN = Setting('LDAP_BASE_DN', '', LDAP_SET, dict(
label = _("Base DN"),
help_text = _("The Base DN used to search for users"),
required = False))

LDAP_USER_MASK = Setting('LDAP_USER_MASK', 'UID=%s', LDAP_SET, dict(
コード例 #4
0
from forum.settings.base import Setting, SettingSet
from django.forms.widgets import Textarea
from django.core.urlresolvers import reverse
from forum.settings import APP_URL
from django.utils.translation import ugettext_lazy as _

ROBOTS_SET = SettingSet('robots', _('Robots txt'),
                        _("Set up the robots.txt file."), 3000)

ROBOTS_FILE = Setting(
    'ROBOTS_FILE', """Sitemap: %s/sitemap.xml

User-Agent: *
Disallow: /accounts/
Disallow: /users/
Disallow: /revisions/
Disallow: /search
Disallow: /matching_tags
Disallow: /*sort=
""" % APP_URL, ROBOTS_SET,
    dict(label=_("Robots.txt file"),
         help_text=_("""
The robots.txt file search engine spiders will see.
"""),
         widget=Textarea(attrs={'rows': '20'})))
from forum.settings.base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

API_SET = SettingSet('API', _('API settings'), _("API configuration for OSQA"), 4)

API_USERNAME = Setting('API_USERNAME', 'username', API_SET, dict(
label = _("Basic Auth username"),
help_text = _("Username for API access"),
required = True))

API_PASSWORD = Setting('API_PASSWORD', 'password', API_SET, dict(
label = _("Basic Auth password"),
help_text = _("Password for API access"),
required = True))
コード例 #6
0
import datetime

from forum.settings.base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

from base import generate_installation_key

UPDATER_SET = SettingSet('updater', _('Updater Settings'), _("OSQA Update Checker Settings."), 100)

CHECK_FOR_UPDATES = Setting('CHECK_FOR_UPDATES', True, UPDATER_SET, dict(
label = "Check for updates",
help_text = _("""
Use the OSQA update server recieve notifications about the latest updates.
"""),
required=False))

SITE_KEY = Setting('SITE_KEY', generate_installation_key())

UPDATE_MESSAGES_XML = Setting('UPDATE_MESSAGES_XML', '')

LATEST_UPDATE_DATETIME = Setting('LATEST_UPDATES_DATETIME', datetime.datetime.now())

# Update server. Do not edit.
UPDATE_SERVER_URL = 'https://updater.osqa.net'
コード例 #7
0
from forum.settings.base import Setting, SettingSet
from django.forms.widgets import Textarea
from django.core.urlresolvers import reverse
from forum.settings import APP_URL

ROBOTS_SET = SettingSet('robots', 'Robots txt', "Set up the robots.txt file.",
                        3000)

ROBOTS_FILE = Setting(
    'ROBOTS_FILE', """Sitemap: %s/sitemap.xml

User-Agent: *
Disallow: /accounts/
Disallow: /users/
Disallow: /revisions/
Disallow: /search
Disallow: /matching_tags
Disallow: /*sort=
""" % APP_URL, ROBOTS_SET,
    dict(label="Robots.txt file",
         help_text="""
The robots.txt file search engine spiders will see.
""",
         widget=Textarea(attrs={'rows': '20'})))
コード例 #8
0
ファイル: settings.py プロジェクト: isabella232/civipedia
import os

from django.conf import settings as djsettings
from forum.settings.base import Setting, SettingSet
from django.utils.translation import ugettext_lazy as _

EXPORTER_SET = SettingSet('exporter', _('Exporter settings'),
                          _("Data export settings"), 800)

EXPORTER_BACKUP_STORAGE = Setting(
    'EXPORTER_BACKUP_STORAGE',
    os.path.join(os.path.dirname(__file__), 'backups'), EXPORTER_SET,
    dict(label=_("Backups storage"),
         help_text=_("A folder to keep your backups organized.")))

MERGE_MAPPINGS = Setting('MERGE_MAPPINGS', {})
コード例 #9
0
from forum.settings.base import Setting, SettingSet
from django.forms.widgets import Select
from django.utils.translation import ugettext_lazy as _

CAS_PROTOCOL_CHOICES = (('cas1', _('CAS 1.0')), ('cas2', _('CAS 2.0')),
                        ('cas3', _('CAS 3.0')))

CAS_SET = SettingSet('cas', _('CAS settings'), _("CAS configuration for OSQA"),
                     4)

CAS_SERVER_URL = Setting(
    'CAS_SERVER_URL', '', CAS_SET,
    dict(
        label=_("CAS Server URL"),
        help_text=
        _("The URL of the CAS server to use for authentication, e.g. https://cas.example.org or https://example.org/cas/"
          ),
        required=False))

CAS_PROTOCOL = Setting(
    'CAS_PROTOCOL', 'cas3', CAS_SET,
    dict(
        label=_("CAS Protocol"),
        help_text=
        _("The CAS server protocol to use for ticket validation. Only CAS 3.0 supports attributes."
          ),
        widget=Select(choices=CAS_PROTOCOL_CHOICES),
        required=False))

CAS_ATTRIBUTE_NAME = Setting(
    'CAS_ATTRIBUTE_NAME', 'displayName', CAS_SET,
コード例 #10
0
from forum.settings.base import Setting, SettingSet
from django.forms.widgets import Textarea
from django.core.urlresolvers import reverse
from forum.settings import APP_URL

SLACKBOT_SET = SettingSet('slackbot', 'Slack bot', "Set up slack bot.", 3000)

SLACK_HOOK = Setting(
    'SLACK_HOOK', "", SLACKBOT_SET,
    dict(label="Slack webhook URL",
         help_text="""
Enter slack incomming webhook URL.
"""))