我是 python 和 Django 的新手。我已经安装了 Django 1.5.1 和 python 2.7。我的操作系统是 windows 7。我正在 eclipse 中进行编码。我输入python manage.py runserver
了 windows powershell 并启动了服务器。然后我更改了服务器端口号通过命令到 8080。这两个python manage.py runserver 8080
条件最初都有效。我正在尝试使用 sqlite 数据库。我输入python manage.py syncdb
了创建表。它要求一个超级用户,不知何故我没有输入任何密码并且操作失败了。我在django中看到用于.schema
查看创建的表的文档。我的问题是:
- 我无法查看创建的表。我认为我在使用 .schema 命令时出错了
当我重新加载
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', )
请帮助我。谢谢你的回答