Man! You just made our entire life! We were struggling for the past 3 days just to get a Django website up and running! Thanks for being the guardian angel.
@TonyTeachesTech
3 жыл бұрын
Sure thing. Very happy to help ya out
@boyiscola
3 жыл бұрын
Fantastic! After two nights of trying to get django to work with nginx or apache this was extremely clear and to the point. Thanks!
@TonyTeachesTech
3 жыл бұрын
Glad it helped!
@thepossiblechannel7800
Жыл бұрын
i am still suffering
@microlearning_
2 жыл бұрын
Tried configuring a server over several days with no real success. This video was really helpful. Have being able to get the server running. Thanks
@Oranges4DaWin
3 жыл бұрын
Thank you so much! It's so much easier when someone explains step by step the documentation!
@TonyTeachesTech
3 жыл бұрын
Glad it was helpful!
@borgestheborg
3 жыл бұрын
This literally could not have come at a better time! This is exactly what I was looking for. Liked and subbed!
@TonyTeachesTech
3 жыл бұрын
Appreciate it! Thanks for letting me know. I spend a lot of time on my videos and never know if people will find them valuable :)
@rainiskey
Жыл бұрын
For anyone having trouble installing uwsgi or any other package for that matter into ur virtual enviroment, make sure the user ur working with owns the virtual enviroment. Do not use sudo, cause you really dont want any of these packages to be installed globably. Also, uwsgi depends on gcc, python dev and wheels. Hope this helps anyone stuck. (any packaged with pip)
@shubhamgupta7730
3 жыл бұрын
Best video on the internet. Thank you so much for explanation. ✌️
@TonyTeachesTech
3 жыл бұрын
So nice of you. Thanks!
@lapiduch2
Жыл бұрын
Thank you very much, this tutorial solved my troubles with deploying django under nginx on Debian 11
@danielgr95
3 жыл бұрын
Hi Tony. Great tutorial, I really appreciate it! I want to add a little thing, perhaps someone is running into the same problem. When setting the uwsgi.ini file (around 28:00) , I had to comment out the ' home' line for it to work. Logs showed an error when mapping the PYTHONHOME, commenting that line out solved the issue.
@TonyTeachesTech
3 жыл бұрын
Thanks for sharing. This will hopefully help out others
@srinivasguptha9538
3 жыл бұрын
Thank you so much. Explained a complicated topic very clearly.
@TonyTeachesTech
3 жыл бұрын
You are welcome!
@apacheschannel6407
10 ай бұрын
still a very valuable information! I am grateful for finding this tutorial! Thanks a lot for sharing your expertise with us!!
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@mohamedazizchibani6004
9 ай бұрын
did u fix the error??
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@engrnasirshah4426
2 жыл бұрын
You Explained Everything very well, thanks
@TonyTeachesTech
2 жыл бұрын
You’re welcome!
@nhwhn
2 жыл бұрын
You will win the NOBEL PEACE Prize one day. Thank you
@chillaxbaap
Жыл бұрын
you basically just now created the Django project, how come the localhost got linked with your domain?
@alexlindgren1
2 жыл бұрын
Awesome tutorial man, love your pedagoc approach. Any chance you could update this to be using Docker and docker-compose?
@TonyTeachesTech
2 жыл бұрын
Thanks Alexander! Right now I'm clueless when it comes to Docker. I plan to look into it next year
@eternalfootprintsmissions3253
2 жыл бұрын
Thanks a lot, Tom this was really helpful
@TonyTeachesTech
2 жыл бұрын
You're welcome. It's Tony btw :)
@fardarshan
2 жыл бұрын
is installing and configuring Gunicorn instead of uWSGI the same?
@NimeshKumar031
3 жыл бұрын
Thanks a lot. Amazing tutorial. One quick question. How to restart uwsgi whenever there is a change in the code?
@TonyTeachesTech
3 жыл бұрын
I typically restart the emperor service systemctl start emperor.uwsgi.service
@adamfatyga7977
Жыл бұрын
Django doesn't work on publlic IP, but Nginx works. Where i can search for help?
@eji7552
2 жыл бұрын
AWESOME TUTORIAL!
@TonyTeachesTech
2 жыл бұрын
Thanks!
@hope3353
2 жыл бұрын
awesome
@TonyTeachesTech
2 жыл бұрын
:)
@alessandroscimone5463
2 жыл бұрын
But why am I only finding you now? because! Good!
@TonyTeachesTech
2 жыл бұрын
Happy ya found me :)
@AdityaPatil-zd3lh
3 жыл бұрын
:) To avoid ERROR : failed to build wheel install wheel package in your project venv >> pip install wheel note: before that upgrade pip and setuptools
@TonyTeachesTech
3 жыл бұрын
🙏
@danielstrub3064
3 жыл бұрын
Thank you so much, you were such a big help!!
@TonyTeachesTech
3 жыл бұрын
Glad it helped! All the best Daniel
@heljhumenad
3 жыл бұрын
this what i need to understand deployment of django web app in web
@TonyTeachesTech
3 жыл бұрын
Great!
@maxpower7735
3 жыл бұрын
Thank you sooo much for the tutorial!!
@TonyTeachesTech
3 жыл бұрын
No problem 😊
@IsaacLopezLopez
9 ай бұрын
Buen material Antonio!
@_CS_DeepMehta
3 жыл бұрын
you made my day dude :)
@TonyTeachesTech
3 жыл бұрын
Happy to hear that 😁
@yuribranco
Жыл бұрын
Wonderful tutorial thank you. On step 5 I got a 403 forbidden when trying to acces the media, I reviewed and everything appears to be correct. What can I do?
@TonyTeachesTech
Жыл бұрын
This should help kzitem.info/news/bejne/kWeKm36AgIllkpg
@albermonianin1414
2 жыл бұрын
ca you make one about connecting django to oracle autonomous database please?
@TonyTeachesTech
2 жыл бұрын
I haven't worked with oracle autonomous db
@mustafaberker1453
2 жыл бұрын
Hi, I have a question. Does this method works with Plesk panel on Ubuntu LTS (Apache web server and nginx as proxy server)? Actually, I have plesk panel and couldn't run Django app with Postgre SQL database (database has no issue, it works fine) Please record a video about plesk panel for Django installation...
@wpyoga
3 жыл бұрын
Thank you for the video. With respect, I think uWSGI doesn't call the "Django backend" but the "Django app". And that "Django app" does not call Python -- rather, it is interpreted by the Python interpreter. Hope this clears up any confusion for the viewers.
@TonyTeachesTech
3 жыл бұрын
Thanks for clarifying William :)
@ProjectileGrommet
2 жыл бұрын
You're doing this on a Mac right? Why can't I use the apt-get package manager but you can?
@ProjectileGrommet
2 жыл бұрын
I am stupid and now realize ur distro is ubuntu 20.04
@TonyTeachesTech
2 жыл бұрын
Hahah
@shaikbyte
3 жыл бұрын
Excellent dude
@TonyTeachesTech
3 жыл бұрын
Thank you! Cheers!
@abiolajohnson5283
2 жыл бұрын
Thank you so much!
@gainzbah
3 жыл бұрын
Thanks Tony for your hard work. I would like to know if the config can work in local network. I have my project and I want to run in local network
@TonyTeachesTech
3 жыл бұрын
Yes I don't see why not. You'd have to go to the IP address instead of a domain name
@BigBossPapaPimp
2 жыл бұрын
whats with the old bay seasoning?
@TonyTeachesTech
2 жыл бұрын
Have you had it before? It's good. I'm a fan
@esantix
3 жыл бұрын
Thanks man!
@TonyTeachesTech
3 жыл бұрын
No problem!
@sreASEH
2 жыл бұрын
This is a wonderful tutorial. Thank you very much Tony! I unfortunately ran into some issues at the end of step 5. when I try to get media files, nginx gives me a 403 error. I set the .conf file correctly (and is linked to site-enabled directory) and my media directory has r-x permissions for all users. I would really appreciate it If you can help me understand the problem, or just where I can start to debug.
@Miyuru_
Жыл бұрын
Hi did you fix this?
@notatig7659
Жыл бұрын
I don't know if it is safe, but here is how I solved this. Go to home directory: cd /home Change access rights for my user home directory sudo chmod -R 755 udoms
@yuribranco
Жыл бұрын
I had the same issue, didn`t change the permissions because it's probably not safe...
@zodindev3860
Жыл бұрын
@@yuribranco did anyone ever come up with a best practice approach toe fix this? I'm having the same issue with my media folder
@StephenKeane
Жыл бұрын
@@yuribranco having the same issue with 403 error-- was anyone able to resolve?
@edchelstephens
3 жыл бұрын
Thank you!
@TonyTeachesTech
3 жыл бұрын
You're welcome!
@Watercolour96
3 жыл бұрын
with the emperor mode + uWSGI my django project has became slower than simple uwsgi.ini running or "python manage.py runserver" Could anyone help me in this, why it is very slow?
@TonyTeachesTech
3 жыл бұрын
Hmm, I don't know why that would be happening
@amhanafy
3 жыл бұрын
Thank youuuuuuuu
@TonyTeachesTech
3 жыл бұрын
:) You're welcome Ahmed
@PedroHenrique-vv7mk
Жыл бұрын
Valeu!
@TonyTeachesTech
Жыл бұрын
Appreciate it Pedro 🙏
@steve4718
3 жыл бұрын
Is this still up for date?
@TonyTeachesTech
3 жыл бұрын
Yep
@crcacom
Жыл бұрын
8:39
3 жыл бұрын
I am at the position of you 3 years ago.
@TonyTeachesTech
3 жыл бұрын
Practice makes perfect!
@enes222
3 жыл бұрын
Hi Umit, Glad to see a person from the same country who works with Django :)
@brealypadron4891
3 жыл бұрын
github project please :c i need figure out something in the architecture
@TonyTeachesTech
3 жыл бұрын
I don't have this code on github, but did you see the linked blog post tonyteaches.tech/django-nginx-uwsgi-tutorial/ I tried to be explicit by using absolute paths, but if there's a specific instance where something is unclear, please let me know
@crcacom
Жыл бұрын
show
@TonyTeachesTech
Жыл бұрын
✌
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@codewkarim
Жыл бұрын
Thanks! I'd give more if I had more! A tutorial on point. Explanation on point. Everything was clear and perfectly explained.
@TonyTeachesTech
Жыл бұрын
Wow, really appreciate it Karim! Happy to hear it. More Django tutorials to come this year :)
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@sorkerlimon6424
Жыл бұрын
I have been trying lot's of time but can't help me sir .. always show 502 error
@TheEaglesBasket
3 жыл бұрын
Hi. This looks like a single server for the website. Isn't that vulnerable if something happens to hardware, connection or when maintenance? Is it possible to have two servers working in different locations for the same website?
@TonyTeachesTech
3 жыл бұрын
I see what you're saying about having multiple applications on a single server. Yes technically I guess you're right that if the server is compromised, every application is vulnerable. Choosing to host on separate servers could slow down an attacker, but probably not stop him entirely if he's determined enough. Always remember that anything connected to the internet is never truly secure. It's certainly possible to host different applications on different servers for the same website. This of course would add in network latency when the servers communicate with each other. Honestly I don't have much experience in this realm, but that's just my 2 cents :)
@felixortega3178
2 жыл бұрын
5 0 2 B A D G A T E W A Y.... If I try to serve the media file: 4 0 3 F O R B I D D E N
@panmaciej2016
3 жыл бұрын
Hi! I have a issue.. Unitl uwsgi --http :8000 --module microdomains.wsgi, everything is fine but when i make a nginx file and make everything like in tutorial, when i download media.gif and make collectstatic then try to go ip/media/media.gif return 404 not found. uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=666 i have a 502 gateway, i tried with 664 socket, without socker, i research all internet and cant find resolve
@tts1958
3 жыл бұрын
I have the same issue. I can't fix it since last week, with the whole power of the internet...
@codeboymaster5055
Жыл бұрын
did you fix it. İ have the same problem
@nitensapkota8606
Жыл бұрын
Same here guys please provide info if got any information
@DANIELTORRES-lk2ni
2 ай бұрын
me choque con el mismo problema... permiso denegado.. y no encuentro la solución correcta
@alaqsaretowijaya3744
Жыл бұрын
after running the uwsgi --socket (socketname).sock --module (modulename).wsgi --chmod-socket=666 my nginx still having bad gateway. what could be the issue?
@ethanlee9633
Жыл бұрын
Same issue here. Did you ever resolve the problem?
@azaazkhan5598
2 жыл бұрын
when i run my django project it give me errorr django.db.utils.OperationalError: connection to server at " ", port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections? can u please solve my problem
@TonyTeachesTech
2 жыл бұрын
It sounds like the port is closed
@Jieryeson27
7 ай бұрын
No me funciona en ubuntu 22.04! pipipi
@RanjitMarathay
Жыл бұрын
I'm still getting 502 bad gateway after step 6 in the blog post -- has anyone else had issues with this?
@TonyTeachesTech
Жыл бұрын
Maybe see if this helps kzitem.info/news/bejne/yY-M2J1-m2Zkqoo
@codeboymaster5055
Жыл бұрын
@@TonyTeachesTech can you help us please, Im getting the same error, I saw the video but no clue
@shreyaspatil4861
3 жыл бұрын
Can you please make one video on deploying flask with uwsgi , nginx . Thanks :)
@TonyTeachesTech
3 жыл бұрын
Hi, sorry I'm not familiar with flash
@hodoros7255
2 жыл бұрын
Subscribed, thank you for this. Still not 100% clear on why nginx is needed here - I heard your explaination in the video that nginx is "better" at handling static files, but that didn't really sound like concrete answer. Would you be able to expand on that a little bit? Thanks! Side question - the static files that are generated with collectstatic, what are those? Just defaults that get shipped with Django? Thanks again for this great tutorial
@saikatjaman2004
3 жыл бұрын
ur the one that I was looking for, thanks bro, do u have any tutorial on how to connect Django with a database like MySQL?
@TonyTeachesTech
3 жыл бұрын
Are you familiar with Django models? docs.djangoproject.com/en/3.1/topics/db/models/. It's a way of abstracting database interaction in Django. That would be my suggestion. You'll still need a database of some sort like MySQL. I will have a video on this topic in the next few months :)
@floatpoint1050
Жыл бұрын
I bow to you. You made something that felt incredible difficult almost to easy 👍
@TonyTeachesTech
Жыл бұрын
Thank you very much. So happy you got value from it :)
@jerome_ee6522
2 жыл бұрын
I just deployed my api that i will use in my undergrad research. Thank you so much. Great help. Will definitely watch again to get this completely.
@hydara.r.7003
3 жыл бұрын
One of the best tutorials out there. I am saying that after trying a dozen of them with no results
@TonyTeachesTech
3 жыл бұрын
Thank you very much!
@kevinbisneau3704
10 ай бұрын
I found this video after discovering your current Django videos. Is this video still relevant today or do you plan to make a new video on deployment with Docker?
@nitensapkota8606
Жыл бұрын
What should be content and permission of .sock file mine is empty ? error i am getting permission denied when while connecting to upstream client
@guitar300k
2 жыл бұрын
mine stuck at "starting uWSGI Emperor" it didn't do anything
@alexdin1565
6 ай бұрын
thanks Tony, please can you make a video on django and docker deployment?
@imadlatch7206
Жыл бұрын
Apache2 libapache2-mod-wsgi-py3 is away lot easier
@chrishicks7630
3 ай бұрын
Excellent tutorial. Thankyou.
@drmikeyg
3 жыл бұрын
Good job, keep the videos coming. Thanks for your efforts.
@TonyTeachesTech
3 жыл бұрын
Thanks, will do!
@kapitankidlattv9613
2 жыл бұрын
So after this, I just have to copy my project to the server and that's it?
@georgesmith3022
3 жыл бұрын
Hi tony, this was very good tutorial. if nginx is on a different server than wsgi/django can you use a socket for communication or do I have to use http?
@TonyTeachesTech
3 жыл бұрын
I believe sockets are only local, so you would have to use http
@gianfrancotan4384
10 ай бұрын
What if it is in prod? Should same step be applied?
@vahid-m8b
4 ай бұрын
thank you for such helpful content
@sanxchepsharma7149
3 жыл бұрын
I've been through countless videos and countless times i've terminated and relaunched EC2 instances, let's see whether you take the bid or not
@TonyTeachesTech
3 жыл бұрын
How'd it go?
@sanxchepsharma7149
3 жыл бұрын
@@TonyTeachesTech worked like a charm, also embedded SSL using certbot, just a heads up letsencrypt won't work on Ubuntu anymore, use certbot, it's totally automatic with the configuration you provided, also I'll be spamming this video bc it's goes up straight to the point!! Thankss
@TonyTeachesTech
3 жыл бұрын
@@sanxchepsharma7149 I'm happy to hear that! Best of luck to you :)
@SelassieEye
Жыл бұрын
Lmao why is uwsgi so dramatic
@tiagomedina3407
3 жыл бұрын
you're monster brother... saving an enthusiast in python/django...thanks
@TonyTeachesTech
3 жыл бұрын
Sure thing!
@saumojitbhattacharjee7292
Жыл бұрын
It's not working in windows
@umarchy
3 жыл бұрын
Thanks for making the video. Subbed.
@TonyTeachesTech
3 жыл бұрын
Much appreciated Umar!
@ibuyukerdem
11 ай бұрын
Hello, after 2 days of struggling with this installation, I found your video and explanations. First of all, thank you very much. Although I used all the parameters such as user and domain as yours, I encountered some errors. I wanted to write some notes in case there are friends who are experiencing these. 1- First of all, I used Python 3.10 version. I couldn't do it with 3.12. I installed dev with sudo apt-get install python3.10-dev command of the same version. It didn't work with any other version. 2- When I proceeded according to your explanations, I was getting 502 bad gateway error error at the end. Nginx could not access the relevant files. I saw this in the Nginx logs. after this stage, I solved the problem by taking the udoms user and the nginx user to the same group. But it took me a long time to solve this. After all, I am not a system administrator or I don't have much linux knowledge. I used sudo usermod -g www-data udoms command to do this. I thank Tony again...
@matt_vid
2 ай бұрын
Thank you so much, this needs to be at the top comments, it works now smoothly
@matt_vid
2 ай бұрын
Althougth, the first point nowadays works, because I am running at python 3.12. And succesfully installed the app python3.12-dev. And as you said, there was an 502 bad gateway because of lack of permissions of my to the primary group of www-data. I was thinking about these command: gpasswd -a www-data But it didn't and yours exactly worked. I dont know why but it seems to be the primary group as a instead of just adding the to the group . It seems weird error, because I do this command in another server(same type ubuntu) and works perfectly.
@yucelmutlusoy
11 ай бұрын
Thanks for the upload. Excellent tutorial 👍 are you using virtual box for local development?
@TonyTeachesTech
10 ай бұрын
Thank you! Yes, sometimes, I just made a video about this here kzitem.info/news/bejne/2KejxXiOoWKBn4Y
@overheat2197
Жыл бұрын
at 23:00 min ( the google gif part) i'm getting 403 Forbidden nginx/1.18.0 (Ubuntu), anyone know how to solve it? i'm using a vps/droplet from digital ocean with ssh
@StephenKeane
Жыл бұрын
Having the same issue- using hostinger
@dergamer1219
8 ай бұрын
Add a / after the media and static in /etc/nginx/sites-available/yousite.conf
@dergamer1219
8 ай бұрын
@@StephenKeane Add a / after the media and static in /etc/nginx/sites-available/yousite.conf
@Dan-bd7lj
3 жыл бұрын
I need help. I dont understand how the NGINX config file is supposed to look like. I'm running this on a pi. I can't get past the NGINX part. What path do I use for my upstream django line? What about the server_name line? Im just using my IP, not a domain?
@TonyTeachesTech
3 жыл бұрын
Take a look at the Nginx config file here tonyteaches.tech/raspberry-pi-wordpress/
@Dan-bd7lj
3 жыл бұрын
@@TonyTeachesTech Thanks. In the end I was able to get it working after some trouble shooting. I just went though your other videos on getting SSL certs and getting django production ready. All excellent vids. I just have one question though, How exactly would we restart or stop the server if we wanted to? Whats the difference between using NGINX (/etc/init.d/nginx restart) or what you used (systemctl restart emperor.uwsgi.service)? Thanks so much!
@Dan-bd7lj
3 жыл бұрын
@@TonyTeachesTech I actually have one more question for you, if you don't mind. I am unable to access the production site from within my own network. I totally understand why, due to the way NAT and port forwarding works, and I have been using a VPN to actually reach my site. You seem to be able to reach your site from within the same network. How do you go about this?
@CreatorNexus
2 жыл бұрын
you need wheel to stop the uwsgi error message, >> pip install wheel
@TonyTeachesTech
2 жыл бұрын
Roger that
@NoajmIsMyName
2 жыл бұрын
23:25 I think it is due to port forwarding ?
@NoajmIsMyName
2 жыл бұрын
Thank you Tony anyway, I been looking for video like this for a year. As you said info around all the internet either not [clear] or not [complete]
@devanshuchaudhari8718
3 жыл бұрын
Thank you. Genuinely, THANK YOU!
@TonyTeachesTech
3 жыл бұрын
You're welcome!
@timur_kotelnikov
Жыл бұрын
Have anyone faced 403 at the end of 5th step instead of gif? How to fix it?
@TonyTeachesTech
Жыл бұрын
Try this kzitem.info/news/bejne/kWeKm36AgIllkpg
@crcacom
9 ай бұрын
23:14 fazendo
@muhendisim
Жыл бұрын
2022 still perfectly working. great video. It's really helpful. Thank you so much bro! 체크 해야 할 부분 33:01 systemd 실행
@hellocodeur
Жыл бұрын
thank u so much
@TonyTeachesTech
Жыл бұрын
You are most welcome
@pandahugs5
Жыл бұрын
Hi Tony, I was wondering if this is compatible with Dreamhost or where Dreamhost comes into play in this stack? Thanks!
@amzarahamed1536
Жыл бұрын
Why do we need to let Django know where the static files are? Aren't the nginx the one which serves static & media files?
@mohammedumargigani1297
Жыл бұрын
we really loved your video and follow all steps and successfully deployed it on our cloud server can you please make a video how we can run django app on docker ?
Пікірлер: 335