U
U
unixwz2018-05-12 20:01:32
PostgreSQL
unixwz, 2018-05-12 20:01:32

I can't deploy a Django site, what's the problem?

Hello, I wrote a project in Django, thoroughly tested everything, checked it and decided to try to run it on a virtual machine in Ubuntu 16.04 (Windows 10 host), while the project itself was written in Archlinux.
I installed Vagrant on Windows 10, created a virtual machine with Ubuntu 16.04 there and installed all the necessary software:
- Virtualenv;
- PostgreSQL and psycopg2 + created a database and set up access to the database in settings.py;
- P.I.P.
etc. Then I created a virtual environment, installed all the dependencies and transferred the Django project itself there. Further, as I understand it, it is necessary to do python manage.py migrate to create the table structure, but at this stage I have a problem with the fact that the migration does not occur, here is the error:

python manage.py migrate
Traceback (most recent call last):
  File "/home/vagrant/data/gderetreat/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "events_type" does not exist
LINE 1: ...CT "events_type"."id", "events_type"."title" FROM "events_ty...
                                                             ^


The above exception was the direct cause of the following exception:

I spent half a day in Google, but I did not find a solution, I ask for help.
ps Of course, the idea comes to mind to dump the database from the machine on which I wrote this project and just import it, but how correct is this? probably not very much.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Malyarov, 2018-05-12
@Konstantin18ko

Show models.py where "events_type" is.

R
Roman Kitaev, 2018-05-13
@deliro

You have inconsistent migrations or code execution of irrelevant models (this is when you import them into migrations from a model, and not apps.get_model)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question