2017-03-25 7 views
0

私はDjango Pythonフレームワークの初心者です。私は公式サイトのDjangoのドキュメントを参照しています。しかしPart-2で、私はこのエラーを取得するmakemigrationコマンドを実行すると:Python2.7 __init__.pyエラー - ValueError:モジュール名が空です

Traceback (most recent call last): 
    File "manage.py", line 22, in <module> 
    execute_from_command_line(sys.argv) 
    File "/home/shivams334/venv1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line 
    utility.execute() 
    File "/home/shivams334/venv1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute 
    django.setup() 
    File "/home/shivams334/venv1/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup 
    apps.populate(settings.INSTALLED_APPS) 
    File "/home/shivams334/venv1/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate 
    app_config = AppConfig.create(entry) 
    File "/home/shivams334/venv1/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create 
    module = import_module(entry) 
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
ValueError: Empty module name 

を私も/usr/lib/python2.7/importlib/ のinitの.pyファイルを探してみました、ここにあります:

"""Backport of importlib.import_module from 3.x.""" 
# While not critical (and in no way guaranteed!), it would be nice to keep this 
# code compatible with Python 2.3. 
import sys 

def _resolve_name(name, package, level): 
    """Return the absolute name of the module to be imported.""" 
    if not hasattr(package, 'rindex'): 
     raise ValueError("'package' not set to a string") 
    dot = len(package) 
    for x in xrange(level, 1, -1): 
     try: 
      dot = package.rindex('.', 0, dot) 
     except ValueError: 
      raise ValueError("attempted relative import beyond top-level " 
          "package") 
    return "%s.%s" % (package[:dot], name) 


def import_module(name, package=None): 
    """Import a module. 

    The 'package' argument is required when performing a relative import. It 
    specifies the package to use as the anchor point from which to resolve the 
    relative import to an absolute import. 

    """ 
    if name.startswith('.'): 
     if not package: 
      raise TypeError("relative imports require the 'package' argument") 
     level = 0 
     for character in name: 
      if character != '.': 
       break 
      level += 1 
     name = _resolve_name(name[level:], package, level) 
    __import__(name) 
    return sys.modules[name] 

私はvirtualenvを使用しているので、なぜこのエラーが発生するのかわかりません。個人用サイト/ settings.pyで

マイINSTALLED_APPのリストは、次のとおりです。

INSTALLED_APPS = [ 
    'polls.apps.PollsConfig', 
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib..schemastaticfiles', 
] 

私はこのエラーが原因で私のDjangoのチュートリアルにこだわっています、助けてください。

+0

'、この' 'django.contrib..schemastaticfiles' とは何ですか? –

答えて

0

変更この:これに

'django.contrib..schemastaticfiles', 

'django.contrib.staticfiles', 
関連する問題