Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.58 KB | None | 0 0
  1. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ sudo -u postgres psql
  2. psql (9.6.13)
  3. Type "help" for help.
  4.  
  5. postgres=# drop table info_clients;
  6. ERROR: table "info_clients" does not exist
  7. postgres-# \ве
  8. Invalid command \ве. Try \? for help.
  9. postgres-# \dt
  10. No relations found.
  11. postgres-# \dt+
  12. No relations found.
  13. postgres-# \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.  
  21. postgres=# create database infodb;
  22. ERROR: database "infodb" already exists
  23.  
  24. postgres-# \й
  25. Invalid command \й. Try \? for help.
  26. postgres-# \q
  27. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py runserver 192.168.100.9:10000
  28. Watching for file changes with StatReloader
  29. Performing system checks...
  30.  
  31. System check identified no issues (0 silenced).
  32.  
  33. You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): info.
  34. Run 'python manage.py migrate' to apply them.
  35.  
  36. July 21, 2019 - 17:50:16
  37. Django version 2.2.2, using settings 'backend.settings'
  38. Starting development server at http://192.168.100.9:10000/
  39. Quit 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
  52. Not Found: /favicon.ico
  53. [21/Jul/2019 17:50:25] "GET /favicon.ico HTTP/1.1" 404 2666
  54. Internal Server Error: /api/all/
  55. Traceback (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)
  58. psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
  59. LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
  60. ^
  61.  
  62.  
  63. The above exception was the direct cause of the following exception:
  64.  
  65. Traceback (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)
  94. django.db.utils.ProgrammingError: column info_room.more_info does not exist
  95. LINE 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
  99. Internal Server Error: /api/1
  100. Traceback (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)
  103. psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
  104. LINE 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
  112. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
  113. CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0002_auto_20190605_1222, 0004_auto_20190523_1855 in info).
  114. To fix them run 'python manage.py makemigrations --merge'
  115. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations --merge
  116. Merging 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.  
  132. Merging will only work if the operations printed above do not conflict
  133. with each other (working on different fields or models)
  134. Do you want to merge these migration branches? [y/N] y
  135.  
  136. Created new merge migration /home/cretix/dev/Python/officeSite2019-final/backend/info/migrations/0005_merge_20190721_1752.py
  137. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
  138. Migrations 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
  149. cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py migrate
  150. Operations to perform:
  151. Apply all migrations: admin, auth, contenttypes, info, sessions
  152. Running 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)
  156. psycopg2.errors.DuplicateTable: relation "info_client" already exists
  157.  
  158.  
  159. The above exception was the direct cause of the following exception:
  160.  
  161. Traceback (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)
  202. django.db.utils.ProgrammingError: relation "info_client" already exists
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement