django-admin自定义命令给出设置错误

时间:2014-02-04 02:15:36

标签: django

这是我的setupproject.py自定义命令

from django.core.management.base import BaseCommand, CommandError

class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        print 111111111111111

当我以django-admin setupproject执行时,我收到以下错误:

django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

我做错了什么?

1 个答案:

答案 0 :(得分:0)

./manage.py setupproject我想。 也许你的settings.py

中有一些不正确的属性