Тёмный

Django | Server Setup (WSGI, Gunicorn, Nginx) 

Django road
Подписаться 9 тыс.
Просмотров 149 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 293   
@Snakes.StartToSing
@Snakes.StartToSing 3 года назад
its funny that such an important concept its never explained in other channels, they can talk about django all day long, but fail to explain the professional way of deploying apps
@ashir3730
@ashir3730 2 года назад
That's 1000000000000000....% correct. Come Back Mam, you have things that no one has.
@serious6037
@serious6037 2 года назад
100% bro. amen to that.
@sauravgupta7415
@sauravgupta7415 2 года назад
Because they don't know themselves.
@alfagroupkz
@alfagroupkz Год назад
😆🤌🏻
@MrRahul15937
@MrRahul15937 Год назад
Digital ocean has blog post on it.
@gedeoneyasu6811
@gedeoneyasu6811 3 года назад
Thanks, great video! I am learning Django deployment and always get afraid when I hear the terms Nginx and Gunicorn but you made them very clear now!
@djangoroad
@djangoroad 3 года назад
I'm so glad you understand them better now :)
@ashir3730
@ashir3730 2 года назад
@@djangoroad read: you are looser. Do you know why you stopped... creating the content? I was going to write this but you are not my slave. !00 and 2 o/o. that's your choice great videos mam. I pray you will come back not for us but .....
@aliyusulaiman8188
@aliyusulaiman8188 6 месяцев назад
Hahaha been there
@MeMe-q9t8k
@MeMe-q9t8k 2 дня назад
Me too ❤
@winningtech5
@winningtech5 2 года назад
Never seen a django deployment tutorial as explanatory as this. I was totally struggling thanks!!
@tts1958
@tts1958 3 года назад
I get a 502 Bad Gateway error. I tried to fix it for the last couple of days and I can't. Does anyone have any idea how to solve it?
@laxmandesai573
@laxmandesai573 3 года назад
Wait, I think you dropped this 👑
@gelismissuriyeli4440
@gelismissuriyeli4440 2 года назад
I've watched 10 videos on this topic so far and some of them were 50 mins long "in the name of explaining in details" but this brief and well done video was the best and the clearest so far.
@manho2965
@manho2965 2 года назад
thanks for your video. I have an error "No module named "myproject.wsgi". Any idea to fix it?
@python360
@python360 Год назад
This tutorial is bang on the money. I've followed an hour long video and not got it working, this last 9 mins and DOES work. Brilliant. If you get a chance could you do one on setting up SSL and port 443 with Django on a production site? Thank you Dot JA 🙂
@KrishnaManohar8021
@KrishnaManohar8021 4 года назад
Hope to cover this topics too: Django with lambda, Scaling Django with Docker, Kubernet Django with S3 Bucket Django with RDBMS (handle/Fetch data from the different database) cover with AWS.
@djangoroad
@djangoroad 4 года назад
Nice ideas! Thanks
@SwapnilPhulse
@SwapnilPhulse 4 года назад
Great points! A resource discussing this would be immensely helpful.
@KrishnaManohar8021
@KrishnaManohar8021 4 года назад
@@SwapnilPhulse +1
@vladventura1928
@vladventura1928 3 года назад
I love you, literally saved me from hours of endless headscratching; I'm new to this so its still pretty daunting to say the least :/
@jtgasper4621
@jtgasper4621 2 года назад
Great content explained in such an easy-to-understand way. I loved how you broke down the concepts then showed them in practice.
@hackvlix
@hackvlix Год назад
Nice tutorial. Complete, to the point, and, most importantly, correct.
@outright99
@outright99 3 года назад
OMG... the way you explained this is so clear... Many thanks really. Now investigating to add more security to the site! Cheers!
@Eduardo_C
@Eduardo_C Год назад
At 5:05, what and from where did you copy and paste? I am using a Mac and want to get the correct path for both the `command` and `pythonpath` variables. Thank you!
@feluve
@feluve Год назад
Do you know if, once you place the static files in the /static/ folder, you have to set some permissions?
@raremoments7122
@raremoments7122 Год назад
my django-admin panel static files not showing, why ? i have properly configured the path of static files in nginx configuration. Django admin panel looks ugly why my static files are not working?
@ferdiansahgg
@ferdiansahgg 3 месяца назад
thanks this work with ubuntu 22.04 UEFI on alibaba cloud, with django 5.0
@shadowgag4526
@shadowgag4526 3 месяца назад
This was PEAK content! Very well explained. Just one question, I know I'm very late, but why did we need to create a specific route for /static/ in nginx ? What if we don't give it, django anyways is going to handle those right, after we run `collectstatic`?
@ismendoza
@ismendoza Год назад
Why your django project is out of the directory of your django_venv, I mean your "django_venv "is in the same level of "myproject"?
@frankstuart6032
@frankstuart6032 3 года назад
ModuleNotFoundError: No module named 'myproject.wsgi' This is the error im getting when im running gunicorn -c conf/gunicorn_config.py myproject.wsgi
@alexdeathway
@alexdeathway 3 года назад
Have you specified the correct path (PYTHONPATH) for your project in Gunicorn_config.py.
@frankstuart6032
@frankstuart6032 3 года назад
@@alexdeathway yes
@alexdeathway
@alexdeathway 3 года назад
@@frankstuart6032 remember you have to put path only till the dir which contain wsgi.py file. So that you can use myproject.wsgi in command for example if your wsgi file is located in: home/username/myproject/myproject/wsgi.py your pythonpath should be: PYTHONPATH="/home/username/myproject"
@frankstuart6032
@frankstuart6032 3 года назад
@@alexdeathway thankyou i got it🙏🏽
@valittheboss
@valittheboss 7 месяцев назад
Great video, thank you! However there's a small mistake at the end (I think), in the Nginx config where you're using "root /home/ubuntu/static", that wouldn't work because it will resolve to home/ubuntu/static/static I suppose it worked at the end because debug was still set to True
@kenwakeyboard
@kenwakeyboard 8 месяцев назад
Also if you are on a VPS or similar, you need to allow port 8000 on the provider side, e.g. change AWS EC2 inbound rules for your instance to allow custom tcp port range 8000. Otherwise you will keep getting connection refused.
@ahmedshalaby1878
@ahmedshalaby1878 11 месяцев назад
Perfect, thanks alot! But, i have a question regarding deploying new services on the same server. Should i do it like that: 1. Deploy new django service in new container qith gunicorn. 2. Edit nginx service to serve both old and new services.
@nickheyer
@nickheyer 2 года назад
Hi, this is an awesome video! If possible, you should follow this up with how you would integrate certbot.
@markgacoka9704
@markgacoka9704 2 года назад
This is the simplest explanation I have found thus far. Thank you so much!
@rafaelcosquiere
@rafaelcosquiere 3 месяца назад
Nice video, thanks. I just wonder what’s the difference or pros and cons between serving statics with WhiteNoise vs serving statics with web server. Although I guess in production for real projects, statics will be serve by a cdn, right ?
@mahrezbenhamad4445
@mahrezbenhamad4445 3 года назад
Thanks, keep going
@arcsin4083
@arcsin4083 6 месяцев назад
Thank you for video! But what is your IP in the Nginx config and why do you need to specify it there explicitly? I thought it can be some kind of alias that refers to the primary netrowk interface and assigned IP to it by the network provide.
@shraveenb.s3983
@shraveenb.s3983 2 месяца назад
Once you make it work on nginx. Will I be able to access it with other devices using my wifi network, by typing in the public IP?
@kevinsilva-n1k
@kevinsilva-n1k 2 месяца назад
how to accept requests from forms? i get csrf token 403 error. I am using the { % csrf_token % } and still the error.
@imtayyabhayat
@imtayyabhayat 11 месяцев назад
it works fine, but while fetching files from static, it returns 403 forbidden. i've tried the permission but nothing working. What am i missing?
@huzaifasserugo4357
@huzaifasserugo4357 10 месяцев назад
thank you so much, I followed a digital ocean tutorial and couldnt get my app to be served, I am wondering why this very simplified approach gets the job done. Is this all the setup I have to do? what are the next steps? thank you so much.
@BlitzCringe889
@BlitzCringe889 Год назад
it pretty work, but at last step i can see you use your ip address to see django test page with rocket. But i can see this page only when i type :8000, when i type only my address i see "Welcome to nginx" page. Can you help me with this, please?
@amangautam1779
@amangautam1779 8 месяцев назад
Thanks for such a clear explanation!! Can anyone tell me how to config gunicorn_config.py file for respawning the worker if it failed and how to restart it automatically?
@anilkumarsahoo909
@anilkumarsahoo909 2 года назад
Thanks mam, my first deployment done seamlessly.
@udbhavdave
@udbhavdave 3 года назад
your content is great buddy, just keep patience and continue making useful videos, and you will have huge reach. Thanks again, looking forward for more django and web development related videos.
@blingclem
@blingclem Год назад
Excellent video. Can I ask where you are from?
@nishadharank3674
@nishadharank3674 8 месяцев назад
Is there any way to host the application using User interface like what we do in tomcat, without depending on the dba team each time while hosting
@maiadasilvapereira4633
@maiadasilvapereira4633 8 месяцев назад
Thank you very much It is very useful Tutorial
@ishankukde6603
@ishankukde6603 Год назад
Make a project live which has authentication and database server in it.
@iammuslim8263
@iammuslim8263 11 месяцев назад
The problem is when i enter in the admin page the design is gone I think the problem is on static file
@igribeiro_
@igribeiro_ Год назад
How can i deploy with my own Domain whitout de Port 8000
@nazymkaa_s
@nazymkaa_s 4 месяца назад
thank you so much, how to restart the django app after changes ?
@chessinaglimpse9899
@chessinaglimpse9899 Месяц назад
This was so helpful, thank you so much
@jophycui2454
@jophycui2454 25 дней назад
Thanks for the video, I have got it running.
@uzb_boss-brawlstars2564
@uzb_boss-brawlstars2564 10 месяцев назад
Its saying [ERROR] Connection in use: ('192.168.1.101', 8000) What should I do
@ismendoza
@ismendoza Год назад
where is the file "name of my project".wsgi ?
@harrylai5233
@harrylai5233 4 месяца назад
Very good, it is the easy way that you show about how to deploy django app.
@mjennings061
@mjennings061 4 года назад
A slick tutorial, well done! Are media files treated the same as static files or is there another configuration needed for production?
@djangoroad
@djangoroad 4 года назад
Thanks for the feedback! Media files are treated same as static, you can specify the location in the Django configuration as well as the Nginx config. Depending on the traffic you receive to your web app, you might also want to look into S3 for storing this type of content.
@swastikshrestha4097
@swastikshrestha4097 3 года назад
Great video. I want to ask how do we get that ip address, do we need to buy from Internet/hosting provider or its just custom ip address?
@djangoroad
@djangoroad 3 года назад
Thanks! I was using the IP of an instance from a cloud provider (AWS, GCP, DigitalOcean, etc). I find this way better than using my own computer because you can always delete the instance and create a new one if something goes wrong.
@defendersart3051
@defendersart3051 9 месяцев назад
Whiskey server 0:49 or what is pronounced here?
@epithesi_sobrero
@epithesi_sobrero 3 года назад
Great video! Simple deomonstration of the tool :) One note: in my case, isntead of "root" I needed "alias" for the static files (location /static/)
@jebrucker1
@jebrucker1 Год назад
The configuration files all use lots of absolute paths to things, hard-coded IP addresses, etc, which are hacky and non-portable, and some of it is unnecessary (like the hard-coded IP address). I don't think this is a good way to configure any project. Better to have a look at the Gunicorn documentation or try another tutorial.
@djangoroad
@djangoroad Год назад
Yes in general you should always look at several tutorials before implementing something.
@shraveenb.s3983
@shraveenb.s3983 2 месяца назад
I am not able to reach the static files by your method
@harshtripathi6379
@harshtripathi6379 6 месяцев назад
If you are working with ec2 instance you might found a issue where gunicorn will not start with your_ip_address:8000 use 0.0.0.0:8000 it should work then
@agpark-yg8vs
@agpark-yg8vs 5 месяцев назад
thank you!!! you literally save my life lol
@vitali1959
@vitali1959 3 месяца назад
Thanks, great video!
@bountyhunter8132
@bountyhunter8132 Год назад
My Timestamps: Explanation: 0:00 - 2:20 Setup Nginx and Python Environment: 2:20 - 3:28
@f123006
@f123006 3 года назад
cute voice : )))
@dandan321321321
@dandan321321321 3 месяца назад
Can you make a video regarding adding a domain name?
@umershabir7045
@umershabir7045 3 месяца назад
I just cant thank you, but thank you so much!
@АлекСневар
@АлекСневар 2 года назад
Wow, that was a masterpiece of explanation! Thank you 🙏
@Jalan-Api
@Jalan-Api 5 месяцев назад
does the ip has to be static and where can I get the ip
@robertarustamyan5168
@robertarustamyan5168 5 месяцев назад
Thank you for explanation
@ProjectXH
@ProjectXH 2 месяца назад
Marvelous explanation!
@hamzadadoune3852
@hamzadadoune3852 Год назад
Thanks a lot it was very interesting. However, is this a way that can be used to deploy an industrial django application or their is more things to be taken into account when we want to deploy a real production one? If no what kind of things (certificates, crypting, token,...) and on which level should be handled (app itself, WISGI, NginX) ?Thanks
@engotzzsja
@engotzzsja 2 года назад
hello maam. Thank you for this video. Just wanna clarify, this is how we deploy django projects into working websites, right? So, the IP address you entered is the hosting site or the IP you got from the hosting site?
@amal3227
@amal3227 2 года назад
for anyone who might be running into the same problem as I am. I don't know but placing the complete static directory path in my settings.py did not work ( I reference static files using the static tag, that might have something to do with it) what finally worked for me is settings.py: STATIC_URL = '/static/' and in the nginx configuration location /static/ { root {my project path without the '/static/' at the end }; }
@username_6948
@username_6948 Год назад
DUDE THANKS it worked for me aswell
@alaminbijoy1027
@alaminbijoy1027 3 года назад
Hey make more of these deployment type videos. They are super helpful
@serious6037
@serious6037 2 года назад
Can you please tell me, what is sudo in simple words? is it a venv? or what?
@javalex561
@javalex561 10 месяцев назад
Excellent video. Please make one on how to deploy multiple django sites on 1 server using this.
@User-lc4zo
@User-lc4zo 3 года назад
im testing this on a pi and the only issue im running into is job for nginx.service failed because the control process exited with error code. have you ever seen that before? I double checked my config files
@efexzium
@efexzium 2 месяца назад
Worked for me!
@gianlucagiuman6132
@gianlucagiuman6132 2 года назад
Nice tutorial, i try to port on fedora the gunicorn part (systemd) with no success, anyone could help me ?
@sachintomareng14322
@sachintomareng14322 6 месяцев назад
it's not working for me
@yourlinuxguy
@yourlinuxguy Год назад
Thankyou very much for making this fantastic video, this video helped me setup my first website with django, still relevant after 2 years, thanks.
@username_6948
@username_6948 Год назад
amazing! tysm! how do i give permissions with chmod and chown to static files?
@clearthinking5441
@clearthinking5441 Год назад
in practice do you actually run these components through Docker?
@amiralikhan
@amiralikhan 11 месяцев назад
thank you very much - جزاکم اللہ احسن الجزاء
@derekkroeker4582
@derekkroeker4582 3 года назад
Is this Swedish?
@patrick594
@patrick594 2 года назад
What would change if I needed exactly this but with my domain name?
@starlabtechnologiess.r.o.5692
@starlabtechnologiess.r.o.5692 3 года назад
Could you please correct the static path in your nginx/sites-available/myproject file? Subtitles would do :) It works only by accident, because the default page doesnt need static files.
@danryan5044
@danryan5044 2 месяца назад
Clear and simple instructions. Still a great tutorial in 2024!
@matheusandrade1059
@matheusandrade1059 8 месяцев назад
thank you so much, your videos are amazing, simple and direct to the point with clear explanation.
@abbypossum9460
@abbypossum9460 2 года назад
So, your captions have auto generated in dutch, and are incoherent. This video isn't at all accessible to anyone deaf or hearing impaired, is it possible you could re-generate the captions so I can actually make sense of this?
@djangoroad
@djangoroad 2 года назад
Hi Abby, apologies this video isn't accessible to you. I've edited the video to set the language to English. By "re-generate" the captions, do you mean enter the audio subtitles manually? or is there a way to auto-generate it?
@abbypossum9460
@abbypossum9460 2 года назад
@@djangoroad well, now it doesn’t have any captions at all. I don’t know the process for adding captions on here, because I’m not the one that’s a RU-vid content creator so I don’t know it’s tools.
@АнтонРедькин-н2с
It is usefulest for me
@trubnikov
@trubnikov 11 месяцев назад
Amazing! Thank you so much!
@bacon37460
@bacon37460 2 года назад
Thank you. This is a great video. My question is if we can set guicorn as a service? thus, we do not need to activate the virtual environment or run any script after rebooting the server.
@alfagroupkz
@alfagroupkz Год назад
Thank you for your tutorial! And what number of workers for Gunicorn mean?
@afro_habesha
@afro_habesha 5 месяцев назад
Thank you so much
@slog7590
@slog7590 2 года назад
Thankyou so much , for such wonderful explaination.
@MrRynRules
@MrRynRules Год назад
Thank you so much, it was so well explained!
@peterg4524
@peterg4524 Год назад
I had been struggling following the gunicorn docs and understanding the relation between Nginx-Gunicorn-Django, then I found your video that put it all together very succinctly. Thank you for the time and effort you took to make the video and post it on you-tube. Your effort has been greatly appreciated and helped me greatly. Thank you.
@djangoroad
@djangoroad Год назад
Thanks for the comment :) I'm glad you found the video helpful. Goodluck!
@rajeshs3771
@rajeshs3771 3 года назад
Excellent. Well appreciated. Simple and elegant. ❤️ from Chn Greater Bharat
@imhan7026
@imhan7026 8 месяцев назад
wow, perfect tutorial, thank you so much
@eagleofsharm
@eagleofsharm 10 месяцев назад
I've just come to your channel, great content, but believe there is a lot u can offer to the community, keep It up.🥰
@xu-raytjhin7315
@xu-raytjhin7315 Год назад
i love your voice
@blackvenom36
@blackvenom36 Год назад
Is 167.99.... Ip your global or your local Ip?
@I_hu85ghjo
@I_hu85ghjo Год назад
public ip. Each website has got an ip. Thats the ip of her website
@devuk5078
@devuk5078 3 года назад
Hi ,how could I add domain name instead of IP address to access the apis endpoint
@feluve
@feluve Год назад
great Thanks
Далее
Apache vs NGINX
7:53
Просмотров 299 тыс.
Coding a Web Server in 25 Lines - Computerphile
17:49
Просмотров 338 тыс.
WSGI for Web Developers (Ryan Wilson-Perkin)
24:52
Просмотров 94 тыс.
12  Серверы NGINX и GUNICORN
17:59
Просмотров 7 тыс.
All You Need to Know about WSGI
11:11
Просмотров 66 тыс.
Deploy a Django web app with Nginx to Amazon EC2
35:26