savage-lands/usr/etc/django/build/local_generated.py.bak

170 lines
4.6 KiB
Python
Raw Permalink Normal View History

2025-04-17 00:41:48 +03:00
# this file contains settings that are automatically generated
# put custom commands/ imports in a separate file!
LOCAL_SETTINGS = True # avoid recursive imports
BRANCH = 'development'
from core.settings import *
import logging
LOCAL_LOGGING_PREFIX = "%s %%(message)s" % BRANCH
logging.basicConfig(format=LOCAL_LOGGING_PREFIX, level=logging.DEBUG)
SITE_ID = 1
TEMPLATES[0]['DIRS'].append(
"/Users/ronny/projects/django/savage_lands.prj/share/templates")
#
# NOTE: a lot of the code in these local settings files are automated and you
# might be inclined to take them out and move them into the main settings.py
# file. That would be a mistake. These automatic files AT THE VERY LEAST have
# one variable, and that is WHICH BRANCH CONFIGURATION FILE ARE WE LOOKING AT.
# Once I set that file, THEN all the rest of the information can be automated.
# So all these automated info needs to be here.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'savage_lands_dvp',
'USER': 'ronny',
'PASSWORD': 'admin',
'HOST': 'localhost',
'PORT': '49036',
}
}
#
# directory from which we serve static files
#
# NOTE: both STATIC and MEDIA roots are getting their values from the
# initialization files that are set up above. Also, MEDIA_ROOT is being set
# to something called "paths.server.media.dynamic" - the names are different,
# but it means the same thing.
#
# MEDIA_ROOT is the dynamic media information that the web server, user or
# admin # will be adding and taking out. It's why I call it "dynamic"
STATIC_ROOT = '/usr/local/var/www/savage_lands.dvp/public/media/static'
MEDIA_ROOT = '/usr/local/var/www/savage_lands.dvp/public/media/dynamic'
# directories from which we search for static files to place in STATIC_ROOT
# these static files are located within the project root as opposed to the
# server root location
STATICFILES_DIRS = (
os.path.join("/Users/ronny/projects/django/savage_lands.prj", "share", "media"),
)
# debug and debug toolbar settings
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
USE_DEBUG_TOOLBAR = DEBUG
# allow template debug outputs on development environment
INTERNAL_IPS = ['127.0.0.1', '127.0.0.2', '127.0.0.3', ]
ALLOWED_HOSTS = ['savage_lands.dvp', 'PROJECT_NAME.BRANCH_EXT', 'localhost', '127.0.0.1']
# -----------------------------------------
# Debug logging to the console
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': "%(levelname)s %(asctime)s %(module)s %(process)d"
" %(thread)d %(message)s"
},
'simple': {
'format': '%(levelname)s:%(module)s - %(message)s'
},
'code': {
'format': "%(module)s:%(funcName)s:%(lineno)d - %(message)s"
},
'code.file': {
'format': "%(levelname)s %(module)s:%(funcName)s - %(message)s\n"
},
},
'handlers': {
'file.log': {
'class': 'logging.FileHandler',
'filename':
'/Users/ronny/projects/django/savage_lands.prj/var/log/django.log',
'formatter': 'code.file'
},
'file.log.debug': {
'class': 'logging.FileHandler',
'filename':
'/Users/ronny/projects/django/savage_lands.prj/var/log/django.log.debug',
'formatter': 'code.file'
},
'server.file.log.debug': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename':
'/usr/local/var/www/savage_lands.dvp/logs/django/django.log.debug',
'formatter': 'code.file'
},
'console': {
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'console.code': {
'class': 'logging.StreamHandler',
'formatter': 'code',
},
'null': {
'class': 'logging.NullHandler',
}
},
'root': {
# automatically set to level WARNING
'handlers': ['console.code', 'file.log', 'server.file.log.debug' ],
'propagate': True,
},
'loggers': {
'django.info': {
'handlers':
[
'console',
'file.log'
],
'level': 'INFO',
'propagate': False,
},
'django.debug': {
'handlers':
[
'console.code',
'file.log.debug',
'server.file.log.debug',
],
'level': 'DEBUG',
'propagate': True,
},
}
}