Django error while running

862 views
Skip to first unread message

Chandresh . T

unread,
Mar 21, 2023, 11:06:06 AM3/21/23
to django...@googlegroups.com
Recently I was running a git clone (https://github.com/divanov11/StudyBud.git)

after doing required steps like migrations, etc. I started to run it by (python manage.py runserver) but I got this error.

can anyone help me with this, please?

Thanks in advance!

PS C:\Users\chand\OneDrive\Desktop\StudyBud> python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 398, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "C:\Users\chand\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_frameworkdjango'

oba stephen

unread,
Mar 21, 2023, 12:06:41 PM3/21/23
to django...@googlegroups.com
Can you share the content of your settings file? The installed apps in particular...

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BPOfqPK%3Ds66GNBJPF-pBLR3BvQiy1OnMjxNjQOmFo3OVu2%2B0w%40mail.gmail.com.

Prosper Lekia

unread,
Mar 21, 2023, 2:14:01 PM3/21/23
to django...@googlegroups.com
If the clone project has a requirements.txt file, you can run pip install requirements.txt. Else, install Django rest_framework in your virtual environment.

David Nugent

unread,
Mar 21, 2023, 9:50:30 PM3/21/23
to django...@googlegroups.com
Any traceback with this at the end:

  _bootstrap._gcd_import(name[level..], package, level)

Is almost always is due to a problem with your settings INSTALLED_APPS, particularly if django\apps\registry.py Is further up the trace.

A missing comma between items, perhaps?

It would indeed be nice if Django would output a more sensible error message for issues like this 😀 
Hmm, an idea for a useful PR right there. Seems to be common issue (since the very next message I read in this mail list is exactly the same thing).

Regards,
David


"Chandresh . T" <chandre...@gmail.com> writes

Chandresh . T

unread,
Mar 22, 2023, 7:19:18 AM3/22/23
to django...@googlegroups.com
Hello all! This is the setting file of the project and I actually installed requirement.txt already. In that it said "already installed rest_framework" but while running it shows an error that no module called rest_framework is installed. 

--
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.
settings.py

Chandresh . T

unread,
Mar 22, 2023, 8:04:48 AM3/22/23
to django...@googlegroups.com
image.png

Ahmad Abdulnasir Shuaib

unread,
Mar 22, 2023, 8:07:02 AM3/22/23
to django...@googlegroups.com
It looks like you mistakenly alter your settings, check your INSTALLED_APPS in settings.py 

ModuleNotFoundError: No module named 'rest_frameworkdjango'

There should be a comma between rest_framework and django

Chandresh . T

unread,
Mar 22, 2023, 8:11:14 AM3/22/23
to django...@googlegroups.com
I just added apps and templates, static file locations.


James Kalu

unread,
Mar 22, 2023, 8:53:15 AM3/22/23
to Django users
I think it ushould be 'rest_framework' in settings.py under installed apps.
Message has been deleted

Makan Dianka

unread,
Mar 27, 2023, 2:02:03 PM3/27/23
to Django users
Run this command> pip install -r requirements.txt

JOSE GONZALEZ SANCHEZ

unread,
Apr 4, 2023, 12:43:46 PM4/4/23
to Django users
That worked for me
Thanks!

"Este mensaje está dirigido de manera exclusiva a su destinatario y puede contener información privada y confidencial. No lo reenvíe, copie o distribuya a terceros que no deban conocer su contenido. En caso de haberlo recibido por error,  rogamos lo notifique al remitente y proceda a su borrado, así como al de cualquier documento que pudiera adjuntarse.

 Por favor tenga en cuenta que los correos enviados vía Internet no permiten garantizar la confidencialidad de los mensajes ni su transmisión de forma íntegra.

 Las opiniones expresadas en el presente correo pertenecen únicamente al remitente y no representan necesariamente la opinión del Grupo BBVA."

 "This message is intended exclusively for the adressee and may contain privileged and confidential information. Please, do not disseminate, copy or distribute it to third parties who should not receive it. In case you have received it by mistake, please inform the sender and delete the message and attachments from your system.

 Please keep in mind that e-mails sent by Internet do not allow to guarantee neither the confidentiality or the integrity of the messages sent."

Reply all
Reply to author
Forward
0 new messages