I am trying to create a custom python script within my Django application. This script requires the use of my app models. I am unable to figure out how to import the models appropriately to be used within this script.
My project directory:
-my_proj(name:ais)
-my_app(name:pages)
-__init__.py
-models.py
-urls.py
...
-utils
-__init__.py
-custom_script.py
So if I wanted to access the pages.models from the custom_script.py
how might I do this?
I have attempted various imports such as from django.core.management import settings
and from django.core.wsgi import get_wsgi_application
but I still get an error stating the following:
ModuleNotFoundError: No module named 'pages'