manage py reset_db --noinput INFO root Executing DROP DATABASE db_agui

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ ./manage.py reset_db --noinput
INFO:root:Executing... "DROP DATABASE db_aguila2"
INFO:root:Error: нельзя удалить открытую в данный момент базу
INFO:root:Executing... "
CREATE DATABASE db_aguila2
WITH OWNER = u_aguila
ENCODING = 'UTF8'
TABLESPACE = pg_default;
"
Traceback (most recent call last):
File "./manage.py", line 50, in ?
execute_manager(settings)
File "/home/yya/aguila_root/aguila/libs/django/django/core/management/__init__.py", line 362, in execute_manager
utility.execute()
File "/home/yya/aguila_root/aguila/libs/django/django/core/management/__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/yya/aguila_root/aguila/libs/django/django/core/management/base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/yya/aguila_root/aguila/libs/django/django/core/management/base.py", line 222, in execute
output = self.handle(*args, **options)
File "/home/yya/aguila_root/aguila/libs/django-extensions/django_extensions/management/commands/reset_db.py", line 117, in handle
cursor.execute(create_query)
psycopg2.ProgrammingError: база "db_aguila2" уже существует