How to connnect postgres to a djanog app?
I have already added DATABASE_URL to the environment vatiables.
CMD python manage.py collectstatic --noinput && gunicorn core.wsgi:application && python manage.py migrate
python manage.py migrate
does not create the required tables in the connnected database.Solution:Jump to solution
take a look at this template https://github.com/railwayapp-starters/django/blob/main/mysite/settings.py#L81-L90
35 Replies
Project ID:
286dccfe-bf85-48fe-ae80-ab24c5a80716
286dccfe-bf85-48fe-ae80-ab24c5a80716
are you running the migration before initializing your service ?
Solution
take a look at this template https://github.com/railwayapp-starters/django/blob/main/mysite/settings.py#L81-L90
brody does not sleep
also, migrate comes before gunicorn
automatically?
ohh
in de cmd string
im blind
woopsie
they need to place migrate before gunicorn, or else gunicorn runs and migrate never happens
i oversaw that cmd
nonethless made sense what i said i suppose
luckily
CMD python manage.py collectstatic --noinput && python manage.py migrate && gunicorn core.wsgi:application
My concern is it will run every time I deploy whether I have any changes in django app models or not.
Is this okay to keep the migrate command like above?it will run every time, but if there's no migrations to apply nothing happens and then gunicorn starts as normal
it doesnt matter
brodys too fast
The above command with the change in settings suggested by @Brody worked.
Thanks guys. I really appreacite your help. 🙏 🙏
cool bro
no problem 🙂
I will share the landing page of my saas in a minute
with you huys
exciting
https://skillora.io/ here is the landing page @Brody @Morpheus I will launch teh product in a week
Skillora
"Unlock Top Tech Talent: Your Fastest and Easiest Hiring Solution."
ooh but bro
this looks fire
is this tailwind or bootstrap?
i see
im a tailwind virgin
haha
nah this looks really good
exactly this type of setup for the first hero section you have
is what i was looking for for inspiration to make a beta invite signup page for my page
do u mind if i take inspiration from this
Thanks I will make it better
no worries
no bro this looks good
most it is written by cahtgpt
hahah if it works it works
i wish
gpt is great for catching errors or small code
i feel like the 2 sections can use some thingy in it though
im almost done with my lander, you wanna see it?
sure
Xylex.ai | Home
Pioneering algorithms, redefining financial markets.
Looks great
still has some way to go but busy on backend rn
do you want this component?
could look great in one of ur sections to take a deeper dive in how you automate it or whatever
YEs I will look into it
How do I mark this solved?