· 6 years ago · Jul 21, 2019, 06:12 PM
1cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ sudo -u postgres psql
2psql (9.6.13)
3Type "help" for help.
4
5postgres=# drop table info_clients;
6ERROR: table "info_clients" does not exist
7postgres-# \ве
8Invalid command \ве. Try \? for help.
9postgres-# \dt
10No relations found.
11postgres-# \dt+
12No relations found.
13postgres-# \dn+
14 List of schemas
15 Name | Owner | Access privileges | Description
16--------+----------+----------------------+------------------------
17 public | postgres | postgres=UC/postgres+| standard public schema
18 | | =UC/postgres |
19(1 row)
20
21postgres=# create database infodb;
22ERROR: database "infodb" already exists
23
24postgres-# \й
25Invalid command \й. Try \? for help.
26postgres-# \q
27cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py runserver 192.168.100.9:10000
28Watching for file changes with StatReloader
29Performing system checks...
30
31System check identified no issues (0 silenced).
32
33You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): info.
34Run 'python manage.py migrate' to apply them.
35
36July 21, 2019 - 17:50:16
37Django version 2.2.2, using settings 'backend.settings'
38Starting development server at http://192.168.100.9:10000/
39Quit the server with CONTROL-C.
40[21/Jul/2019 17:50:24] "GET / HTTP/1.1" 200 49996
41[21/Jul/2019 17:50:24] "GET /static/style.css HTTP/1.1" 200 2583
42[21/Jul/2019 17:50:24] "GET /static/Futura/stylesheet.css HTTP/1.1" 200 2899
43[21/Jul/2019 17:50:24] "GET /static/script.js HTTP/1.1" 200 4324
44[21/Jul/2019 17:50:24] "GET /static/popper.js HTTP/1.1" 200 21162
45[21/Jul/2019 17:50:24] "GET /static/map-magic.js HTTP/1.1" 200 1909
46[21/Jul/2019 17:50:24] "GET /static/form-magic.js HTTP/1.1" 200 859
47[21/Jul/2019 17:50:24] "GET /static/bootstrap.min.js HTTP/1.1" 200 58072
48[21/Jul/2019 17:50:25] "GET /static/bootstrap.css HTTP/1.1" 200 192348
49[21/Jul/2019 17:50:25] "GET /static/drawing.svg HTTP/1.1" 200 2967
50[21/Jul/2019 17:50:25] "GET /static/icons.svg HTTP/1.1" 200 28835
51[21/Jul/2019 17:50:25] "GET /static/jQuery.js HTTP/1.1" 200 349522
52Not Found: /favicon.ico
53[21/Jul/2019 17:50:25] "GET /favicon.ico HTTP/1.1" 404 2666
54Internal Server Error: /api/all/
55Traceback (most recent call last):
56 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
57 return self.cursor.execute(sql, params)
58psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
59LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
60 ^
61
62
63The above exception was the direct cause of the following exception:
64
65Traceback (most recent call last):
66 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
67 response = get_response(request)
68 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/base.py", line 115, in _get_response
69 response = self.process_exception_by_middleware(e, request)
70 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/base.py", line 113, in _get_response
71 response = wrapped_callback(request, *callback_args, **callback_kwargs)
72 File "/home/cretix/dev/Python/officeSite2019-final/backend/info/views.py", line 251, in getStatus
73 for elem in rooms:
74 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 274, in __iter__
75 self._fetch_all()
76 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 1242, in _fetch_all
77 self._result_cache = list(self._iterable_class(self))
78 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 55, in __iter__
79 results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
80 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql
81 cursor.execute(sql, params)
82 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 99, in execute
83 return super().execute(sql, params)
84 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 67, in execute
85 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
86 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
87 return executor(sql, params, many, context)
88 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
89 return self.cursor.execute(sql, params)
90 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
91 raise dj_exc_value.with_traceback(traceback) from exc_value
92 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
93 return self.cursor.execute(sql, params)
94django.db.utils.ProgrammingError: column info_room.more_info does not exist
95LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
96 ^
97
98[21/Jul/2019 17:50:25] "GET /api/all/ HTTP/1.1" 500 16364
99Internal Server Error: /api/1
100Traceback (most recent call last):
101 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
102 return self.cursor.execute(sql, params)
103psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
104LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
105 ^
106
107 ^
108
109[21/Jul/2019 17:50:28] "GET /api/1 HTTP/1.1" 500 16361
110^Ccretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ pyhton3 managey makemigrations
111-bash: pyhton3: command not found
112cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
113CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0002_auto_20190605_1222, 0004_auto_20190523_1855 in info).
114To fix them run 'python manage.py makemigrations --merge'
115cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations --merge
116Merging info
117 Branch 0002_auto_20190605_1222
118 - Create model Client
119 - Create model UnionOffices
120 - Add field price to room
121 - Add field type_room to room
122 Branch 0004_auto_20190523_1855
123 - Create model Client
124 - Create model Room
125 - Create model UnionOffices
126 - Rename field email on client to name
127 - Rename field first_name on client to number
128 - Rename field phone on client to surname
129 - Remove field second_name from client
130 - Alter field price on room
131
132Merging will only work if the operations printed above do not conflict
133with each other (working on different fields or models)
134Do you want to merge these migration branches? [y/N] y
135
136Created new merge migration /home/cretix/dev/Python/officeSite2019-final/backend/info/migrations/0005_merge_20190721_1752.py
137cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
138Migrations for 'info':
139 info/migrations/0006_auto_20190721_1752.py
140 - Remove field number from client
141 - Remove field surname from client
142 - Add field contact to client
143 - Add field date to client
144 - Add field offices to client
145 - Add field time to client
146 - Add field more_info to room
147 - Add field name to unionoffices
148 - Alter field status on room
149cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py migrate
150Operations to perform:
151 Apply all migrations: admin, auth, contenttypes, info, sessions
152Running migrations:
153 Applying info.0002_client_room_unionoffices...Traceback (most recent call last):
154 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 82, in _execute
155 return self.cursor.execute(sql)
156psycopg2.errors.DuplicateTable: relation "info_client" already exists
157
158
159The above exception was the direct cause of the following exception:
160
161Traceback (most recent call last):
162 File "manage.py", line 15, in <module>
163 execute_from_command_line(sys.argv)
164 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
165 utility.execute()
166 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute
167 self.fetch_command(subcommand).run_from_argv(self.argv)
168 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 323, in run_from_argv
169 self.execute(*args, **cmd_options)
170 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 364, in execute
171 output = self.handle(*args, **options)
172 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 83, in wrapped
173 res = handle_func(*args, **kwargs)
174 File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 234, in handle
175 fake_initial=fake_initial,
176 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 117, in migrate
177 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
178 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
179 state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
180 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
181 state = migration.apply(state, schema_editor)
182 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/migration.py", line 124, in apply
183 operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
184 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 92, in database_forwards
185 schema_editor.create_model(model)
186 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 307, in create_model
187 self.execute(sql, params or None)
188 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 137, in execute
189 cursor.execute(sql, params)
190 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 99, in execute
191 return super().execute(sql, params)
192 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 67, in execute
193 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
194 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
195 return executor(sql, params, many, context)
196 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
197 return self.cursor.execute(sql, params)
198 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
199 raise dj_exc_value.with_traceback(traceback) from exc_value
200 File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 82, in _execute
201 return self.cursor.execute(sql)
202django.db.utils.ProgrammingError: relation "info_client" already exists