2

I'm working on a small project, that has an app called requests. Now I wanted to use OpenID to identify users but the package has dependencies to the package "requests" and I get an error when trying to run my app.

from social.utils import setting_name
File "/Users/.../env/lib/python2.7/site-packages/social/utils.py", line 11, in <module>
from requests.adapters import HTTPAdapter
ImportError: No module named adapters

I get that django looks in my requests app for the adapters, which are not there but I don't really get how I can avoid that without renaming my app.

Or even a more general question, is it bad practice or should it be avoided in general to have your own app names the same as packages? Should I check with pip first if there is a package with the name? I thought within the namespace of my project, I can name my apps as genuine as I wish?

I haven't programmed in ages and just wanted to get back into it a bit by learning python and django.

Thanks

1 Answer 1

3

You can't have app names clashing with names of python packages and django will warn you about that when creating app using ./manage.py startapp.

It can't be avoided because apps are imported like any other packages.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for clarifying, I renamed the app from request to requests, maybe this is why I didn't get the warning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.