Django 2 for Beginners - Deploying Web Application on Heroku (Part 3) | Shubham Sarda | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Django 2 for Beginners - Deploying Web Application on Heroku (Part 3)

teacher avatar Shubham Sarda, Python Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

17 Lessons (53m)
    • 1. Course Introduction

      1:49
    • 2. 4 Important Pillars to Deploy

      3:47
    • 3. Registering on Heroku and GitHub

      3:14
    • 4. Creating GitHub Repository

      2:08
    • 5. Working with requirements txt and gitignore

      4:39
    • 6. Understanding Django Environ

      2:44
    • 7. Working with Environment Variables

      4:02
    • 8. Solving .env Errors [Part 1]

      1:35
    • 9. Solving .env Errors [Part 2]

      3:10
    • 10. Push project from Local System to GitHub

      6:54
    • 11. Working with Django Heroku

      3:34
    • 12. Working with StaticRoot

      2:16
    • 13. Handling WSGI with gunicorn

      2:51
    • 14. Empty folder Staticfiles

      1:29
    • 15. Configuring Secret Keys

      4:55
    • 16. Setting up Database and adding users

      2:57
    • 17. Thank You For Being Here!

      0:27
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

23

Students

--

Projects

About This Class

Welcome to Django 2 for Beginners - Deploying Application On Heroku Server!
One course that will help you to start Deployment Process from Scratch Step-by-Step, This course touches each and every important concept for Django Application Deployment for beginners with it's the latest version Django 2 and Heroku,

Throughout this course you will learn about:

  • 4 Important Pillars to Deploy (git, GitHub, Heroku, Heroku CLI)

  • Working with GitHub Repository

  • Understanding the working of requirements txt and .gitignore

  • Working with Django Environ (Django Environment Variable)

  • Push project from Local System to GitHub

  • Working with Django Heroku (STATICROOT, WSGI, gunicorn)

  • Working with Heroku CLI

  • Handling WSGI with gunicorn

  • Hiding Secret Key, DEBUG, Allowed Host, Database Information

  • Working with Django Security and Database Updates

After completing this course you will be ready to work on beginner's projects as Intern, Fresher or Freelancer and you will also be able to implement everything yourself! Most importantly you will be ready to divide deep for big available scope with Django in the future.

Enroll now and I will make sure you learn best about Deployment with Django!

Meet Your Teacher

Teacher Profile Image

Shubham Sarda

Python Developer

Teacher

Hey there!

I've created Complete Roadmap to become a Developer with different projects, specifically for the SkillShare audience. 

With this roadmap we will start with Python Programming, learn about basics, important concepts and solve some real life problems by building projects. Once we are ready with Python, its time to gain more experience with different field projects in Automation, Data Analysis, GUI Programming and Web Development. 

Here is Complete Python Programming - 
Python A-Z: Learn Python Programming By Building Projects
Python Programming - Advanced Concepts

Python Projects - 
Python Project - Building Twitter Bot With Python and Tweepy
Python GUI Programming - Build a Desktop Application with Tkinter and SQLit... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Course Introduction: Hey, guys, welcome to Jackal for Big Nurse part tree, Deploying our Django of application on her Yokosawa and this course we will talk about how to Bouchar have application from our local system. Toe online Self In our case, Hello. Who is one of the most preferred online? The hosting solution for any big ner who is learning to deploy their Web application online and also provide free haruka domain, which help you to access your Web application anywhere in any part, off the one on. If you want to scale up, you can do according to a requirement. 12 The course you will learn about four pillars To deploy our Web application. We will talk about give Remember kit and get up. It's really important and followed by all over the industry. We'll be taking this in our consideration from our very first lecture, and you will understand one important concept which most of the course miss out, which is environment variable. We will have a specific section talk about Django environment really well, which help us to hide our secret keys along in for a lot more thing. Also, to continue with discourse, you don't require any previous server or deployment knowledge. Everything will be done from the basics. Once you roll into the scores, you get access to radio materials, Cici, projects or school, other important resources and access toe active question answer Community where you can ask your ocean 24 7 and I will be replying you as quickly as possible, Ready to start your journey for deployment and roll into the scores now. And I'm really excited to see you inside. 2. 4 Important Pillars to Deploy: Hey, guys, Welcome back. Now let us start our walk to deploy our application on her. Lucas are before moving forward. I also want to let you know that I have created a proper guide for this complete course regarding how to deploy our application on Harajuku. So all you have to do is is there despite clear link on, you can access this particular guide which has all the step at any point of time. You have problem with Europe's idling or any command. You can just visit this part oclock guide and then you can sort out everything. Next thing is, make sure you are using jungle 2.1 or about I would definitely recommend Django toe going toe. But if you're using Django to find one, that's fine. If you want to upgrade a system to Django two point toe, all you have to do is install dash, dash, upgrade Django, then coup 2.0.2 point five, which is the latest version and which is the most stable. Watchin you can use any words in off 2.2 that will work. Find any work done off 2.1 that will work fine now, once Europe greatest done. We are going to talk about four important things. The 1st 1 will be Get up next does get then Haruko, then Harajuku Cli And these were really important to deploy any jungle application on her glucose Our before moving forward. Let me explain what D's are, how we're going to use it on why they're important. The first thing is we have created a project on our local system. We have completed our project. Now The thing is, we need to store our court somewhere online so it can be accessed by us anywhere in the world. It can be accessed by my team. It can be accessed online from any part off the world on that's where get up, come into picture. So on. Get up! We can create a repository that is a container where we can store our core Now. Once we store our court online, we can access that particular court. We can access our files from any part of the world in a proper format in which we are working. The next thing is to access our code to store our gold online. We need something in between them that can help us. That's where get come into picture. So get can help us to take our code from our system on push on, Get up, get is something really important. But at this point of time, I'm trying to make you understand in the simplest possible language. So we have our court on our system Use Get to push on, Get up on through Get up! Our team can access our court We can access are cored on We can also track our changes. So if you do any changes on your Lucas system again you can push on, Get up! So all your new changes would be saved on get of itself. The next thing is Haruko and Haruko Cli Harajuku is basically a server which help our web application to be accessed by everyone. And now Haruko Sierra is in between them that help us to send our court from our local system to her local. Remember get a was just a container to store our core track are cored If you make any changes, share our court with our team Justin Proper according for man, where is Harajuku is an online server which help us to deliver the result off our code. So that is our web application. I hope you understand this basic point. Now, in the next lecture, we have to start registering and downloading some application. So we have to register on get up and Haruko. And also we need to download get and hello, Gussie. Ally, I hope this basic is clear now. Thank you for watching. See you in the next one. 3. Registering on Heroku and GitHub: Hey, guys will come back now. When this letter let me quickly register on Haruka is Well, let's get up. And also we need to download get and hard Oecussi away. So the first thing is let me quickly registered on Get up! Let me quickly enter my user name, email and password. Make sure you save these password an email because you are going to need them again while transferring your files from your local system to get up as well as Haruko just quickly said the free plan and then you can skip all the other step and then you need to verify your account. That's done. Forget of registration. I will get back to it. Let me register for Harajuku now. Quickly fill out the details. Click on register on, then. Verifier account. Thanks. Looks fine. We are up and really without get up as well as Haruko. The next thing is we need to install are get so all you have to do is just download the latest version according to your us all your goodwill. Just click on next, Next, next and then you need to click on install now to check if get us working on your system or not. All you have to do is open your terminal or your CNLee and then type get dash, dash portion and how you can see I already have the previous version. If you're using windows, you will also see that you have get bashed. Now all you have to do is just open any off your folder, right click and you will have options regarding in. So you're getting is working fine on no system. The next thing is, we need to install her. Oecussi. Ally, just jump onto this hard Oecussi ally A page on here You will have options for Mac windows and went toe. I'm using 64 bit windows. All after is just click on download and stall in the same manner. Now, once town Lord is done, just jump on your dominant on here. You need to write a common Haruko and here you can see that I have already downloaded it. You will also get certain commands that we'll be using throughout our course. So these commands are really helpful to manage. Our Haru goes over from terminal or common line. And that's it for this lecture in the next lecture. We are going to create a container on our get up where we are going to store our court. Also, we are going to Logan Haruko to our command line. Thank you for watching. See you in the next one. 4. Creating GitHub Repository: Hey guys, Welcome back now in this lecture, let me quickly create a repository on our get up. So all you have to do is just click on, create a repository how repository is basically a container where you are going to store your course all your files. So if you open a new off your jungle project so all these file will be stored inside our repository on Dhere. We need coprolites of information like what will be your reports? Tree name. That is your container name. So I would be giving it as task May on. If you want to give a particular description about this project, then you have to cemetery. Then you want to specify that if you want to keep this repository public or private. So if you're someone who is creating a project to show the world or shared, get up with recruiters employers, then you need to keep it as public. Otherwise, if it's a personal project, if it's a personal team project, keep your project as private. So I would be creating a public project for now. Yet McKidd reports tree now it's done. So this is a container where we are going to store all our code. The second thing is, we need to log in our Roku through our command line. So all you have to do is just open your CMD. And here you need to type Roku Logan. Now it will open a logon screen on the default browser. All you have to do is just provide your credentials. Hey, you can see I'm now logged in through Mihoko itself. That's done. So we have started our progress toe push from our local system to our get up. Now here, we need to talk about the important things which is a requirement or txt as well. Let's start get ignore file that we'll be doing in our next lecture. Thank you for falling this video. See you in the next one. 5. Working with requirements txt and gitignore: Welcome back, guys. Now, in this lecture, we are going to talk about two important files which is requirements start txt as a less dot get ignore file. So let me tell you what these two file do. The first thing is requirements start txt. Help us to track all the libraries and the dependencies which were using and will be required by us tour on a project on any other. So were any other computer any other system? So we have to collect all the libraries, all the dependencies which were using to check all the libraries that we are using. You have to do paper freeze. Here. You can see the list off libraries that we're using currently. So there are tons says you are booking on a big project that can be hundreds off libraries . 20 1500 any number. So you have to keep a track off them. So these are the libraries that we need to store in a file called requirements dot txt. So to create that file, all you have to do is tape freeze greater than symbol, then requirements dot txt. Make sure you are into her base folder, which is the fuller, in which your managed or pious every level. So all you have to do is just keep freeze greater than symbol requirements dot txt This looks fine. Here. You can see we have our requirements. Start the extent are folder. Let me open this one. And here you can see on your library's along with their wash in that you are using. Now, why this requirement not txt is important. So whenever we are going to work with our project on any other system or so were we know what exactly the libraries we require as well as the awash in. So we don't have any problem with configuration. We can run our project as it is. The second thing is our dot getting nor file. So when we push our court on online repository or are only in silver, we have to hide some file. Also, we have to ignore 13 files. So to ignore certain files, fuse dot get ignored. That means there are several files that we don't want to push on our online container. Like I don't want to push this dot gs code file to my own line container. I don't want to post the state of this file to my own line container are there may be certain another fights that you don't want to push. So it is really important for you to create a dog, get ignore file, and inside that you have to specify which files you want to ignore. Since these files are off no use. So all you have to do is just right. Click here in your base directory and create a dot Get ignore file. Now, inside this, you have to mention all the files that you want to ignore. So there is a common pattern which all the developers follow on. You have to follow the same, which is you have to radically open the fight on door, get ignored, which is a really well on get up. I added this link in the doc file, which I mentioned in The Oily Lecture. So all you have to do is either search for by turned out, get ignore or directly open this for tickler file on. Copy this code, so just click on raw control all on, then pace despite a clear, get ignored your hair. Now, this contain all the files that a developer ignores. So here you can see the by cash file, which we want to ignore. You will also find Lord Off virtual environment file on other unnecessary files that he won't ignore, so that would be covered inside despite oclock get ignore file. Now, that's all for this lecture. I hope now you understand about these two important files which is requirements start txt as well A start getting more on the next lecture. We have to start are working with our sitting start by. So before pushing our court toe anyone lines ever we need to hide the security key because we cannot show this part of Turkey on any online repository. These are secret keys. That means if someone knows these type off key, they can easily attack your website. That is your application. So you need to keep them safe on. We'll be talking about them in the next lecture. Also, we need debug mode as false for our production. We also need allowed host to be changed. We need to give up our declared domain where we want our application to walk. So we're talking about not more things regarding setting. Start by I hope this lecture was helpful. See you in the next one 6. Understanding Django Environ: Welcome back. Welcome to one of the most important lecture regarding your web application deployment. In this lecture we are going to work on setting Start fire on We'll be working with three important points that is a security key are debug as villas are allowed those So what actually happened is thes three are quite different when we push on to production. So when you're working on a local system which is your development more But when you push anything online that is on Harajuku But any others over like Amazon aws our digital ocean. You don't keep all the settings that seem so on a local development system You're allowed host will be empty But on your heart ago, sir, where you allow our host will contain the domain on which you are working on your local host. Your debug will be equal True, true But on your sewer that is your production. Your debug will be false On your local host, you are allowed to keep the security key open But when you push online you need to hide this on. Your key should be only exist by your server itself. So we need to do something to keep these three value different and development mood as well as our production mood. So what? We are going to use this. We're going to use Django, Dash and Vyron. So this library help us to configure our Django application with our environment? Variable. So what does this environment variable? So what we are going to do is we are going to create a dot PNG file on inside that any file will specify all the values that we want to keep separate on different places. So we are going to create art envy file in our local system and then keep all these three value different and honor Hoku server. We're going to submit different values, so this jungle environment variable are really helpful. So to follow this, all you have to do is install Django and wire on and then we have to create dot envy file in our base directory on add all these three values which is our secret g debug on allow Does one status done? We need to import our environment and are all the required courts here in our settings or by and then our dot nb file in our door Get ignore file because that fire will be different for our local system. And we need to ignore that file while pushing on sour because on server will be using different conflagration. I hope all these steps sounds easy in the next lecture. Just work on that and complete all the parts offsetting stored by Thank you for falling this lecture. See you in the next one. 7. Working with Environment Variables: Welcome back. I'll let us start our work with Jenga and White on as discussed in the previous lecture. The first thing we need to lose. We need to install our library. So all you have to do is use Pip, install Django and then Envirothon. The next thing we need to do is we need to create a dot in my file inside our base directory. So all you have to do is just create a new file. No, Inside this file, we need to mention all the variables that we want to replace. An are setting sort by. So, which is our Django? Secret key are jangled, debug and our jungles. So let me copy this one on her. Let me are jangle. The second variable will be by the work and then my allowed host. Remember, these are just variable name. You can use different names, but I'm using just jangle underscored and then the real variable name. So that is easy for me to track now here I need to are the values that I want to keep for local The value of secret key will be seen next we'll with a value of people which is true . And then the allowed host will bmd. This looks fine. The next thing we need to lose we need to edit are sitting Start fire here we need to import and Vyron also let me remove all these chords. Now, after are based on recovery, we need to define that environment where they will. So all you have to do is use e m e equals two and Vyron dot e n b Then your secret three would be string and you need to use the same environment dot e and B Dr Reid, underscore in B on here, you need to mention your OS spot. Now this specific issues to mention are variable. And here we are specifying the location off our Dottie envy file. The next specific thing we need to do is we need to replace all these three with our environment variables. So just copy this one and here just removed this and you have to use your A and B and then just mentioned your variable name inside quotation. If we do the same for debug as well as allow toast, this looks fine. The next step is just to our distort PNG file into our darkened ignore. There are chances that this file will be inside our get ignore. Let me such. Yep. So you don't need to add because it's already there. But make sure you check this one. If this dot envy is not there, you need to add this one. So that's done. Now, if I push this court on any online repository on get up on bed bucket, we can hide these values on the next lecture. Let us run also were and see what type off, wherever you get and then start. I walk to push our code on get up as well as her local. So thank you for falling this lecture. See you in the next one. 8. Solving .env Errors [Part 1]: Hey, guys, we're come back on this quick picked earlier, distressed a Web application and see if we get any area or not. So let me open my dominant and run fight on managed art by runs our hey, you can see I'm getting an error regarding Django. Secret Key. So the first thing we need to fix is you need to remove all the species. So this particular dot n refile is actually space into to file. That means each space is considered as some value. So you have to take care of this. I don't dismiss taken the previous lecture so I can show you the sport. Claire. Editor. Also, there are something really important with this particle Aurora. There are chances that you still get dissenter. Even if you're doing everything right here in Dottie Envy file. One thing you need to check is that your dot envy file is in your base directory. That means it should be inside your task mid where your managed or by file is available. So you need to take care off that now Let me run myself. Are again? You have districts? Fine. We have to one applied migration. Let me fix this by running by tone Managed by my great This looks fine. Let me turn myself over again. Let me come back to my browser and head open my port And now we have a new order regarding are allowed host. 9. Solving .env Errors [Part 2]: now here. If you look, we need to add this particle airport and are out host. So all you have to do is just copy this one. Jump on your daughter Envy file undecided. Here, let me save this one. Turn myself over again. It may be faced, this one and you are still going to finish this particle, Loretta. And if I scroll down a bit on this, check out our allowed host here. You can see the value off our current list is inside our string on This is the main reason that we are getting despite clear error. So if you jump back here via scored, this particular list to Alu is going through our string, that means it is getting converted and go a string at this point of time. So what we need to do is we need to jump back or documentation on here. If you look how toe pastor list, you will find that you have to pass a directly. That means you need to remove this particular less common. And here I just need to pass these particular value inside my less itself. I hope the souls a problem. Let me go back here, you start by so word, and here you can see our application is working. Fine. So if I click her on to do list, you can see they're asking me about my log in information. No effect. We can contact us about us whom? So this application is working fine. And even if you try to log in Yep, it's working. Fine. So that's how we are going to hide. All the information regarding our secret key are debug information on our allow. Those one important reason why we use Django and Myron is that we can hide lot more thing. So if you're using any different database, maybe are using my SQL. Maybe you were using post crest, so you need to hide your user name and password. Now there are chances that you might use any other third party application with use your AP information with use user name and password, so you need to hide them. That's where it is really important for us to use environment variables. I hope this letter was helpful. Now, from the next lecture, we are going to start working with a tub so we are going to push our codes from our locals Over toe. Get up! And remember, we also need to update this requirement. Start txt Since we have installed a new library I hope this lecture was helpful. Thank you for falling. See you in the next one. 10. Push project from Local System to GitHub: Hey, guys will come back now in this lecture, we're going to push our code from our local system to get a repository. That is a container. The first thing you need to do is just opened it up for a while. Let me open my repository on. Currently, we have nothing. We don't have any file. Anything else? Now these are the step that we need to follow on. All the step would be followed inside. Our task made fuller, which is our main folder. Now let me open my domino. The first step in equal Lewis, we need to do get in it, then we need to call it all the final status we need to do get at all. If you want to do any specific file, then you need to do get at the specific file name. Then we need to go get status to check all the files that we are sending on. What other changes that we have done with the help of get status? Then we need to do come in with a particular message. So this comet is really important and also dismisses Help us to track everything. Once you do come it. Now you can push your changes to our online somewhere It a starter force process. Make sure you are inside the correct folder. So this is the fuller way you need to have your managed or by So this is our party club folder on this is where are managed by is now you have to do get in it. So we have initialized RMT repository. So I need to add all the files. So I need to do get at got or you can go. Dashti, this means all the files. Now, if you want to check the status you need to do get status here. All the green thing means that you have these new fights. Since this is our first step, that means all the files should be new on. We'll be using get status in the future to check if we have any other changes as well. And if you look at the background, you can see all the files which are in tow, get ignored like our Devi like are dirty and be on by cash. So these are ignored files and you can see they're not changed. So let me do my first comet alive to this just kid comet. Bash em and then you're particle a message in goods. So if you're a first time user, that means if you're using get for the first time on new system, then you need to provide your email name, and then it will ask for password. So all you have to do is just repeat this command on here instead off this particular sample, I t you need to provide your account. I t that we have registered during our initial lecture. Let me quickly add my email and then 90 grew with my name. I got the error. Let me cut it. This one I need to use kid. That's done. Let me commit my changes again. So all I have to do is repeat my command. Get commit with our particle a message. So we have created our comet. Now we need to push our comet. So the first thing you need to lose since we're doing this for first time, we need to tell on which repository we need to commit. So this is our repository link and we need to tell the system for the first time for the sport club project we need to commit on this particular repository that is tasked me So all you have to do this You need to repeat this command. Let me basis here. That's done. Now I have to push my changes. So you need to use kid Push Dash, you origin Master Her origin master is actually at blunt So branching is a system in get that help you divide workflow on different fortune You don't need to understand that All you need to do is get Bush Nashua origin Master, we're master means the mean brunch and just press enter now Here Get will ask for Logan information for the first time. Let me quickly for the log in details and see what reserved Forget so you can see all the details regarding our number of files The compression on regarding our branch Let me go back to my browser on hair If I refresh my repository Hey, you can see I got all my files that I have pushed. That means now I have all my files in this particular get reports tree. I can share this with my teammates with any other person that I want. So this is something really important that we need to consider now in future. If you want to push any changes, suppose that currently we haven't updated our requirement or txt. That means we need to add a new library, update this one and then again pushed the changes on our get up. So all after this first, let me update my requirement or txt. So here you can see this is not maintained. Now let me push on new changes to get up. So all I have to do is just get at all. Then get status then get coming and then get pushed. Let me clear my screen and do all these steps. So let me go. Get add dot Now let me go get status here. You can see we have modified our requirements. Start txt Now you need to do get comet with a particle of message One status done. All you need to do is get Bush. That's done. Let me jump back my get up repose Tree you first This one here You can see I have changed this particular file 44 seconds ago And also if you want to see what changes I'm done you can just click on this particular comet and you can see I've added a new line. This looks fine. I hope now you understand about how to use get get up on how to push your code from your system toe online container. In the next lecture, we're going to talk about something really important, which is the unicorn on Harajuku server. Thank you for falling this lecture. See you in the next one. 11. Working with Django Heroku: Hey, guys will come back from this lecture. We're going to start our work with Roku as well as we're going to explore different libraries and dependencies on which Roku depends. So in this lecture, we are going to install Hiroko. Then we're going to update our setting, start by with specific cord. Then we are going to create online container on Haruko and we'll be testing that. And the next lecture, we're going to push our code from our local system to our producer. Where? So the first thing we need to do is we need to install Django Harajuku. So all you have to do is Pip. Install Django Dash Kuku one status done. Just jump onto a setting. Start by and here we need to import are Django Roku Scroll at the bottom Here, you need to add a specific court regarding Haruka sitting. So all you need to do is just right. Django, underscore harajuku dot settings, and then you need to pass locals One status done. We need to create a project on her Roku. So, like, we have created online container on Get up. We need to do something similar on her loco. So All you have to do is use the command sudoku. Great. And then you need to pass a project name. Your project name should be unique on this will also be your domain name. So that means your domain would be referred as your project name dot Hiroko up dot com. So I'm going to give project name as ask me up. Let me see if despite color name is available or not, this particular name is already taken. Let me try with a new name. I would be using PM app. I need to drive it more unique Name that we drive it. Task mate bro. Yeah, This works. Let me jump onto my haruka up and refresh my browser here. You can see now I have a task made. Pro Fuller. Now, currently, this up is not going to work on line because we need something to handle Are the Blue s year Now we have created a container on our Roku. It's time to push our code from a local system toe Roku server. So we'll be falling Something similar that we have done in our kit before That I also need to update my requirements. Start txt Because I have installed a new library. Call Django Roku. So let me quickly dope. It frees requirements. Start txt on here. You can see I have a new line off court, which is Django Haruko on these two files are updated. So we need to push these changes on Quetta as well as Roku. Now and then, we need to solve a lot off error. So I hope this lecture was helpful in the next lecture. Let us push our changes on get up as well as Harajuku. Thank you for falling. See you in the next one. 12. Working with StaticRoot: now let us quickly push 13 years to get up to see all the changes. All you have to do is use command, get status. So these other two files that are modified now here, you need to use command. Kid. Add all. I should go get status again. You will get both the file which are ready to commit. Now. All I have to do issues get commit, Dash. Um And then I need to bite a particle. A message One status tan. Let me push my changes to get up with the command. Get push Origin Master, this looks fine now to push changes toe Rokko all after this use kid push Haruka Master Now , during our first push, it will check All are important files. It will check all our requirements for txt on it will install all the required files that were mentioned. So that's done. You haven't entered and decider is regarding our static fight. So just jump on your sitting start by and scroll to the bottom Here you need to add static route so you need to provide the part for your static file. So all you have to do is just use us dot pot or join and then you need to mention your base directory and then your static file path one status done. Let me add this with other static. Really? Was This looks fine. Now remember, we also need to create an empty static folder. And for the lectures for this particle a static route. So there are two things that are still remaining. The 1st 1 is handling our Ws year. The 2nd 1 is to configure our secret and hidden coats. That is our secret Keilar, debug and our host that we'll be doing in our next lecture. I hope now you understand how to push changes on Haruko on how are your static route? Back in the next lecture, let us talk about RG Unicorn and then configure our secret key Debug and host. Thank you for falling. See you in the next one. 13. Handling WSGI with gunicorn: Welcome back Now in the structure. We are going to do something really important which is handling our ws Shia, which is Web. So we'll get win trophies. So we'll be doing that with help off the unicorn. So if you want to understand and basic somewhat unicorn is so when we launch our application to production. So there are a lot off static files that need to be handled. There are extra DPS connections. There are crashes and there are a lot off gold from heroic aside. So all these things need to be handled by a website where and that's where she and you can come into picture. Remember when we run our application on our local sober, we run using fight on managed art by runs our on. If there is any error, our application usually stop. But while on production we cannot stop our application like this. There need to be some planning to recover from crashes. Also do restart our server on. That's where Gina con helps a lot. So the first thing we need to do is we need to install the unicorn. So all you have to do is pip Install unicorn one status in. We need to create a brock file. So the SPROCK file is going to carry some commands that are going toe handle us our. So just create this Brock file, a new base directory. They're your managed or fire file exist. Remember, it's simple. Brock file. No extension. And here you need to add specific command. That is web, then. Golan, tend unicorn, then your project name dot ws year. So this particle refers to our web application. So this file is used to declare our application process type and entry points on this particular Brock file requires unicorn. Now, once that is done, we also need to update our requirements. Start txt. Let me push the genius to get up on the next lecture. Will be creating an empty folder. Name static files. After that, we are going to Bush on Roku One status, Dan, we're good to go for our for the changes. Remember, we have still not configured our three variables that a security Q debug and allow. Does I hope this was helpful? Thank you for falling this lecture. See you and the next one 14. Empty folder Staticfiles: Hey, guys, Welcome to this quick lecture. Now, in this lecture, we are going to are a new folder coiled static files that we have discussed in the previous lecture. So here we just need to add an empty fuller as well as an empty file inside, despite the color folder to make this fuller valued. So we need to create a empty folder with the name static files. One status done. Let me add a file called dot Keep. So this is an empty file. We are just adding so we can push this change to get a zealous Haruko one status done. We are now ready to push our changes toe, get up as well as Haruko and see our application with for the others. So all you have to do is just push the changes to both the containers we are still facing. Enter. So we have to disable this collect static part on her, Roku to make our project working. Let us discuss about this. Enter in the next lecture 15. Configuring Secret Keys: Now, after doing this, if you're still facing better than you have to follow these particular step, you have to actually disable your collect static. Then they play on hoco, and then we have to do other changes. So the first thing I need to do is you have to actually disable your collect static. So all I have to do is I have to follow this particular command. And now you have to push the changes. - I hope this is going to work this time. We are going toe have our application with particular domain. Yep, we have deployed on. We haven't got better this time. Now to open Youling. All you have to do is just with it. This particle a link or you can do karaoke open. Remember, we haven't created any database on us over on. It is not going to work properly. But let me check what we're getting on our domain right now. So this is our app. And currently we're getting error. We need to solve this one. But before that, let me configure all my settings so alive. Kudos. Use Hiroko conflict said than my secret key. And then I need to pass their secret key. Now, before moving forward, I need to conflict all the three important environment variables. Because without them, my database is not going to work. My application is not going to work. So all I have to do is just compare Open my e m e file on here. Let me copy this one. This system we have configured our jangle secret key. Now we need to configure our jungle debug. So you need to use Hiroko conflict. Colon said Django debug equals truffles. Make me don't just come on. Yeah, that's done. Now we need to configure third value that is are allowed host here. You need to pass your particular domain name, which is here in my case it is task made pro dot Roku app dot com Now one status done. Let me try to open Mihoko up again and see what other we are getting. Remember, we still need to migrate our database her Finally, we can see our web application online in the next lecture. We need to migrate our database and we need to create a super user, I hope. And now you are able to understand everything. Andi, if you are still facing any error, even after disabling your collect static, I would recommend you to check the documentation if you are missing any point. I hope this lecture was helpful. Thank you for falling. See you in the next one. 16. Setting up Database and adding users: Hey, guys, Welcome back in this lecture we are going to set up our database on Haruka Server as well as our users on it. So the first thing is, this application is working, but it has no user on it. Has no working date of is so. All I have to do is I have toe enter into her local bash, so I have to use a command. Hiroko run bash. Now, this will help us to access Roku's over. Now here, we need to enter all the commands to change on our Roku silver. So the first thing we need to do is we need to use by tone managed or by my grade. This will help us to create all the tables that are required in our database. One status done. I need to create a super user so alive to do issues a command by tone, manage sort by create super user. Admitted using a mesh of, um, my email is on Wired show Obama the regional dot com. It may take a strong password. That's done. So we have created our super user on our application. Let me do you fresh. This one. Remember? Here we don't have to follow like pie tone managed. Lord Byron's over because that is handled by our web server. Now, since we have created our database, we have created our new user. Let me log in this one. Yep. This is working. Fine. Let me try to add new dusk. Yep. This is working fine. So you can see our application is now working. We have done everything and you can see complete application as it is from our system. The next thing you need to remember is if you're doing any changes in future, make sure you push to get up on then on Haruko. So basically get up is used to track all our coats to keep all the changes at one place to make a track off all the changes that we have done since we are not accessing code for our task made to Harajuku, we are accessing everything from our get up. I hope this was helpful. Make sure to visit the dog since I've already added all the steps Stared Let me exit this particular Haruka bash And now I'm back to my local domino. This application is working fine. We have done all the changes. I hope this lecture was handful. Thank you for falling. See you in the next one 17. Thank You For Being Here!: Hey, guys, Welcome back. Glad you released this lecture. You reserve a pizza or maybe a short break. You just unlock a new set off skill by completing the schools. Thank you for choosing and believing me. If you like this course, don't forget to leave a review. Your review. Keep me motivated to work hard. A big lake just as relus add more lectures on a regular basis. Thank you for falling. See you in the next one.