Merge branch 'master' into test_submission_views_365
This commit is contained in:
commit
9247769a14
@ -10,4 +10,7 @@ Step 2: ?
|
||||
|
||||
Step 3: Write the deployment guide and profit!
|
||||
|
||||
But seriously, this is a stub since we're not quite there, yet.
|
||||
But seriously, this is a stub since we're not quite there (yet) but if
|
||||
you want to see where we are now, you can try to run the latest
|
||||
development version by following the instructions at
|
||||
:ref:`hacking-howto`.
|
||||
|
@ -60,7 +60,7 @@ requirements::
|
||||
On Fedora::
|
||||
|
||||
yum install mongodb-server python-paste-deploy python-paste-script \
|
||||
git-core python python-devel
|
||||
git-core python python-devel python-lxml
|
||||
|
||||
.. YouCanHelp::
|
||||
|
||||
|
@ -93,12 +93,6 @@ class MediaGoblinApp(object):
|
||||
#######################################################
|
||||
|
||||
setup_globals(
|
||||
# TODO: No need to set these two up as globals, we could
|
||||
# just read them out of mg_globals.app_config
|
||||
email_sender_address=app_config['email_sender_address'],
|
||||
email_debug_mode=app_config['email_debug_mode'],
|
||||
|
||||
# Actual, useful to everyone objects
|
||||
app=self,
|
||||
db_connection=self.connection,
|
||||
database=self.db,
|
||||
|
@ -112,7 +112,7 @@ def send_verification_email(user, request):
|
||||
|
||||
# TODO: There is no error handling in place
|
||||
send_email(
|
||||
mg_globals.email_sender_address,
|
||||
mg_globals.app_config['email_sender_address'],
|
||||
[user['email']],
|
||||
# TODO
|
||||
# Due to the distributed nature of GNU MediaGoblin, we should
|
||||
|
@ -1,7 +1,7 @@
|
||||
[mediagoblin]
|
||||
# database stuff
|
||||
db_host = string()
|
||||
db_name = string()
|
||||
db_name = string(default="mediagoblin")
|
||||
db_port = integer()
|
||||
|
||||
#
|
||||
|
@ -30,7 +30,7 @@ def connect_database_from_config(app_config):
|
||||
|
||||
def setup_connection_and_db_from_config(app_config):
|
||||
connection = connect_database_from_config(app_config)
|
||||
database_path = app_config.get('db_name', 'mediagoblin')
|
||||
database_path = app_config['db_name']
|
||||
db = connection[database_path]
|
||||
models.register_models(connection)
|
||||
# Could configure indexes here on db
|
||||
|
@ -62,7 +62,7 @@ def setup_celery_from_config(app_config, global_config,
|
||||
celery_mongo_settings['port'] = app_config['db_port']
|
||||
if celery_settings['BROKER_BACKEND'] == 'mongodb':
|
||||
celery_settings['BROKER_PORT'] = app_config['db_port']
|
||||
celery_mongo_settings['database'] = app_config.get('db_name', 'mediagoblin')
|
||||
celery_mongo_settings['database'] = app_config['db_name']
|
||||
|
||||
celery_settings['CELERY_MONGODB_BACKEND_SETTINGS'] = celery_mongo_settings
|
||||
|
||||
|
@ -20,12 +20,6 @@ database = None
|
||||
public_store = None
|
||||
queue_store = None
|
||||
|
||||
# Dump mail to stdout instead of sending it:
|
||||
email_debug_mode = False
|
||||
|
||||
# Address for sending out mails
|
||||
email_sender_address = None
|
||||
|
||||
# A WorkBenchManager
|
||||
workbench_manager = None
|
||||
|
||||
|
@ -265,9 +265,9 @@ def send_email(from_addr, to_addrs, subject, message_body):
|
||||
- message_body: email body text
|
||||
"""
|
||||
# TODO: make a mock mhost if testing is enabled
|
||||
if TESTS_ENABLED or mg_globals.email_debug_mode:
|
||||
if TESTS_ENABLED or mg_globals.app_config['email_debug_mode']:
|
||||
mhost = FakeMhost()
|
||||
elif not mg_globals.email_debug_mode:
|
||||
elif not mg_globals.app_config['email_debug_mode']:
|
||||
mhost = smtplib.SMTP()
|
||||
|
||||
mhost.connect()
|
||||
@ -280,7 +280,7 @@ def send_email(from_addr, to_addrs, subject, message_body):
|
||||
if TESTS_ENABLED:
|
||||
EMAIL_TEST_INBOX.append(message)
|
||||
|
||||
if getattr(mg_globals, 'email_debug_mode', False):
|
||||
if mg_globals.app_config['email_debug_mode']:
|
||||
print u"===== Email ====="
|
||||
print u"From address: %s" % message['From']
|
||||
print u"To addresses: %s" % message['To']
|
||||
|
Loading…
x
Reference in New Issue
Block a user