Don't overwrite settings/local.py in subsequent initialsetup executions
This commit is contained in:
@@ -15,7 +15,12 @@ class Command(management.BaseCommand):
|
||||
return get_random_string(50, chars)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
with open(os.path.join(settings.BASE_DIR, 'mayan', 'settings', 'local.py'), 'w+') as file_object:
|
||||
path = os.path.join(settings.BASE_DIR, 'mayan', 'settings', 'local.py')
|
||||
if os.path.exists(path):
|
||||
print 'Existing file at: {0}. Backup, remove this file and try again.'.format(path)
|
||||
exit(1)
|
||||
|
||||
with open(path, 'w+') as file_object:
|
||||
file_object.write('\n'.join([
|
||||
'from __future__ import absolute_import',
|
||||
'',
|
||||
|
||||
Reference in New Issue
Block a user