Skip to content
Advertisement

How create Postgres database using SQLAlchemy

I want write project using database library (SQLAlchemy). When I use SQLite, all works good, but when I deploy project on server (Heroku with Postgres plugin), It doesn’t work. This is code for my database:

I have engine & Base variable:

In DATABASE_URL link to base on Heroku(Postgres). For create database I write in Interactive Python Console:

After these manipulations in the server logs it gives this:

sqlalchemy.exc.DataError: (psycopg2.errors.NumericValueOutOfRange) integer out of range

How to fix problem? If you needs in info, asking.

Advertisement

Answer

I set type of server as String, indicated that the server is a string and this is helped me.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement