LOGGING = {
...,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO',
},
},
}
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
...
}
$ docker volume create --name mysql_data
$ docker run -v mysql_data:/var/lib/mysql mysql
import os
def safe_path(path):
name, ext = os.path.splitext(path)
while True:
current_name = name + ext
if not os.path.exists(current_name):
return current_name
name += '_'
if __name__ == '__main__':
open('/tmp/1.txt', 'a').close()
open('/tmp/1_.txt', 'a').close()
assert safe_path('/tmp/1.txt') == '/tmp/1__.txt'
python setup.py develop