Postgresql database stops receiving data when django runserver is activate


I have a postgres database that receives data each 10 mins, and its been working fine for a while, and now I´m working on a Django project that needs to be connected to that database, and I thing the connection its ok since I can query the data, but there is a problem with the data base, at the moment I run python manage.py runserver 0.0.0.0:8100 (it needs to be in that port), the database stops receiving the data and when I stop the server the db can receive the data again, but the data that was supposed to be in while the server was running was lost. Any ideas on how can I solve this? My Django version is 3.1.1

This is how I make the connection to the database in Django:

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'Ray',
        'USER': 'postgres',
        'PASSWORD': 'mypassword',
        'HOST': 'the_ip_adress',
    }
}

and the script that puts the data in the database makes the connection like this:

engine = create_engine('postgresql://postgres:mypassword@the_ip_adress/Ray',poolclass=NullPool)
conn = engine.connect()
insert_df(df)
conn.close()