# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT = environ.get('EMAIL_PORT', 587)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL = EMAIL_HOST_USER
########## END EMAIL CONFIGURATION


########## DATABASE CONFIGURATION
DATABASES = postgresify() #FOR IN-HEROKU DB
#DATABASES = {
#    'default': {
#        'ENGINE': 'django.db.backends.postgresql_psycopg2',
#        'NAME': environ.get('AWS_DB_NAME', ''),
#        'USER': environ.get('AWS_DB_USER', ''),
#        'PASSWORD': environ.get('AWS_DB_PW', ''),
#        'HOST': environ.get('AWS_DB_HOST', ''),
#        'PORT': environ.get('AWS_DB_PORT', ''),
#    }
#}
########## END DATABASE CONFIGURATION


########## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
Beispiel #2
0
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT = environ.get('EMAIL_PORT', 587)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL = EMAIL_HOST_USER
########## END EMAIL CONFIGURATION


########## DATABASE CONFIGURATION
DATABASES = postgresify()
########## END DATABASE CONFIGURATION


########## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = memcacheify()
########## END CACHE CONFIGURATION


########## CELERY CONFIGURATION
# See: http://docs.celeryproject.org/en/latest/configuration.html#broker-transport
BROKER_TRANSPORT = 'amqplib'

# Set this number to the amount of allowed concurrent connections on your AMQP
# provider, divided by the amount of active workers you have.
 def test_doesnt_include_a_database_twice_if_it_is_set_as_default(self):
     environ['DATABASE_URL'] = 'postgres://abc:[email protected]/xxx'
     environ['HEROKU_POSTGRESQL_AQUA_URL'] = 'postgres://abc:[email protected]/xxx'
     self.assertFalse('AQUA' in postgresify())
     del environ['DATABASE_URL']
     del environ['HEROKU_POSTGRESQL_AQUA_URL']
 def test_returns_empty_dict_if_no_dbs_are_available(self):
     self.assertEqual(postgresify(), {})
 def test_detects_heroku_databases(self):
     environ['HEROKU_POSTGRESQL_TEAL_URL'] = 'postgres://abc:[email protected]/xxx'
     self.assertTrue(postgresify()['TEAL'])
     del environ['HEROKU_POSTGRESQL_TEAL_URL']
 def test_detects_heroku_postgres_shared_database(self):
     environ['HEROKU_SHARED_POSTGRESQL_RED_URL'] = 'postgres://abc:[email protected]/xxx'
     self.assertTrue(postgresify()['SHARED_RED'])
     del environ['HEROKU_SHARED_POSTGRESQL_RED_URL']
 def test_detects_shared_database(self):
     environ['SHARED_DATABASE_URL'] = 'postgres://abc:[email protected]/xxx'
     self.assertTrue(postgresify()['SHARED_DATABASE'])
     del environ['SHARED_DATABASE_URL']
 def test_detects_database_url(self):
     environ['DATABASE_URL'] = 'postgres://abc:[email protected]/xxx'
     self.assertTrue(postgresify()['default'])
     del environ['DATABASE_URL']
Beispiel #9
0
 def test_detects_database_url(self):
     environ["DATABASE_URL"] = "postgres://abc:[email protected]/xxx"
     self.assertTrue(postgresify()["default"])
     del environ["DATABASE_URL"]