ERROR WHEN RUNNING PYTHON SCRIPT IN DJANGO ENVIRONMENT

27 views
Skip to first unread message

Sunday Iyanu Ajayi

unread,
Jul 9, 2020, 10:35:54 AM7/9/20
to django...@googlegroups.com
Hi guys

Please I need help with my code.

I am trying to run a python script in my django environment and  that makes use of the django database. I get this error

ModuleNotFoundError: No module named  project.settings

But if I run manage.py runserver, it runs without error

dr neyx de godlove

unread,
Jul 9, 2020, 2:13:07 PM7/9/20
to django...@googlegroups.com
which database are you using

--
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/CAKYSAw2cRzCkF0%2BOFCe%2BGXpEzc0HZhA6mdyk%3DaLZ70xgmH2_%2BQ%40mail.gmail.com.

Exactly musty

unread,
Jul 9, 2020, 2:18:30 PM7/9/20
to Django users
For any database you are using use this after your database is been set appropriately with the help of django doc Python manage.py makemigrations
Python manage.py migrate

Sunday Iyanu Ajayi

unread,
Jul 9, 2020, 5:22:33 PM7/9/20
to django...@googlegroups.com
Postgres DB

I finally got around it using django-extension

django-extension packages helps one to run python scripts in django environment
Reply all
Reply to author
Forward
0 new messages