Heroku Postgres not working on Heroku Server [Django]

I have a Django project, where I am using Redis/Celery to call some API’s. I’ve set up my settings.py file to connect to the Postgres database and when running the Django project locally (with Redis/Celery running locally) the data is stored in the database no problem. When I push the application to Heroku, the data doesn’t save to the database.

I’m not sure if this sounds like a problem with the code itself, or the settings of the server causing this (Redis/Celery on Heroku).

I am using a Heroku Postgres Database.

Settings:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': 5432,
    }
}

db_from_env = dj_database_url.config(conn_max_age=600)
DATABASES['default'].update(db_from_env)

# The URL of the broker for celery to use
CELERY_BROKER_URL = os.getenv('REDIS_URL', 'redis://localhost:6379/0')
# The URL of the backend you want to use in case you wish to store the result of a task
CELERY_RESULT_BACKEND = os.getenv('REDIS_URL', 'redis://localhost:6379/0')


# The tasks you need to schedule
CELERY_BEAT_SCHEDULE = {
    'add_data': {
        'task': 'comparasion.tasks.add_data_util', # Name of task
        'schedule': 60.0 # Time in seconds
    }
}

Also the procfile:

release: python manage.py migrate
web: gunicorn Soccer.wsgi --log-file -
worker: celery -A Soccer worker --loglevel=info
beat: celery -A Soccer beat --loglevel=info

Not sure if the code provided is enough to help solve this issue.

I’ve tested this locally and everything worked but as soon as you push to heroku no data saves.