1👍
✅
Given that directory structure, your import should be working.
How about trying a relative import instead? In both views.py
and getnews.py
this should work:
from models import ...
1👍
have You tried that?
from .models import newsurls, newsblock
Please also read about PEP8 http://legacy.python.org/dev/peps/pep-0008/ cause Your code is not formatted correctly.
EDITED: I see that You trying to do that but without ‘.’ sign. Please note that before models is ‘.’ like that .models
- [Answered ]-Reverse for 'index' with arguments '()' and keyword arguments '{}' not found
- [Answered ]-How to add Css and Js files in Django python
- [Answered ]-Mod_wsgi application entry point? What and Where is it?
- [Answered ]-How do i include my footer.html in my base.html
Source:stackexchange.com