Better Appconfig Example

This commit is contained in:
Martin Mahner 2018-06-22 13:04:08 +02:00
parent 7671362b52
commit 5fb4a7248e
2 changed files with 15 additions and 9 deletions

View file

@ -116,12 +116,12 @@ TEMPLATES = [
}, },
] ]
INSTALLED_APPS = ( INSTALLED_APPS = [
'staticinline', 'staticinline',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.sessions', 'django.contrib.sessions',
'dpaste.apps.dpasteAppConfig', 'dpaste.apps.dpasteAppConfig',
) ]
DATABASES = { DATABASES = {
'default': { 'default': {

View file

@ -26,14 +26,20 @@ if not 'runsslserver' in sys.argv:
# #
# from dpaste.apps import dpasteAppConfig # from dpaste.apps import dpasteAppConfig
# from django.utils.translation import ugettext_lazy as _
# #
# class MyBetterDpasteAppConfig(dpasteAppConfig): # class ProductionDpasteAppConfig(dpasteAppConfig):
# SLUG_LENGTH = 8 # SLUG_LENGTH = 8
# LEXER_DEFAULT = 'js' # LEXER_DEFAULT = 'js'
# # EXPIRE_CHOICES = (
# INSTALLED_APPS = ( # ('onetime', _(u'One Time Snippet')),
# 'staticinline', # (3600, _(u'Expire in one hour')),
# 'django.contrib.staticfiles', # (3600 * 24, _('Expire in one day')),
# 'django.contrib.sessions', # (3600 * 24 * 7, _('Expire in one week')),
# 'dpaste.settings.local.MyBetterDpasteAppConfig', # (3600 * 24 * 31, _('Expire in one month')),
# ) # )
# EXPIRE_DEFAULT = 3600 * 24 * 7
#
# INSTALLED_APPS.remove('dpaste.apps.dpasteAppConfig')
# INSTALLED_APPS.append('dpaste.settings.local.ProductionDpasteAppConfig')