I am using Scrapy inside a Django project.
Inside my pipelines.py file, I can import a model from Django without any problem:
from competitions.models import Competition
I can display the list of the attributes of the Competition model successfully:
for field_name in Competition._meta.get_all_field_names():
print field_name #>>> OK
However, all the methods of Competition.objects
such as Competition.objects.get()
raise django.db.utils.DatabaseError: no such table: competitions_competition"
For instance, I get this error when I try to get an instance:
uefa_champ_leagues = Competition.objects.get(code='EUR_C1_2013')
I have applied the recommendations from Saving Django model from Scrapy project and Access django models inside of Scrapy and since the import works, I doubt that the problem comes from there.
Any idea ?