Question: I could use some help figuring out what's the problem with running the development server for one of my django projects. When I run `python managy.py runserver`, I get an error that ends with this:

`OperationalError: 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" (127.0.0.1) and accepting
 TCP/IP connections on port 5432?`

Never before has anything like this happened to me while working with Django, so I will be very thankful for every possible solution.

Answer: 
Sounds like you are using Postgresql database and it(database) is not answering
In the `settings.py`, search for this code and make sure if it is correct:

```
DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
   }
}

```

And Then start postgresql database service: 

```
systemctl start postgresql
systemctl enable postgresql
systemctl status postgresql  # Check if it is running correctly.

```

**UPDATE**: If you are familiar with databases, then its better to setup a database server of your own and use credentials to login. 

```
DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'databasename',
    'USER': 'databaseuser',
    'PASSWORD': 'userpassword',
    'HOST' : 'localhost',
    'PORT': '',
     }
}

```