2017-02-16 1 views
1

が、私はジャンゴにまだ新しいよまだロードされていないが、私はPythonのmanage.pyののrunserverを実行したとき、私はこのエラーを取得:これは問題がINSTALLED_APPSであることを意味していDjangoのアプリはエラー

Unhandled exception in thread started by <function wrapper at 0x10363f2a8> 
Traceback (most recent call last): 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper 
    fn(*args, **kwargs) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run 
    autoreload.raise_last_exception() 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception 
    six.reraise(*_exception) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper 
    fn(*args, **kwargs) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/__init__.py", line 27, in setup 
    apps.populate(settings.INSTALLED_APPS) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate 
    app_config = AppConfig.create(entry) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/apps/config.py", line 90, in create 
    module = import_module(entry) 
    File "/Applications/Canopy.app/appdata/canopy-1.4.0.1938.macosx-x86_64/Canopy.app/Contents/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
    File "/Users/ashih/Desktop/ProjectX/website/mysite/toa/models.py", line 13, in <module> 
    class Absolutedollarvalue(models.Model): 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/db/models/base.py", line 105, in __new__ 
    app_config = apps.get_containing_app_config(module) 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/apps/registry.py", line 237, in get_containing_app_config 
    self.check_apps_ready() 
    File "/Users/ashih/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready 
    raise AppRegistryNotReady("Apps aren't loaded yet.") 
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. 

を? toaはアプリケーションの名前、toa.models.absolutedollarvalueはmodels.pyのテーブルの名前です。

誰でも私の問題点を教えていただけますか?私は私のviews.pyにデータベースを照会して、highcharts.jsを使用して表示するためのテンプレートに渡ししようとしている

""" 
Django settings for mysite project. 

Generated by 'django-admin startproject' using Django 1.10.3. 

For more information on this file, see 
https://docs.djangoproject.com/en/1.10/topics/settings/ 

For the full list of settings and their values, see 
https://docs.djangoproject.com/en/1.10/ref/settings/ 
""" 

import os 

# Build paths inside the project like this: os.path.join(BASE_DIR, ...) 
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 


# Quick-start development settings - unsuitable for production 
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ 

# SECURITY WARNING: keep the secret key used in production secret! 
SECRET_KEY = '[email protected]*vprze+^yy*v*7cucs!ein)(3_i6s+ut7&r28)520!-' 

# SECURITY WARNING: don't run with debug turned on in production! 
DEBUG = True 

ALLOWED_HOSTS = [] 


# Application definition 

INSTALLED_APPS = [ 
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib.staticfiles', 
    'toa', 
    'toa.models.Absolutedollarvalue' 
] 

MIDDLEWARE = [ 
    'django.middleware.security.SecurityMiddleware', 
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.middleware.common.CommonMiddleware', 
    'django.middleware.csrf.CsrfViewMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
    'django.contrib.messages.middleware.MessageMiddleware', 
    'django.middleware.clickjacking.XFrameOptionsMiddleware', 
] 

ROOT_URLCONF = 'mysite.urls' 

TEMPLATES = [ 
    { 
     'BACKEND': 'django.template.backends.django.DjangoTemplates', 
     'DIRS': [], 
     'APP_DIRS': True, 
     'OPTIONS': { 
      'context_processors': [ 
       'django.template.context_processors.debug', 
       'django.template.context_processors.request', 
       'django.contrib.auth.context_processors.auth', 
       'django.contrib.messages.context_processors.messages', 
      ], 
     }, 
    }, 
] 

WSGI_APPLICATION = 'mysite.wsgi.application' 


# Database 
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases 

DATABASES = { 
    'default': { 
     'ENGINE': 'django.db.backends.postgresql_psycopg2', 
     'NAME': 'px1', 
     'USER': 'ashih', 
     'PASSWORD': ' ', 
     'HOST': 'localhost', 
     'PORT': '', 
    } 
} 


# Password validation 
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators 

AUTH_PASSWORD_VALIDATORS = [ 
    { 
     'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 
    }, 
    { 
     'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 
    }, 
    { 
     'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 
    }, 
    { 
     'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 
    }, 
] 


# Internationalization 
# https://docs.djangoproject.com/en/1.10/topics/i18n/ 

LANGUAGE_CODE = 'en-us' 

TIME_ZONE = 'America/Los_Angeles' 

USE_I18N = True 

USE_L10N = True 

USE_TZ = True 


# Static files (CSS, JavaScript, Images) 
# https://docs.djangoproject.com/en/1.10/howto/static-files/ 

STATIC_URL = '/static/' 

:これは私のsettings.pyです。しかし、サーバーはすぐに実行されないので、クエリが機能しているか、正しく表示されているかわかりません。

これ以上情報が必要な場合はお知らせください。

本当に助けていただければ幸いです。ありがとう!

答えて

2

toaアプリ(その上の行)の読み込み中にの中にtoa.models.Absolutedollarvalueを残す必要があります。アプリ内にファイルを個別に読み込む必要はありません。モデルを個別のアプリとして読み込もうとしています。

Toaがあなたが書いていないPython/djangoのlibの場合、バージョンの互換性の問題により発生する可能性があります

関連する問題