django.core.exceptions.ImproperlyConfigured:

来源:互联网 发布:个人网络贷款 编辑:程序博客网 时间:2024/06/05 08:11

今天要做一个页面的用户访问量统计的功能


在安装django-tracking

pip install django-tracking是报错

django报错:


Eclipse pydev 运行不出错,cmd 命令行界面中Python 运行出错:

django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.    ----------------------------------------Command "python setup.py egg_info" failed with error code 1 in c:\users\admini~1\appdata\local\temp\pip-build-zgcy_f\django-tracking\

解决方法一:

Main代码中增加;

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

解决方法二:

命令行运行程序之前运行以下命令或者在bat 批处理文件中增加这句话;

set DJANGO_SETTINGS_MODULE=mysite.settings

亲测 解决方法二

阅读全文
0 0
原创粉丝点击