Configuring Django

末鹿安然 提交于 2019-12-03 11:57:01
Marius Darila

Check in manage.py if you have this:

import os

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

And in wsgi.py this:

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

Also, any python scripts that integrate Django should look like this:

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
# Uncomment below for Django 1.7 +
#import django
#django.setup()
theNinja

Ok so I finally found the answer. Apparently the error was a result of Python 2.7.2. Once I upgraded to 2.7.6, the problem went away.

Here is a similar thread where I found the answer:

maximum recursion depth exceeded in cmp error while executing python manage.py runserver

Don't know why this solution didn't show up in my searches when I was creating this thread...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!