将django移回sqlite - 无法摆脱postgres

时间:2013-11-30 18:10:42

标签: django sqlite django-models django-south heroku-postgres

我在heroku上用postgres设置了django,效果很好。但是,我想在本地开发,对于这个项目,使用sqlite对本地dev来说没问题。

我添加了一个本地设置文件,并在本地将数据库设置更改回sqlite。当我在本地加载网站时,我收到以下错误:

OperationalError: could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (fe80::1) and accepting
    TCP/IP connections on port 5432?

以下是我的本地数据库设置:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'wagon_sql.sql3',                      # 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.
    }
}

我想我只是忘记了某个版本的syncdb或其他东西......但是......不确定。有关如何使其工作的任何想法?我可以提供哪些其他信息以使其更清晰?

谢谢!

修改

我认为我要问的是,在更改DATABASE设置后,除了重新启动服务器之外,还有什么命令需要运行吗?

0 个答案:

没有答案