from __future__ import with_statement
-# temporary imports, delete at end of file
-import os, sys, solace, tempfile
# propagate early. That way we can import "from solace import settings"
# when the settings is not yet set up. This is needed because during
# bootstrapping we're have carefully crafted circular dependencies between
# the settings and the internationalization support module.
solace.settings = sys.modules['solace.settings']
#: i18n support, leave in place for custom settings modules
from solace.i18n import lazy_gettext as _
-#: the platform we're running on
-DATABASE_URI = 'sqlite:///%s/solace.db' % tempfile.gettempdir()
-#: the title of the website
-WEBSITE_TITLE = _(u'Plurk Solace')
-#: the tagline of the website
-WEBSITE_TAGLINE = _(u'Comfort others, become enlighted')
-#: the authority name for the tag URIs. This has to be a valid authorityName
-#: as specified in :rfc:`4151`. Set this to your toplevel domain.
-TAG_AUTHORITY = 'example.com'
-#: if set to true the db layer tracks the queries on the active request
-#: if set to True, queries are printed to stderr
-#: mysql table charset (only relevant for table creation)
-MYSQL_TABLE_CHARSET = 'utf8'
-#: mysql engine (only relevant for table creation)
-#: if mysql is enabled, this timeout is used for the pool recycling
-MYSQL_POOL_RECYCLE = 300
-#: the auth system to use
-AUTH_SYSTEM = 'solace.auth.InternalAuth'
-#: the URL for gravatars. Usually it does not really make sense
-#: to change this value.
-GRAVATAR_URL = 'http://www.gravatar.com/avatar/'
-#: the gravatar fallback to use
-#: valid values are "default", "identicon", "monsterid" or "wavatar"
-GRAVATAR_FALLBACK = 'identicon'
-#: the theme for the application. Currently only "teal" is supported.
-#: a list of directories where the system will look for themes. The
-#: default path is automatically searched for templates.
-#: a list of hosts we allow redirects to
-ALLOWED_REDIRECTS = ['*.plurk.com', 'localhost']
-#: should recaptcha be enabled for certain pages (register)
-#: should the communication to the recaptcha server use SSL?
-RECAPTCHA_USE_SSL = False
-#: the private key for recaptcha (by default a cross-domain one
-#: for solace is used, better replace it)
-RECAPTCHA_PRIVATE_KEY = '6Le-CwgAAAAAAPEqdPwmcTDtDL8uZ6HRdRAL84vC'
-#: the public key for recaptcha (by default a cross-domain one
-#: for solace is used, better replace it)
-RECAPTCHA_PUBLIC_KEY = '6Le-CwgAAAAAAOeW5o377JeX9sD1VWwOk_VpX_B6'
-#: set to `False` if you want to activate users automatically without
-REGISTRATION_REQUIRES_ACTIVATION = True
-#: if set to a string, mails are logged to that file instead of
-#: being sent to the MTA. This is a good idea for development.
-#: this may also be set to a file object but this is only
-#: recommended for testing and interactive sessions.
-#: the mail address mails sent by the system are sent from
-#: make sure to change this.
-MAIL_FROM = 'email@example.com'
-#: the display name for the from address. If not set the website
-#: title is used instead.
-#: the signature that is attached to all mails
-#: the SMTP host for mail
-#: the SMTP port for mail
-#: if the SMTP server requires authentication, the user has to
-#: if the SMTP server requires authentication, the password
-#: has to be specified here
-#: the default language that is assumed if the client does not send
-#: a language information etc. This language also has to be listed
-#: in the LANGUAGE_SECTIONS list.
-#: the languages for which sections exist. Ideally we also have
-#: translations of the application for these languages, but if a
-#: language is missing in the UI it falls back to english.
-LANGUAGE_SECTIONS = ['en', 'de', 'ru', 'fr']
- #: if other users upvote your post you gain one in reputation
- #: you gain 1 if a question was upvoted.
- #: if other users downvote your post you lose two in reputation
- #: you have to pay downvotes with one reputation
- #: if your post is accepted as an answer you gain 50 reputation
- #: if your post was degraded from answer to post, you will lose
- #: this amount of reputation again. If set to a lower value
- #: than GAIN_ON_ACCEPTED_ANSWER the users will be able to trick
- #: the system by switching between answers.
- #: how much reputation is needed to be able to accept answers
- #: on other people's questions?
- #: how much reputation is needed to be able to accept your own
- #: answer on other people's questions?
- #: how much reputation is needed to be able to unaccept any post
- #: how much reputation is needed to edit other people's posts?
- #: how much reputation is needed in order to upvote other people?
- #: how much reputation is needed in order to downvote?
- #: at what level of reputation is a user a moderator?
-#: if solace is used behind a proxy, this is better set to true to
-#: let the system know to interpret proxy headers. For security
-#: reasons you should not set this if you are *not* deploying behind
+ """Reverts the known settings to the defaults."""
+ from os.path import join, dirname
+ configure_from_file(join(dirname(__file__), 'default_settings.cfg'))
+ """Finds settings in the environment."""
+ if 'SOLACE_SETTINGS_FILE' in os.environ:
"""Configures from a file."""
return sorted([(k,) + v for k, v in items.items()])
-if 'SOLACE_SETTINGS_FILE' in os.environ:
-del os, sys, solace, tempfile