PostgreSQL database

Thanks for you feedback @grapecoder!

1 Like

I think, without further documentation, Django and Neon working together are broken.

Yes, it’s possible to set them up together. I have just done that.

But it’s impossible to run Django tests, which require Django to auto-create a database for testing.

>>> python manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: permission denied to create database

It doesn’t look like we can fix this with Neon. We’re mostly stuck without database for tests.

However, if you put this in your settings.py, below your main DATABASES area, it will create a SQLite database during unit tests

import sys
if 'test' in sys.argv:
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': BASE_DIR / 'db.sqlite3',
      }
  }

You can get the postgres database thing for free if you have the time to set it up