manager.py shell 报错

作者: 理工大叔 | 来源:发表于2017-02-09 23:22 被阅读1239次

    运行manager.py shell 时报错,查网上有关帖子,在setting.py 中添加

    from   django.core.wsgi    import   get_ws gi_application

    application = get_wsgi_application()

    仍然报错:

    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")

    django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

    估计这个错误和SECRET_KEY有关,然后把application = get_wsgi_application()移到SECRET_KEY的赋值之后。

    from   django.core.wsgi  import    get_wsgi_application

    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    SECRET_KEY ='bk=5-o+^bfdga*y$s4xt48%ju&v678(he!v930^oq3siq+f+35'

    application = get_wsgi_application()

    Work!!!

    相关文章

      网友评论

        本文标题:manager.py shell 报错

        本文链接:https://www.haomeiwen.com/subject/njnwittx.html