I come from Rails and started with Django projects.
I want to create a folder services (like rails services) that will contain classes that consume from an API and save the data retrieved in our database, in fact, those are jobs that are executed sometimes per day.
I created a folder manually called services into app. The structure:
- root
- app
- services
- job_1.py
- migrations
__init__.py
models.py
apps.py
...
I created the folder manually and added a file call job_1.
The problem is that I need to import a model from job_1.py but I can't because I am getting the error : "ImportError: No module named app.models" Note that I tried to import the models from the migrations and there is no problem.
Two questions :
1- It's corect to create a folder services manually? (I added the __init__.py
)
2- Why I am getting this error? How can I solve it?