django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured

前端 未结 8 1308
你的背包
你的背包 2021-02-18 18:07

I\'m trying to run a populate script which I put together from the tango_with_django tutorial (https://github.com/leifos/tango_with_django/blob/master/tango_with_django_project/

8条回答
  •  梦谈多话
    2021-02-18 18:50

    For development and debugging, you may use the standalone python package.

    Install with pip

    pip install standalone
    

    Use standalone to use Django from the module.

    # add the following to the top of the module.
    import standalone
    standalone.run('mysite.settings') # replace with your settings module.
    
    # your code goes below the configuration
    import os
    import sys
    
    # ... .. .  whole module
    

    Now you may run the module as a Python Django script.

提交回复
热议问题