While building a DRF package, unable to import dependencies from Django packages #8021
Unanswered
jeetpatel9
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a package for reusable APIs and want to later publish it on PyPI. I have already published a basic python package which has a
helloworld()
to understand how this would work.I have a set of APIs in my DRF app. I moved that app in a my packaging directory of
setup.py
. Also, I have added external dependencies to thesetup.py
.Now, I created
settings.py
in the the app directory and it has this -Then I installed those dependencies using cmd
pip install -e .
and then created a distribution package usingpython setup.py bdist_wheel
.In the app module imports like
from django.contrib.auth import get_user_model
from django.conf import settings
are also not work.However, when I started python shell and tried to import classes from the app modules it returned me an error
AppRegisteryNotReady
-Here is the complete traceback -
I was expecting imports to work as the dependencies related to those are already installed.
Where am I going wrong.
Also, the link to the tutorial or an article on how to create a DRF package would also help.
Beta Was this translation helpful? Give feedback.
All reactions