Base Views error importing articles.models

24 views
Skip to first unread message

Sandy Leon

unread,
Aug 27, 2018, 9:35:43 AM8/27/18
to django...@googlegroups.com
Hello everyone,

I am trying to add another simple 'home' page to my website which is at this point
just the basic site after you finish the tutorial. I am following the 'Base Views' documentation but keep getting an error when trying to import 
'from articles.models import Articles' the error reads ModuleNotFoundError: No module named 'articles'

Any help with this would be greatly appreciated!

Anirudh choudhary

unread,
Aug 30, 2018, 2:26:36 AM8/30/18
to Django users
this error means that the module articles is not in the articels and file name models. you may be getting this error because of spelling 

Jason

unread,
Aug 30, 2018, 7:06:03 AM8/30/18
to Django users
and I would suggest you use a text editor or IDE with python integrations to check for these kind of errors.  Syntax and missing references are easily caught

augustine tharakan

unread,
Aug 30, 2018, 7:39:56 AM8/30/18
to Django users
If you are writing this code in the views.py belonging to the app as that of models.py you don't have to specify the app name. (try this - from .models import Articles)
Reply all
Reply to author
Forward
0 new messages