Search code examples
pythondjangodeploymentpythonanywhere

Pythonanywhere don`t see a db dajngo


I added virtualenv, pulled a project, created db(sqlite) from migrations. When i try to get info with postman I get a OperationalError at /auth/login no such table: client_api_profile. In bash I see, that this table exists, what i did wrong?enter image description here


Solution

  • Have you run migrations? What you access in bash is just a Model private attribute, not an actual database table. According to Django docs for Model Meta class:

    db_table

    Options.db_table -The name of the database table to use for the model:

    db_table = 'your_custom_table_name'