34 - Deploy Django to Digital Ocean App Platform - Python & Django 3.2 Tutorial Series
HTML-код
- Опубликовано: 18 сен 2024
- 34 - Deploy Django to Digital Ocean App Platform - Python & Django 3.2 Tutorial Series
Reference Post: www.cfe.sh/blo...
Try Django 3.2 is a series to teach you the fundamentals of creating web applications with Python & Django by building a real project step-by-step.
⦿ Playlist: • Try Django 3.2 - Pytho...
⦿ DigitalOcean $100 Promo: do.co/cfe-youtube
⦿ Code: github.com/cod...
⦿ Subscribe: cfe.sh/youtube
⦿ Setup Video for Python 3 & Django 3: • Install & Setup Python...
Hi Justin! Thank you for this comprehensive tutorial series. It's one of the most complete Django series out there in the internet.
For everyone following this tutorial: make sure there isn't a mismatch between the POSTGRES_USERNAME variable set up in the settings.py file and the environment variable, as Justin pointed out in 44:33. Also, if you have been following along the tutorial and are trying to deploy from your local files, your "home_view" function might take a random integer and query an Article against the database. That might cause some errors after deploying so make sure the query isn't trying to access a register that hasn't been created yet.
Thanks. It's updated now!
@@CodingEntrepreneurs Awesome. Thank you!
Excellent point! I've used my own code for this and run into that exact problem as well. It will create a Server Error (500) even though the site works. So it's important to either change the random int generator or to go to "YOUR_APP_URL/articles/create/" (or whatever your own article creation URL is) first and create a few database entries. Then refresh the home page a couple of times and you should see it going from error 500 to a working page anyway (depending on the random number generated of course and how many articles you've generated).
Thanks for pointing it out, Ricardo! My deployment was failing because of the "home_view" function.
This honestly makes deployment SO MUCH easier compared to some other alternatives out there. Thanks Justin!😃
For testing I've included the postgres db details in my local .env file and connecting to the live database in the dev environment. Working just fine. Just wondering if there are any security issues with that going forward, as long as no one gets hold of my .env file?
how can i schedule regular job before deployment?? the digital ocean UI changed.. qq
Digital Ocean has made significant changes to the website to the point where the directions in the tutorial do not match up with the current website anymore.
There is no add component button in settings. My project builds but it does not deploy, I keep getting the error message:
"Error: No application module specified.
bash: line 1: trydjango.wsgi: command not found
Please help!
did you solved it?
Thank you for your tutorial series. I am kind of stuck in selecting between AWS lightsail or Digital Ocean. Which would be your recommendation?
in my application i get an error 400(bad request ) and i don't have a /admin pls help
Option to Add component isn't present in the latest Digital Ocean UI, could you please update the article on how to create the component in this case, Thanks!
Thanks for the great tutorial, watched until the end. How does one connect a redis server to app, platform. If everything was on the same droplet, I could just install redis and continue, but how would that work with the managed version?
Can you guide how to deploy the django project on the Azure ? Since Azure provides 100$ credit for Students as well i wanted to know if you could create a Detail guide on it explaining like just you did for digital ocean?
Followed this series to completion, cant thank you enough.
Was wondering if you've seen this error before during deployment: Requested runtime 'python-3.11.3' is not available for this stack (heroku-18).
It's specified in my runtime.txt and is supported on all stacks. I'm following the same process that allowed me to launch this tutorial.
to edit the job I don't see "Job Trigger" does that matter? because it can not do the migrations. by the way very good tutorial; your tutorials are worth gold
same
Unfortunately, the deployment is the hardest part. It doesn't work for me but the thing I wonder is, why in 2022 the various Digitaloceans, AWS, Google Cloud, etc. etc. fail to make life easy for developers. Basically they should just do their job. No way.
Check out my Django & Kubernetes series, it might clear things up for you with this one.
Believe it or not, deployment used to be 10x harder.
@@CodingEntrepreneurs you got to be kidding me.
Earlier on I got an error when building that the python being used is outdated and is no longer supported. I followed the link they provided for the new python versions they support and changed the runtime.txt the production branch to a python version that is now supported. Don't know if that will really break anything moving forward, but it wouldn't allow me to build with the outdated python.
Nothing in here should break with even Python 3.12 - there might be a few import changes in Django but other than that, Python 3 is Python 3.
please do I have to put my env folder in the same directory as my wsgi file for me to be able to deploy on the digital ocean app platform?
because I am having a no module found error
Hi Thank you a lot for this tutorial. I have a question. I need the ffmpeg packet to be installed, how can I do it? I tried the console but I cant get the root right, and didn't find any other way that I can install the ffmpeg in this, so to say"droplet". Do you maybe know how it can be done?
32:10 The "+ Add Component" button is missing from the Settings tab. Does anyone else have the same issue?
Yep, ehre isn't any button. Just do Actions>Create Resources, and then choose job from one of the submenus.
Have you found the solution for this? In the DO tutorial it is also used for collecting static files. Did you manage to find a turn around ? Thanks
Any solution?
i am getting this error "OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k"
If I use ${db.PORT} the job shows invalid integer value "{db.PORT}" for connection port. I have put the db name correctly. Please can you tell me what might be the problem?
Hi Justin! Thank you for this amazing series! I ran into some problem when follow this video.
I have the same "Sever Error (500)" code. I have check the migrate job and it is running properly, the admin page worked fine but others (home, login, logout,...) all return "Server Error". I turned debug = 1 and deploy again, it tell me that "the templates doesn't exist" but the same code work fine on my local machine.
I'm using my own code instead of your git-hub "production-1" code, so it might be something that I've missed?
Thank you!
Sounds like the template path issue
Also thanks!
@@CodingEntrepreneurs Thanks for your reply! Is there some way that I can resolve this? The template path worked fine on my local host. I have tried to re-commit every thing to github but the same problem still occur.
Why creating a super user should be a pre deploy job?? Only nigration wont be enough??
I got unable to Unable to get build logs for component 'app' after creating a job
somebody can help me with this error: error validating app spec field "services.name": services.name in body should be at least 2 chars long
Is anyone else having a problem connecting the repo to the DO account? "Sorry, we couldn't find an app in your repo". Tried several branches (main, production-1, production-*), all of them throwing the same error.
Go on GitHub and remove the authorization to the app and try again
Im having an error where after the gunicorn run command is executed it displays ModuleNotFoundError: No module named 'my_django_site' any ideas why im getting this? done exactly as you have in video
What’s your gunicorn command?
@@CodingEntrepreneurs i am having same error too.
i have the same problem
on the deployment logs i have:
bash: gunicorn: command not found
bash: line 1: netdeploy.wsgi: command not found
and the deployment building never ends
my statics files are missing, kindly help
9:00 database is not longer free
is the same think as a droplet? or is that something else?
Something else
This is a managed service. Droplets are just VMs
There you have to do everything from scratch. No GUI interface, just only the command line. Generally, people use Linux Ubuntu. But I will deploy this future server with droplet because truly writing it feels like you are coding. But indeed everything is just from zero. So of course, things will be painful and amazing at the same time.
Hey Justin, great tutorial. I have a question, wonder if you could assist me in this. I am creating a web app to host and it's an app with 20 fixed chat rooms, each room constantly having 5 students (so 100 users total) where members of the group can discuss the group project through chat in their respective room. What do you think the pricing for something like this be? I know it's hard to gauge with so little description, but anything will do. I want to know what I'm getting myself into, as a student a 200$ bill for example is a no-go.
Step 1. Sign-up to DO. Step 2. Enter credit card info. Step 3. Do blocks your account ! why ?
Hello there from 2023.. So there is no "+ Add Component" button anymore =)
So I tried forking this repo, it only forked the main branch- so I can't follow this tutorial, pls delete this if it is no longer valid- nevermind i figured it out- This doesn't work at all-
my card is not working welp i guess ill go ahead and not use digital ocean
Oh man, your videos have great content but holy shit you do waaayy to much smalltalk and soooo much unnecessary information. Its making me aggressive. oh my god.
I keep getting this error:
psycopg2.errors.UndefinedTable: relation "django_site" does not exist
LIINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1
django.db.utils.ProgrammingError: relation "django_site" does not exist
LINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1
Where could I possibly find the mistake?