R
Railway2y ago
Gaura

Can't Deploy Django

Can't Deploy a Django app because there is no psycopg2 installed on PATH, my project id is 7fbf82d1-be7c-47ef-b1a4-99574f9c9c2b
33 Replies
Percy
Percy2y ago
Project ID: 7fbf82d1-be7c-47ef-b1a4-99574f9c9c2b
Percy
Percy2y ago
It looks like you need to install psycopg2 in order to deploy your Django app. You can find instructions on how to do this in the YouTube tutorial linked in the search results.
⚠️ experimental feature
Gaura
GauraOP2y ago
which search results?
Brody
Brody2y ago
AI bot answer is funny Is that dependency in your requirements.txt file?
Gaura
GauraOP2y ago
it's a dependency of a dependency @Brody wondering u have an idea of how to help me here
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
ah yea that worked. tysm. But now it's giving me csrf problems :/ I've added it to allowed hosts
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
that's already done that's also done website is https://miverva.up.railway.app/ u can see if that works on ur end if i try to sign up
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
did u try to click sign in, and then try to sign up?
# settings.py
ALLOWED_HOSTS = [ 'minerva.up.railway.app' ]


# Application definition

INSTALLED_APPS = [
'home',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
CSRF_TRUSTED_ORIGINS = [
'https://minerva.up.railway.app/'
]
# settings.py
ALLOWED_HOSTS = [ 'minerva.up.railway.app' ]


# Application definition

INSTALLED_APPS = [
'home',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
CSRF_TRUSTED_ORIGINS = [
'https://minerva.up.railway.app/'
]
here's what settings.py looks like
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
wait what one second https://minerva.up.railway.app try this?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
ah yea it's supposed to be minerva
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
oh it might not let u, it's been a while since i've looked at this project, but can't remember if i had a frontend check for domain emails
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
ye but i already do everything that says like i have {% csrf_token %} in my templates and am using csrf middleware i've even checked cookies and it works like i can see a new token being generated
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
oh ohh
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
that might just be the problem
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
it works!! tysm
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gaura
GauraOP2y ago
quick question, this was my first ever project-- and i kept secrets out in the open, including the django generated secret. Do you know any way i can regenerate that? there's no sensitive info on the wesbite, so i don't care too much but it'd look p bad if someone tried to check out the repo
Adam
Adam2y ago
put your secrets into a .env file and gitignore it
Gaura
GauraOP2y ago
Ye, but i want to generate a new one since this one’s already out there.
Adam
Adam2y ago
Google has results for that
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Brody
Brody2y ago
the optimal solution would be storing the secrets in the service variables
Gaura
GauraOP2y ago
this is what I'm doing now-- however-- i already exposed it earlier so generating a new one would be nice
Want results from more Discord servers?
Add your server