While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to resolve the error.The exceptions and code is given below.

31 views
Skip to first unread message

Avitab Ayan Sarmah

unread,
May 11, 2018, 1:08:26 PM5/11/18
to Django users
Exceptions:

Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> from django.utils import timezone
>>> from polls.models import Question
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in <module>
    class Question(models.Model):
  File "c:\python36\lib\site-packages\django\db\models\base.py", line 100, in __new__
    app_config = apps.get_containing_app_config(module)
  File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, in get_containing_app_config
    self.check_apps_ready()
  File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Daniel Hepper

unread,
May 11, 2018, 1:41:00 PM5/11/18
to django...@googlegroups.com
The error message is a hint that Django is not properly initialized.

My guess is that you are using a plain python shell, which you started using the command „python“.

Use „python manage.py shell“ instead. As explained in part 2 of the tutorial, this properly initializes Django.

Hope that helps,
Daniel

P.S.: I really admire your persistence! I promise that all these error messages will make sense at some point, if you stick with it.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/01e57139-6ac4-45ac-837e-196980bec2ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Avitab Ayan Sarmah

unread,
May 11, 2018, 1:45:35 PM5/11/18
to Django users
i wrote the code inside mysite directory but still the error shows

Avitab Ayan Sarmah

unread,
May 11, 2018, 1:46:39 PM5/11/18
to Django users
ok ok i got it thanks


On Friday, May 11, 2018 at 11:11:00 PM UTC+5:30, Daniel Hepper wrote:

Dylan Reinhold

unread,
May 11, 2018, 1:49:43 PM5/11/18
to django...@googlegroups.com
Is it grounds hogs day, didn't this exact error get asked two days ago and Daniel answered then?

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Avitab Ayan Sarmah

unread,
May 11, 2018, 2:05:16 PM5/11/18
to Django users
hey Dylan, two days ago anthony said to troubleshoot myself, the answer was there only.Since i am a beginer i tried myself but couldn't find out the error also i was tired as i just reached from office and started questioning
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages