slicksammy
slicksammy
RRailway
Created by slicksammy on 3/12/2024 in #✋|help
Deploying create react app
Project id 4f0fc161-46d1-43d8-8755-ed4c3ba94e92 I'm trying to deploy a create-react-app project but the build fails. First it failed with "yarn run build" and then I set "npm run build" as the command and that also failed. These commands work fine locally.
20 replies
RRailway
Created by slicksammy on 2/21/2024 in #✋|help
DATABASE_URL missing
Project id: 4f0fc161-46d1-43d8-8755-ed4c3ba94e92/service/bf2faa32-b938-49c1-b00a-0fa3b5b60384 I am deploying a Djano app. My Procfile is:
python manage.py migrate && gunicorn lynkster_backend.wsgi --timeout 600 --workers 4
python manage.py migrate && gunicorn lynkster_backend.wsgi --timeout 600 --workers 4
In my settings.py file I have:
DATABASES = {}
database_url = os.environ.get('DATABASE_URL')
if database_url:
DATABASES['default'] = dj_database_url.parse(database_url)

else:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'X',
'USER': 'X',
'HOST': 'localhost',
'PORT': '5432',
}
DATABASES = {}
database_url = os.environ.get('DATABASE_URL')
if database_url:
DATABASES['default'] = dj_database_url.parse(database_url)

else:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'X',
'USER': 'X',
'HOST': 'localhost',
'PORT': '5432',
}
The error I am getting is
Is the server running on that host and accepting TCP/IP connections?

connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused

Is the server running on that host and accepting TCP/IP connections?

Sentry is attempting to send 2 pending events

Waiting up to 2 seconds

Press Ctrl-C to quit
Is the server running on that host and accepting TCP/IP connections?

connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused

Is the server running on that host and accepting TCP/IP connections?

Sentry is attempting to send 2 pending events

Waiting up to 2 seconds

Press Ctrl-C to quit
In my app I have the DATABASE_URL var set but it looks like it is missing in this process. Ideas?
8 replies