0

Python と Django は初めてです。Django 1.5.1 と Python 2.7 をインストールしました。私の OS は Windows 7 です。Eclipse でコーディングを行っています。Windows PowerShell と入力python manage.py runserverしてサーバーを起動しました。次にサーバーのポート番号を変更しましたコマンドで8080に。最初は両方の条件が機能しました。sqlitepython manage.py runserver 8080データベースを使用しようとしていますpython manage.py syncdb。テーブルを作成するために入力しました。スーパーユーザーを要求し、どういうわけかパスワードを入力せず、操作が失敗しました。作成されたテーブルを表示するために使用するドキュメント。私の問題は次のとおりです。.schema

  1. 作成したテーブルを表示できません。.schema コマンドの使い方が間違っていると思います
  2. ページをリロードするとhttp://127.0.0.1:8080/、wamp サーバーを再起動しても接続されませんでした。私のsettings.pyはこのようなものです

    ADMINS = (
    # ('Your Name', 'your_email@example.com'),
    )
    MANAGERS = ADMINS
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
    'NAME': 'C:\\Eclipse\\workspace\\mysite\\src\\sqlite.db',                      # Or path to database file if using sqlite3.
    # The following settings are not used with sqlite3:
    'USER': '',
    'PASSWORD': '',
    'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
    'PORT': '',                      # Set to empty string for default.
      }
    }
    
    # Hosts/domain names that are valid for this site; required if DEBUG is False
    # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
    ALLOWED_HOSTS = []
    
    # Local time zone for this installation. Choices can be found here:
    # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
    # although not all choices may be available on all operating systems.
    # In a Windows environment this must be set to your system time zone.
     TIME_ZONE = 'Asia/Kolkata'
    
     INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.sites',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      # Uncomment the next line to enable the admin:
      # 'django.contrib.admin',
      # Uncomment the next line to enable admin documentation:
      # 'django.contrib.admindocs',
       )
    

助けてください。答えてくれてありがとう
パワーシェルのイメージ

4

2 に答える 2

0

WAMP サーバーを使用している場合は、sqlite の mysql instate を使用してみませんか?

于 2013-04-25T13:00:33.787 に答える