Тёмный

Deploy Django Web App With SSL to VPS with Nginx & Gunicorn | Full Tutorial 2024 

THE PROTON GUY
Подписаться 2,5 тыс.
Просмотров 6 тыс.
50% 1

Welcome to this comprehensive guide on deploying Django applications on an Ubuntu VPS, utilizing Nginx and Gunicorn. This step-by-step tutorial will walk you through the entire process, from setting up your VPS to configuring Nginx and Gunicorn for optimal performance.
Readme(server config): github.com/The...
Download putty: www.putty.org/
Don't forget to like, share, and subscribe for more tutorials on Django, web development, and server administration tips. Let's dive in and deploy Django with confidence!
******* Socials *******
Discord: / discord
Patreon: / theprotonguy
Linkedin: / ayodeji-adesola-15392a22b
Instagram: / the_proton_guy
Telegram channel: t.me/sO6ZFOaia...
Twitter: / ayodejiadesola_
#DjangoDeployment #UbuntuVPS #Nginx #Gunicorn

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

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@caiopjv
@caiopjv 14 дней назад
Great video! Thanks a lot. I will try these steps today!
@the_proton_guy
@the_proton_guy 14 дней назад
You’re welcome!
@RuslanKhotsenko
@RuslanKhotsenko 6 дней назад
Hello! Thank you very much for this great video! I did everything like in the video except of installing SSL. I stuck on ERR_TOO_MANY_REDIRECTS error when I type my domain without pointing a port 8000. If I write down domain name : 8000 everything works correct. Where is my error?
@the_proton_guy
@the_proton_guy 6 дней назад
Make sure you nginx file is properly setup as in the tutorial, also make sure that your gunicorn command correct: gunicorn -bind 0.0.0.0:8000 ProjectName.wsgi
@hendahmed5842
@hendahmed5842 5 дней назад
Bro, please reply I successfully receive the deployment certificate that implies that my website is secure but it is still not secure when I reload Second thing is, why the domain don't work without me running the gunicorn --bind command, Isn't it supposed to work just when you click on it??
@the_proton_guy
@the_proton_guy 5 дней назад
Well, you have to run the gunicorn command to run your Django project. Without it, it’s better to run your project with gunicorn in production. Also are you sure your nginx file was setup properly? And did you remember to restart it
@MrTR909
@MrTR909 Месяц назад
I can access my server but once i going to log in, error 403 forbidden.
@the_proton_guy
@the_proton_guy Месяц назад
Okay, you get 403 on the web page? You can access your website from the io address yeah?
@johncampilla4146
@johncampilla4146 5 месяцев назад
Thank you for your video! Let me inform you of how i set up my ubuntu, i created a VM in virtual box and acquired the IP address in network settings of virtual box. I followed the instructions that you provided, however in step 4 when creating the virutal environment, i encountered an error message saying "virtualenv: error: argument dest: the destination . is not write-able at /opt". Can you enlighten me on how to solve the issue? Thank you for you prompt response.
@the_proton_guy
@the_proton_guy 5 месяцев назад
So sorry for replying late. The error probably means you don’t have permission to write to that specific directory. Try the following: 1. First, verify the permissions of the directory where you're trying to create the virtual environment. You can use the ls -ld /opt command to check the permissions of the /opt directory. Ensure that the current user has write permissions to this directory. 2. Use sudo: If you need to create the virtual environment in a directory that requires elevated permissions, you can use sudo: sudo virtualenv /opt/myenv 3. Adjust Permissions: If you have access to the /opt directory and need to create the virtual environment there, you can adjust the permissions of the directory to allow your user to write to it. You can use the chmod command to modify the permissions: sudo chmod u+w /opt I hope this helps!
@johncampilla4146
@johncampilla4146 5 месяцев назад
@the_proton_guy, thank you so much. I executed 'sudo chmod u+w /opt' and managed to make progress by creating the virtual environment with the necessary permissions in the '/opt/myproject/' directory. However, at step 5, after successfully entering 'cd /opt/myproject', I ran into an error when trying to execute 'mkdir myproject'. The error message 'mkdir: cannot create directory ‘myproject’: Permission denied' was displayed. It appears there may be an issue with my user credentials since I do not have root access. I apologize for any inconvenience caused by this simple issue, as I am relatively new to LINUX/UBUNTU. I aim to deploy my Django project and test it as if it were a VPS within a virtual machine. Is it feasible to use my VM as a web server, accessible via its IP address and over the internet, solely for testing purposes? Thank you for your assistance; it has helped me understand the issues with Linux, Ubuntu, Nginx, and Gunicorn.
@johncampilla4146
@johncampilla4146 5 месяцев назад
Please let me know if this will be effective, or I will stop setting up the VM. Thank you.
@the_proton_guy
@the_proton_guy 5 месяцев назад
No need to apologize! Linux permissions can be tricky, especially if you're new to working with them. Let's address your questions and concerns one by one: 1. Permission Denied Error: The error you encountered when trying to create the myproject directory with mkdir indicates that your user does not have the necessary permissions to write to the /opt/myproject directory. Since you used sudo to grant write permissions to the /opt directory, you may also need to use sudo to create the myproject directory: sudo mkdir /opt/myproject This command should create the directory without any permission errors. After creating the directory, you may also need to adjust its permissions so that your user has full access to it: sudo chown -R $USER:$USER /opt/myproject This command changes the ownership of the /opt/myproject directory and all its contents to your user, allowing you to write to it without sudo. 2. Using VM as a Web Server for Testing: Yes, it is feasible to use your VM as a web server for testing purposes. Virtual machines are commonly used for development and testing environments, allowing you to simulate a production environment without affecting your local machine. You can deploy your Django project on the VM, configure Nginx and Gunicorn to serve the application, and access it via its IP address over the internet.However, keep in mind that publicly exposing a server to the internet comes with security considerations. Ensure that you properly secure your VM, apply updates regularly, and follow best practices for web server configuration and application deployment. If you need any further assistance, feel free to join my discord server where i am trying to create a community for sharing knowledge and asking questions: discord.com/invite/hhqtG4jp
@johncampilla4146
@johncampilla4146 5 месяцев назад
@@the_proton_guy Thank you so much for your assistance, will try later and yes I will join.
@HatibuJulius
@HatibuJulius 5 месяцев назад
sir is using supervisor necessary?
@the_proton_guy
@the_proton_guy 5 месяцев назад
Yes
@Kevelino-02
@Kevelino-02 Месяц назад
​@@the_proton_guy He talk about supervisor not `super user`
@HakiYikio
@HakiYikio 6 месяцев назад
Same as above, i can finally access my own website with my domain name, thank you :)
@the_proton_guy
@the_proton_guy 6 месяцев назад
You are welcome 🎉
@marcofourie5548
@marcofourie5548 3 месяца назад
Would this tutorial still work if you don't have a domain just the IP of the VPS? I am struggling to deploy my project!
@the_proton_guy
@the_proton_guy 3 месяца назад
Yeah it will. I broke it down into parts. In the first part, I showed how to deploy to the VPs and access it through the ip address of server. In the second part, I showed how to connect a domain
@marcofourie5548
@marcofourie5548 3 месяца назад
@@the_proton_guy I already tried to deploy but i want to follow your tutorial. Can install whitenoise in the server terminal on PuTTY and then continue like that?
@the_proton_guy
@the_proton_guy 3 месяца назад
Yes you can.
@callofgame2787
@callofgame2787 18 дней назад
@@the_proton_guy Hi, I followed your instructions and do it 1:1 but once I have set up my domain settings on provider website I can’t access the same files as I can access with typed ip address with port number. I got Nginx welcome page instead of my website when I use domain name :/
@the_proton_guy
@the_proton_guy 17 дней назад
@callofgame2787 hello! Are you sure you configured nginx properly? Text me on Instagram at the_proton_guy
@suryabisht00
@suryabisht00 4 месяца назад
website is not loading in local browser using server's ip
@the_proton_guy
@the_proton_guy 4 месяца назад
Check the server logs for errors. What do you see?
@suryabisht00
@suryabisht00 4 месяца назад
@@the_proton_guy where do I see the server log ?
@the_proton_guy
@the_proton_guy 4 месяца назад
@suryabisht00 check your terminal where your server is running
Далее
Deploy a Django Web App to Amazon EC2 Instance  | 2024
16:26
Провал со стеклянным хлебом…
00:41
Deploy a Django web app with Nginx to Amazon EC2
35:26
The Value of Source Code
17:46
Просмотров 41 тыс.
Deploying Django with Docker Compose
2:24:50
Просмотров 89 тыс.
Coolify Crash Course | Self Host 101 | Secure Set up
1:29:06