# -*- coding: utf-8 -*- from __future__ import print_function import io import os from os.path import dirname, join from alembic import command from alembic.config import Config import baker from webapp.database import db from webapp.main import app import webapp.areas.manage import webapp.users.manage import webapp.planner.manage import webapp.tests.manage @baker.command def load_data():
traceback (most recent call last): File "manage.py", line 11, in from webapp.database import db File "/var/www/project01/webapp/database/__init__.py", line 3, in from .main import db File "/var/www/project01/webapp/database/main.py", line 6, in from ..app import app File "/var/www/project01/webapp/app.py", line 37, in default_timezone="America/Lima" File "/usr/local/lib/python2.7/dist-packages/allspeak/allspeak.py", line 30, in __init__ super(Allspeak, self).__init__(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/allspeak/i18n.py", line 33, in __init__ self.load_translations() File "/usr/local/lib/python2.7/dist-packages/allspeak/i18n.py", line 50, in load_translations self.translations = self.reader.load_translations(locales=locales) File "/usr/local/lib/python2.7/dist-packages/allspeak/reader.py", line 129, in load_translations self._update_translations(translations, filepath) File "/usr/local/lib/python2.7/dist-packages/allspeak/reader.py", line 96, in _update_translations data = self._load_file(filepath) File "/usr/local/lib/python2.7/dist-packages/allspeak/reader.py", line 90, in _load_file return self._extract_locales(data) File "/usr/local/lib/python2.7/dist-packages/allspeak/reader.py", line 81, in _extract_locales for locale, trans in data.items() AttributeError: 'NoneType' object has no attribute 'items'
什麼代碼片? – Scimonster
'從webapp.database進口db' '從webapp.main進口app' '進口webapp.areas.manage' '進口webapp.users.manage' '進口webapp.planner.manage' '進口的web應用。 tests.manage' –
這是我的manage.py文件中的代碼...我認爲問題出在導入部分。 –