每当我尝试启动我的项目时,都会发生以下错误。
django.db.utils.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
这是 postgres 的状态:
? postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Run Code Online (Sandbox Code Playgroud)
而且它只有在我重新启动服务时才有效,如何避免每次打开笔记本电脑时重新启动它可能是安装错误?
我正在使用 Ubuntu 18