Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ sudo -u postgres psql
- psql (9.6.13)
- Type "help" for help.
- postgres=# drop table info_clients;
- ERROR: table "info_clients" does not exist
- postgres-# \ве
- Invalid command \ве. Try \? for help.
- postgres-# \dt
- No relations found.
- postgres-# \dt+
- No relations found.
- postgres-# \dn+
- List of schemas
- Name | Owner | Access privileges | Description
- --------+----------+----------------------+------------------------
- public | postgres | postgres=UC/postgres+| standard public schema
- | | =UC/postgres |
- (1 row)
- postgres=# create database infodb;
- ERROR: database "infodb" already exists
- postgres-# \й
- Invalid command \й. Try \? for help.
- postgres-# \q
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py runserver 192.168.100.9:10000
- Watching for file changes with StatReloader
- Performing system checks...
- System check identified no issues (0 silenced).
- You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): info.
- Run 'python manage.py migrate' to apply them.
- July 21, 2019 - 17:50:16
- Django version 2.2.2, using settings 'backend.settings'
- Starting development server at http://192.168.100.9:10000/
- Quit the server with CONTROL-C.
- [21/Jul/2019 17:50:24] "GET / HTTP/1.1" 200 49996
- [21/Jul/2019 17:50:24] "GET /static/style.css HTTP/1.1" 200 2583
- [21/Jul/2019 17:50:24] "GET /static/Futura/stylesheet.css HTTP/1.1" 200 2899
- [21/Jul/2019 17:50:24] "GET /static/script.js HTTP/1.1" 200 4324
- [21/Jul/2019 17:50:24] "GET /static/popper.js HTTP/1.1" 200 21162
- [21/Jul/2019 17:50:24] "GET /static/map-magic.js HTTP/1.1" 200 1909
- [21/Jul/2019 17:50:24] "GET /static/form-magic.js HTTP/1.1" 200 859
- [21/Jul/2019 17:50:24] "GET /static/bootstrap.min.js HTTP/1.1" 200 58072
- [21/Jul/2019 17:50:25] "GET /static/bootstrap.css HTTP/1.1" 200 192348
- [21/Jul/2019 17:50:25] "GET /static/drawing.svg HTTP/1.1" 200 2967
- [21/Jul/2019 17:50:25] "GET /static/icons.svg HTTP/1.1" 200 28835
- [21/Jul/2019 17:50:25] "GET /static/jQuery.js HTTP/1.1" 200 349522
- Not Found: /favicon.ico
- [21/Jul/2019 17:50:25] "GET /favicon.ico HTTP/1.1" 404 2666
- Internal Server Error: /api/all/
- Traceback (most recent call last):
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
- return self.cursor.execute(sql, params)
- psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
- LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
- ^
- The above exception was the direct cause of the following exception:
- Traceback (most recent call last):
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
- response = get_response(request)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/base.py", line 115, in _get_response
- response = self.process_exception_by_middleware(e, request)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/handlers/base.py", line 113, in _get_response
- response = wrapped_callback(request, *callback_args, **callback_kwargs)
- File "/home/cretix/dev/Python/officeSite2019-final/backend/info/views.py", line 251, in getStatus
- for elem in rooms:
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 274, in __iter__
- self._fetch_all()
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 1242, in _fetch_all
- self._result_cache = list(self._iterable_class(self))
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/query.py", line 55, in __iter__
- results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql
- cursor.execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 99, in execute
- return super().execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 67, in execute
- return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
- return executor(sql, params, many, context)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
- return self.cursor.execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
- raise dj_exc_value.with_traceback(traceback) from exc_value
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
- return self.cursor.execute(sql, params)
- django.db.utils.ProgrammingError: column info_room.more_info does not exist
- LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
- ^
- [21/Jul/2019 17:50:25] "GET /api/all/ HTTP/1.1" 500 16364
- Internal Server Error: /api/1
- Traceback (most recent call last):
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
- return self.cursor.execute(sql, params)
- psycopg2.errors.UndefinedColumn: column info_room.more_info does not exist
- LINE 1: ...s", "info_room"."price", "info_room"."type_room", "info_room...
- ^
- ^
- [21/Jul/2019 17:50:28] "GET /api/1 HTTP/1.1" 500 16361
- ^Ccretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ pyhton3 managey makemigrations
- -bash: pyhton3: command not found
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
- CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0002_auto_20190605_1222, 0004_auto_20190523_1855 in info).
- To fix them run 'python manage.py makemigrations --merge'
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations --merge
- Merging info
- Branch 0002_auto_20190605_1222
- - Create model Client
- - Create model UnionOffices
- - Add field price to room
- - Add field type_room to room
- Branch 0004_auto_20190523_1855
- - Create model Client
- - Create model Room
- - Create model UnionOffices
- - Rename field email on client to name
- - Rename field first_name on client to number
- - Rename field phone on client to surname
- - Remove field second_name from client
- - Alter field price on room
- Merging will only work if the operations printed above do not conflict
- with each other (working on different fields or models)
- Do you want to merge these migration branches? [y/N] y
- Created new merge migration /home/cretix/dev/Python/officeSite2019-final/backend/info/migrations/0005_merge_20190721_1752.py
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py makemigrations
- Migrations for 'info':
- info/migrations/0006_auto_20190721_1752.py
- - Remove field number from client
- - Remove field surname from client
- - Add field contact to client
- - Add field date to client
- - Add field offices to client
- - Add field time to client
- - Add field more_info to room
- - Add field name to unionoffices
- - Alter field status on room
- cretix@cretix-debian:~/dev/Python/officeSite2019-final/backend$ python3 manage.py migrate
- Operations to perform:
- Apply all migrations: admin, auth, contenttypes, info, sessions
- Running migrations:
- Applying info.0002_client_room_unionoffices...Traceback (most recent call last):
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 82, in _execute
- return self.cursor.execute(sql)
- psycopg2.errors.DuplicateTable: relation "info_client" already exists
- The above exception was the direct cause of the following exception:
- Traceback (most recent call last):
- File "manage.py", line 15, in <module>
- execute_from_command_line(sys.argv)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
- utility.execute()
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute
- self.fetch_command(subcommand).run_from_argv(self.argv)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 323, in run_from_argv
- self.execute(*args, **cmd_options)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 364, in execute
- output = self.handle(*args, **options)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/base.py", line 83, in wrapped
- res = handle_func(*args, **kwargs)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 234, in handle
- fake_initial=fake_initial,
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 117, in migrate
- state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
- state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
- state = migration.apply(state, schema_editor)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/migration.py", line 124, in apply
- operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 92, in database_forwards
- schema_editor.create_model(model)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 307, in create_model
- self.execute(sql, params or None)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/base/schema.py", line 137, in execute
- cursor.execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 99, in execute
- return super().execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 67, in execute
- return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
- return executor(sql, params, many, context)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 84, in _execute
- return self.cursor.execute(sql, params)
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__
- raise dj_exc_value.with_traceback(traceback) from exc_value
- File "/home/cretix/.local/lib/python3.5/site-packages/django/db/backends/utils.py", line 82, in _execute
- return self.cursor.execute(sql)
- django.db.utils.ProgrammingError: relation "info_client" already exists
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement