Forums

Missing database table after deploying Django project

I have deployed Django project that works like a charm on my own computer. Everything works after deployment to pythonanywhere except I get error "no such table: django_bootstrap_calendar_calendarevent" when trying to add event to a calendar in admin-panel.

I have tried to migrate several times and even deleted everything and started again from scratch, but there simply is no django_bootstrap_calendarevent -table in the database after migrating (I downloaded the database file to my computer and checked).

I really would appreciate if anybody could give a hint how I could solve the problem. The code of the webpage can be found here: https://github.com/Hyvjan/cabin_homepages

The django-bootstrap-calendar can be found from here: https://github.com/sandlbn/django-bootstrap-calendar

On the web page I can see the django-bootstrap-calendar and it works fine, I am just not able to add events to it because the database table is missing.

I'm guessing from your reference to downloading the database that you're using SQLite. Is that right? If so, how are you specifying the database file in your settings?

One common problem with SQLite is if you don't specify the database using a full path, so your app uses a different database depending on where the working directory of the running code is -- so you migrate one file when you use the manage.py command, and a different one from your website's code.

Hello and thank You for the advice :-)

I am using SQLite since for a small app like this it is sufficient. I checked the database path from settings.py and it was correct.

I tried again to make the migrations and found out I had a small typing error. I fixed it and now the app works as supposed.

I really appreciate You guys helping python rookies like my self to figure these things out, so sincere thanks once again

Ah, a typo! Always the worst enemy of the developer :-) Glad you worked it out.