1👍
It seems you’re a little confused about python’s packages and Django apps. As you know, Django is a web framework written in Python, thus, any python package/module/file could be imported inside your Django’s code.
Django apps are also python packages, that’s why you can do stuff like from my_app import models
to import the models of my_app
. The difference is that, generally, a Django app comes in with some django specific files (models.py, views.py, urls.py
, etc ), hence you need to add them to your INSTALLED_APPS
in your settings.py
in order to Django do the stuff that the app need to be done (generating the tables in it’s models.py
for example).
Regarding your question, that amazonproduct
package it’s indeed a Python package but not a Django app -it doesn’t have any views.py
nor models.py
. It’s just a python package which provides a friendly interface to query Amazon’s data. That means you doesn’t have to append it to your INSTALLED_APPS
. What you want to do with it is import it wherever you need it in your code. I think is probably inside the views.py
which is where you normally handle the logic of your application.
Resuming: Wherever you need to access methods or classes or functions from your amazonproduct
package you just import it normally (as you described in your answer) and then instantiate the objects or call the methods you need normally. Passing the data you collect in the file you’re working at.
Hope this gives some light. If you have any other doubt about Python’s packages and modules please refer to this doc session that is very well documented.