【问题标题】:how do I confirm django is working with xampp's mysql我如何确认 django 正在使用 xampp 的 mysql
【发布时间】:2013-01-16 02:16:37
【问题描述】:

我开始学习 django ,我正在尝试建立一个开发环境,如http://www.venkysblog.com/setup-django-on-windows-with-apache-and-mysql。我无法让它正常工作,因此我正在向后工作以确保一切正确。

我可以完成第 4 步。我已经确认 python 、 xampp 和 django 工作。我使用 phpmyadmin 创建了一个名为 django 的数据库

我有一个名为 testproject 的项目,其 settings.py 文件包括:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'post
        'NAME': 'django',                      # Or path to database file if usi
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. No
        'PORT': '',                      # Set to empty string for default. Not
    }
}

当我运行 $ python manage.py runserver 我得到:

验证模型...

发现 0 个错误 Django 1.4.3 版,使用设置'testproject.settings' 开发服务器在 http://127.0.0.1:8000/ 运行 使用 CTRL-BREAK 退出服务器。

此时是否有明确的方法来测试与“django”数据库的连接?

提前致谢,

比尔

【问题讨论】:

  • 你需要测试什么?如果你这样做manage.py syncdb,它会尝试创建你的表,你会知道它是成功还是失败。
  • 那行得通,我能够看到使用 phpmyadmin 创建的表。如果您以答案的形式提出,我可以投票。问候 - 比尔

标签: python mysql django xampp


【解决方案1】:

如果您执行manage.py syncdb,它会尝试创建您的表,并且您会知道它是成功还是失败。

【讨论】:

    猜你喜欢
    • 2011-08-28
    • 2015-06-24
    • 2019-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-12
    • 2016-07-10
    • 1970-01-01
    相关资源
    最近更新 更多