title
Python Django Tutorial: Deploying Your Application (Option #2) - Deploy using Heroku

description
In this Python Django Tutorial, we will be learning how to deploy our application to Heroku. Heroku is a platform that abstracts away a lot of the low-level system administration and allows us to easily deploy, update, and rollback changes for our application. Let's get started... Git Install - https://git-scm.com/downloads Heroku CLI Install - http://bit.ly/heroku-cli Postgres Install - http://bit.ly/heroku-postgres My requirements.txt file - http://bit.ly/django-req-txt-file Git Command-Line Fundamentals - https://youtu.be/HVsySz-h9r4 Gitignore file (Python) - http://bit.ly/py-ignore Environment Variables (Windows) - https://youtu.be/IolxqkL7cD8 Environment Variables (Mac and Linux) - https://youtu.be/5iWhQWVXosU ✅ Support My Channel Through Patreon: https://www.patreon.com/coreyms ✅ Become a Channel Member: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join ✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY ✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot ✅ Corey's Public Amazon Wishlist http://a.co/inIyro1 ✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer ▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel - https://www.youtube.com/c/coreymschafer Facebook - https://www.facebook.com/CoreyMSchafer Twitter - https://twitter.com/CoreyMSchafer Instagram - https://www.instagram.com/coreymschafer/ #Python #Django

detail
{'title': 'Python Django Tutorial: Deploying Your Application (Option #2) - Deploy using Heroku', 'heatmap': [{'end': 259.623, 'start': 218.172, 'weight': 0.746}, {'end': 738.545, 'start': 672.826, 'weight': 1}, {'end': 804.02, 'start': 770.311, 'weight': 0.719}, {'end': 903.818, 'start': 865.913, 'weight': 0.73}, {'end': 1446.493, 'start': 1411.61, 'weight': 0.731}, {'end': 1768.583, 'start': 1732.612, 'weight': 0.813}], 'summary': 'Tutorial focuses on deploying a django app using heroku, covering setting up a heroku account, managing .gitignore, fixing deployment errors, setting environment variables, configuring django for heroku deployment, and testing the functionality of the deployed site.', 'chapters': [{'end': 102.96, 'segs': [{'end': 30.645, 'src': 'embed', 'start': 0.229, 'weight': 2, 'content': [{'end': 1.33, 'text': "Hey there, how's it going everybody?", 'start': 0.229, 'duration': 1.101}, {'end': 8.713, 'text': "In this video, we're going to learn how to deploy our Django application using Heroku so that anyone with internet access can use it within a browser.", 'start': 1.67, 'duration': 7.043}, {'end': 14.675, 'text': "So, so far we've created this application with some good functionality, but the site still only lives on our local machine.", 'start': 9.113, 'duration': 5.562}, {'end': 17.897, 'text': 'So right now I have this running in my browser on my local machine.', 'start': 15.036, 'duration': 2.861}, {'end': 19.818, 'text': 'but no one else can access this.', 'start': 18.277, 'duration': 1.541}, {'end': 26.482, 'text': "So the point of building these sites and applications is to deploy them so that they're accessible over the internet.", 'start': 20.218, 'duration': 6.264}, {'end': 30.645, 'text': "So in this video we're going to use Heroku to deploy our application.", 'start': 26.822, 'duration': 3.823}], 'summary': 'Learn to deploy django app using heroku for internet access.', 'duration': 30.416, 'max_score': 0.229, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc229.jpg'}, {'end': 65.827, 'src': 'embed', 'start': 44.133, 'weight': 0, 'content': [{'end': 54.58, 'text': 'then you would have noticed that that took a lot of time and also requires you to be familiar with a little bit of system administration and things like that in order to get your application up and running.', 'start': 44.133, 'duration': 10.447}, {'end': 65.827, 'text': 'Heroku abstracts a lot of that away and allows us to get our application deployed more easily without needing to set up our own web servers and firewalls and stuff like that.', 'start': 55.24, 'duration': 10.587}], 'summary': 'Heroku simplifies application deployment, reducing setup time and eliminating need for system administration knowledge.', 'duration': 21.694, 'max_score': 44.133, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc44133.jpg'}, {'end': 107.864, 'src': 'embed', 'start': 84.988, 'weight': 1, 'content': [{'end': 93.313, 'text': 'it will hold our static files and things like that, but if we store a bunch of images or user uploads, then those are actually going to be deleted.', 'start': 84.988, 'duration': 8.325}, {'end': 102.96, 'text': "so if you're saving images or files from your users, then you'll need to use a service through something like amazon web services in s3 buckets.", 'start': 93.313, 'duration': 9.647}, {'end': 107.864, 'text': "so if you're following along with this series, then we already saw how to get that set up in our last video.", 'start': 102.96, 'duration': 4.904}], 'summary': 'Storing images or user uploads will be deleted, use aws s3 buckets for storage.', 'duration': 22.876, 'max_score': 84.988, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc84988.jpg'}], 'start': 0.229, 'title': 'Deploying django app with heroku', 'summary': 'Explains deploying a django app using heroku, emphasizing easy deployment, free tier availability, and the need for external storage for images and user uploads.', 'chapters': [{'end': 102.96, 'start': 0.229, 'title': 'Deploying django application with heroku', 'summary': 'Explains how to deploy a django application using heroku, highlighting its benefits such as easy deployment, free tier availability, and the need for external storage for images and user uploads.', 'duration': 102.731, 'highlights': ['Heroku abstracts the setup of web servers and firewalls, making it easier to deploy applications without system administration knowledge and offers a free tier for deployment, allowing users to scale up as needed.', 'Heroku does not have a normal file system for storing images or user uploads, requiring the use of external services like Amazon Web Services and S3 buckets for such data storage.', 'The video focuses on deploying the Django application using Heroku to make it accessible over the internet, emphasizing the current limitation of the application only living on the local machine and the need for deployment for internet accessibility.']}], 'duration': 102.731, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc229.jpg', 'highlights': ['Heroku abstracts the setup of web servers and firewalls, making it easier to deploy applications without system administration knowledge and offers a free tier for deployment, allowing users to scale up as needed.', 'Heroku does not have a normal file system for storing images or user uploads, requiring the use of external services like Amazon Web Services and S3 buckets for such data storage.', 'The video focuses on deploying the Django application using Heroku to make it accessible over the internet, emphasizing the current limitation of the application only living on the local machine and the need for deployment for internet accessibility.']}, {'end': 579.695, 'segs': [{'end': 166.091, 'src': 'embed', 'start': 141.485, 'weight': 1, 'content': [{'end': 147.133, 'text': 'Now using Git and version control is considered a best practice by just about any programmer out there.', 'start': 141.485, 'duration': 5.648}, {'end': 153.281, 'text': "So I think it's great that this is how Heroku does its deployments because it basically steers you towards best practices.", 'start': 147.473, 'duration': 5.808}, {'end': 156.465, 'text': 'So installing Git is also very straightforward.', 'start': 153.642, 'duration': 2.823}, {'end': 158.909, 'text': "So I'll open up the Git download page here.", 'start': 156.586, 'duration': 2.323}, {'end': 163.35, 'text': "Now, most of you likely already have Git installed, so I'm not going to go into that here.", 'start': 159.289, 'duration': 4.061}, {'end': 166.091, 'text': "But if, for some reason, you don't have Git installed,", 'start': 163.731, 'duration': 2.36}], 'summary': 'Heroku deployments steer towards best practices by using git for straightforward installations.', 'duration': 24.606, 'max_score': 141.485, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc141485.jpg'}, {'end': 212.626, 'src': 'embed', 'start': 175.054, 'weight': 0, 'content': [{'end': 178.696, 'text': "Now, another thing that you're going to want to do, once you have a Heroku account,", 'start': 175.054, 'duration': 3.642}, {'end': 185.098, 'text': "is you're going to want to install the Heroku command line interface, which is the Heroku CLI for short.", 'start': 178.696, 'duration': 6.402}, {'end': 192.225, 'text': 'The Heroku CLI is going to allow us to deploy our application from our command line using some Heroku specific commands.', 'start': 185.558, 'duration': 6.667}, {'end': 198.631, 'text': 'So this page that I have open here will give you instructions for how to download this for Mac, Windows, or Linux.', 'start': 192.585, 'duration': 6.046}, {'end': 202.715, 'text': "And again, I'll have a link to this page in the description section below as well.", 'start': 199.091, 'duration': 3.624}, {'end': 206.699, 'text': "so that you can download the CLI for whichever operating system you're using.", 'start': 203.095, 'duration': 3.604}, {'end': 212.626, 'text': "I'm on a Mac, so that's the option that I chose, but I've already downloaded and installed this.", 'start': 207.12, 'duration': 5.506}], 'summary': 'Install heroku cli to deploy applications using specific commands.', 'duration': 37.572, 'max_score': 175.054, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc175054.jpg'}, {'end': 259.623, 'src': 'heatmap', 'start': 218.172, 'weight': 0.746, 'content': [{'end': 225.379, 'text': "So I'm going to open up my command line here, And you're just going to test this by simply typing in Heroku.", 'start': 218.172, 'duration': 7.207}, {'end': 227.761, 'text': "So I'll type in Heroku and run that.", 'start': 225.519, 'duration': 2.242}, {'end': 235.227, 'text': 'And if our installation of the Heroku CLI worked, then it should list out a list of commands that we can use to interact with our account.', 'start': 228.121, 'duration': 7.106}, {'end': 243.735, 'text': "Now, the first thing that we'll need to do is log in through the command line so that we're validated to run these commands on our account.", 'start': 235.668, 'duration': 8.067}, {'end': 246.077, 'text': "So to do this, I'm just going to scroll down.", 'start': 244.115, 'duration': 1.962}, {'end': 248.059, 'text': "Actually, I'll just clear my page here.", 'start': 246.357, 'duration': 1.702}, {'end': 252.78, 'text': 'By the way, by typing in Heroku, you can see all of the commands that we can use here.', 'start': 248.659, 'duration': 4.121}, {'end': 255.401, 'text': 'But I will clear the page.', 'start': 253.601, 'duration': 1.8}, {'end': 259.623, 'text': "Now to log in, I'm going to say Heroku login and I'll run that.", 'start': 255.761, 'duration': 3.862}], 'summary': 'Testing heroku cli installation, logging in through command line.', 'duration': 41.451, 'max_score': 218.172, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc218172.jpg'}, {'end': 259.623, 'src': 'embed', 'start': 235.668, 'weight': 3, 'content': [{'end': 243.735, 'text': "Now, the first thing that we'll need to do is log in through the command line so that we're validated to run these commands on our account.", 'start': 235.668, 'duration': 8.067}, {'end': 246.077, 'text': "So to do this, I'm just going to scroll down.", 'start': 244.115, 'duration': 1.962}, {'end': 248.059, 'text': "Actually, I'll just clear my page here.", 'start': 246.357, 'duration': 1.702}, {'end': 252.78, 'text': 'By the way, by typing in Heroku, you can see all of the commands that we can use here.', 'start': 248.659, 'duration': 4.121}, {'end': 255.401, 'text': 'But I will clear the page.', 'start': 253.601, 'duration': 1.8}, {'end': 259.623, 'text': "Now to log in, I'm going to say Heroku login and I'll run that.", 'start': 255.761, 'duration': 3.862}], 'summary': 'Logging into heroku account via command line to run commands.', 'duration': 23.955, 'max_score': 235.668, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc235668.jpg'}, {'end': 339.625, 'src': 'embed', 'start': 316.847, 'weight': 4, 'content': [{'end': 325.214, 'text': "Now, if you haven't created a requirements.txt file, basically it is a file that holds all of the dependencies that we're using in our application.", 'start': 316.847, 'duration': 8.367}, {'end': 329.838, 'text': "Now, I'm using a virtual environment, so all of my packages are specific to this project.", 'start': 325.614, 'duration': 4.224}, {'end': 335.062, 'text': "But if you aren't using a virtual environment, then I'll link to the requirements.txt.", 'start': 330.198, 'duration': 4.864}, {'end': 339.625, 'text': "file that my app produces and I'll link to those in the description section below.", 'start': 335.062, 'duration': 4.563}], 'summary': 'Requirements.txt file holds dependencies for the application.', 'duration': 22.778, 'max_score': 316.847, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc316847.jpg'}, {'end': 382.935, 'src': 'embed', 'start': 355.14, 'weight': 5, 'content': [{'end': 357.983, 'text': 'So first, before we create our requirements.txt.', 'start': 355.14, 'duration': 2.843}, {'end': 364.069, 'text': "file of our dependencies, let's pip install one more package that we're going to use when our application is deployed.", 'start': 357.983, 'duration': 6.086}, {'end': 366.37, 'text': 'and that is gunicorn.', 'start': 364.609, 'duration': 1.761}, {'end': 372.012, 'text': "So I'm going to install that by saying pip install gunicorn.", 'start': 366.69, 'duration': 5.322}, {'end': 378.114, 'text': 'So we will install that and once we have that installed, now we want to create our requirements.txt file.', 'start': 372.332, 'duration': 5.782}, {'end': 382.935, 'text': "Now the requirements file is also how Heroku knows that it's a Python application.", 'start': 378.514, 'duration': 4.421}], 'summary': 'Install gunicorn using pip before creating requirements.txt for python application deployment.', 'duration': 27.795, 'max_score': 355.14, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc355140.jpg'}, {'end': 503.111, 'src': 'embed', 'start': 476.212, 'weight': 6, 'content': [{'end': 480.116, 'text': 'it says initialize empty git repository in our project folder.', 'start': 476.212, 'duration': 3.904}, {'end': 483.118, 'text': "so now we're using git version control within our application.", 'start': 480.116, 'duration': 3.002}, {'end': 485.04, 'text': "it's actually that easy.", 'start': 483.118, 'duration': 1.922}, {'end': 492.767, 'text': "in this video we're going to be using very simple git commands, so you don't need to be extremely comfortable with using git in the command line.", 'start': 485.04, 'duration': 7.727}, {'end': 499.389, 'text': "But if you'd like to see an in-depth explanation and walkthrough of how to use Git, then I do have a detailed video on that as well.", 'start': 493.107, 'duration': 6.282}, {'end': 503.111, 'text': "And I'll leave a link to that in the description section below if anyone is interested.", 'start': 499.77, 'duration': 3.341}], 'summary': 'Initializing a git repository in the project folder for version control.', 'duration': 26.899, 'max_score': 476.212, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc476212.jpg'}, {'end': 562.526, 'src': 'embed', 'start': 537.341, 'weight': 7, 'content': [{'end': 544.009, 'text': 'And we can see that it ignores files like PYC files and logs and stuff like that.', 'start': 537.341, 'duration': 6.668}, {'end': 547.514, 'text': "That kind of stuff you likely don't want to track with Git.", 'start': 544.65, 'duration': 2.864}, {'end': 550.478, 'text': 'It also has a Django section.', 'start': 548.195, 'duration': 2.283}, {'end': 552.14, 'text': 'If I scroll down here a bit.', 'start': 550.538, 'duration': 1.602}, {'end': 555.002, 'text': 'We can see it has a Django section here.', 'start': 553.061, 'duration': 1.941}, {'end': 559.865, 'text': 'Now we can see it ignores our db.sqlite file as well.', 'start': 555.342, 'duration': 4.523}, {'end': 562.526, 'text': 'And that is our SQLite database.', 'start': 560.385, 'duration': 2.141}], 'summary': 'The transcript discusses ignoring files like pyc and logs, and the exclusion of db.sqlite file in a django section.', 'duration': 25.185, 'max_score': 537.341, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc537341.jpg'}], 'start': 102.96, 'title': 'Heroku deployment and django project setup', 'summary': 'Covers setting up a heroku account, installing git and the heroku cli, and authenticating the cli for deployment, as well as creating a requirements.txt file, installing the gunicorn package, and using git for version control within the django project.', 'chapters': [{'end': 295.254, 'start': 102.96, 'title': 'Setting up heroku deployment', 'summary': 'Covers the process of setting up a heroku account, installing git and the heroku cli, and authenticating the cli for deployment, focusing on best practices and straightforward installation.', 'duration': 192.294, 'highlights': ['The chapter covers the process of setting up a Heroku account, installing Git and the Heroku CLI, and authenticating the CLI for deployment This encompasses the main focus of the chapter, outlining the steps required for setting up Heroku deployment.', 'Heroku steers you towards best practices by using Git and version control for deployments Highlighting the benefit of using Git and version control for deployments, emphasizing best practices.', 'Instructions for downloading Git and the Heroku CLI for Mac, Windows, or Linux are provided Clear instructions are given for downloading Git and the Heroku CLI for various operating systems, enhancing accessibility.', 'Authentication is required through the command line to validate running commands on the Heroku account Emphasizing the importance of authentication through the command line for running commands on the Heroku account.']}, {'end': 579.695, 'start': 295.614, 'title': 'Setting up requirements.txt and git for django project', 'summary': 'Covers creating a requirements.txt file to hold project dependencies, installing the gunicorn package, using git for version control within the project, and ignoring certain files with a gitignore template.', 'duration': 284.081, 'highlights': ["Creating a requirements.txt file to hold project dependencies The requirements.txt file holds all the dependencies used in the application and is created by using 'pip freeze' command to list out all the pip installations and then adding the output to the requirements.txt file.", "Installing the gunicorn package for deployment The gunicorn package is installed using 'pip install gunicorn' to be used when the application is deployed.", "Using Git for version control within the project Git is initialized within the project by running the command 'git init', enabling version control for the application.", 'Ignoring certain files with a gitignore template A gitignore template is used to specify files to ignore tracking with Git, such as PYC files, logs, db.sqlite file, and any machine-specific files.']}], 'duration': 476.735, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc102960.jpg', 'highlights': ['The chapter covers the process of setting up a Heroku account, installing Git and the Heroku CLI, and authenticating the CLI for deployment. This encompasses the main focus of the chapter, outlining the steps required for setting up Heroku deployment.', 'Heroku steers you towards best practices by using Git and version control for deployments. Highlighting the benefit of using Git and version control for deployments, emphasizing best practices.', 'Instructions for downloading Git and the Heroku CLI for Mac, Windows, or Linux are provided. Clear instructions are given for downloading Git and the Heroku CLI for various operating systems, enhancing accessibility.', 'Authentication is required through the command line to validate running commands on the Heroku account. Emphasizing the importance of authentication through the command line for running commands on the Heroku account.', "Creating a requirements.txt file to hold project dependencies. The requirements.txt file holds all the dependencies used in the application and is created by using 'pip freeze' command to list out all the pip installations and then adding the output to the requirements.txt file.", "Installing the gunicorn package for deployment. The gunicorn package is installed using 'pip install gunicorn' to be used when the application is deployed.", "Using Git for version control within the project. Git is initialized within the project by running the command 'git init', enabling version control for the application.", 'Ignoring certain files with a gitignore template. A gitignore template is used to specify files to ignore tracking with Git, such as PYC files, logs, db.sqlite file, and any machine-specific files.']}, {'end': 1207.986, 'segs': [{'end': 608.673, 'src': 'embed', 'start': 580.055, 'weight': 1, 'content': [{'end': 584.238, 'text': "So that's what we're going to be using and it's also what Heroku recommends in its walkthroughs.", 'start': 580.055, 'duration': 4.183}, {'end': 591.582, 'text': "So I'm actually going to copy this template gitignore file from GitHub and use that as a starting point for my gitignore file.", 'start': 584.598, 'duration': 6.984}, {'end': 600.748, 'text': "Now, one tip is that if you're ever copying something from GitHub, then you can just click on this raw link here, towards the top right of the page,", 'start': 592.023, 'duration': 8.725}, {'end': 605.871, 'text': "and it will take you to just the text of the file, so that it's easier to copy and paste.", 'start': 600.748, 'duration': 5.123}, {'end': 608.673, 'text': 'So this is all of the text of that gitignore file.', 'start': 606.231, 'duration': 2.442}], 'summary': 'Using a recommended gitignore template from github for heroku deployment.', 'duration': 28.618, 'max_score': 580.055, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc580055.jpg'}, {'end': 669.705, 'src': 'embed', 'start': 623.038, 'weight': 2, 'content': [{'end': 625.518, 'text': 'So it is dot gitignore.', 'start': 623.038, 'duration': 2.48}, {'end': 628.619, 'text': "So don't forget the dot before gitignore.", 'start': 625.819, 'duration': 2.8}, {'end': 631.34, 'text': "So I'm going to create that and open that up.", 'start': 628.92, 'duration': 2.42}, {'end': 636.242, 'text': "And I'm going to paste in what we got from GitHub and then scroll up here to the top.", 'start': 631.74, 'duration': 4.502}, {'end': 640.565, 'text': 'So we can see that it is ignoring a lot of these different files.', 'start': 636.642, 'duration': 3.923}, {'end': 644.008, 'text': 'We have some unit test files in here and things like that.', 'start': 640.605, 'duration': 3.403}, {'end': 644.749, 'text': "So that's good.", 'start': 644.128, 'duration': 0.621}, {'end': 650.033, 'text': "Now at the top of mine, I'm also going to add something that gets added on Macs sometimes.", 'start': 645.129, 'duration': 4.904}, {'end': 652.435, 'text': "If you're on Windows, then you don't have to do this.", 'start': 650.353, 'duration': 2.082}, {'end': 657.699, 'text': "But at the top, I'm also going to add a section for Mac.", 'start': 653.135, 'duration': 4.564}, {'end': 660.961, 'text': "And I'm going to add a file here that is .", 'start': 658.279, 'duration': 2.682}, {'end': 662.783, 'text': 'ds underscore store.', 'start': 660.961, 'duration': 1.822}, {'end': 669.705, 'text': "And that's just an annoying file that gets created on Mac sometimes that we don't want to commit with our project as well.", 'start': 663.223, 'duration': 6.482}], 'summary': "Creating .gitignore file to ignore various files, adding specific exclusion for mac's .ds_store file.", 'duration': 46.667, 'max_score': 623.038, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc623038.jpg'}, {'end': 740.446, 'src': 'heatmap', 'start': 672.826, 'weight': 6, 'content': [{'end': 679.108, 'text': "Okay, so now that we have our gitignore file, let's go back to the command line and commit all of our changes so far.", 'start': 672.826, 'duration': 6.282}, {'end': 681.969, 'text': "So I'm going to open up our terminal here.", 'start': 679.448, 'duration': 2.521}, {'end': 692.436, 'text': "And to do this we can simply say git add with a dash capital A and that's going to add all of the changes that we have so far.", 'start': 682.809, 'duration': 9.627}, {'end': 701.003, 'text': "So I'll run that and now if I do a git status then we can see that we have all of these new files.", 'start': 692.877, 'duration': 8.126}, {'end': 707.547, 'text': "now. the reason our entire project is saying that it's new files is because we just initialized our git repository.", 'start': 701.363, 'duration': 6.184}, {'end': 709.348, 'text': 'so all of these files are new to git.', 'start': 707.547, 'duration': 1.801}, {'end': 711.529, 'text': 'none of them have been committed yet.', 'start': 709.348, 'duration': 2.181}, {'end': 713.93, 'text': "so now let's commit them to git.", 'start': 711.529, 'duration': 2.401}, {'end': 720.494, 'text': 'so i can say git commit and then we can do a dash m here to set a message for this commit.', 'start': 713.93, 'duration': 6.564}, {'end': 725.297, 'text': "and i'm just going to say initial commit and run that okay.", 'start': 720.494, 'duration': 4.803}, {'end': 728.539, 'text': "so now we've committed these files to git locally.", 'start': 725.297, 'duration': 3.242}, {'end': 734.782, 'text': "so now that we've committed these locally, Let's create an Heroku app where we can push this code.", 'start': 728.539, 'duration': 6.243}, {'end': 738.545, 'text': 'So to do this, we can simply use the Heroku command.', 'start': 735.163, 'duration': 3.382}, {'end': 740.446, 'text': 'So let me clear the screen here.', 'start': 739.125, 'duration': 1.321}], 'summary': 'Using git, committed changes locally, ready to create heroku app', 'duration': 26.516, 'max_score': 672.826, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc672826.jpg'}, {'end': 804.02, 'src': 'heatmap', 'start': 770.311, 'weight': 0.719, 'content': [{'end': 772.051, 'text': 'awesome Django app.', 'start': 770.311, 'duration': 1.74}, {'end': 773.112, 'text': 'I doubt that is taken.', 'start': 772.051, 'duration': 1.061}, {'end': 774.752, 'text': 'okay. so that one worked okay.', 'start': 773.112, 'duration': 1.64}, {'end': 783.814, 'text': "so when that app is created, it's actually going to create a domain for us as well, and I can see that domain in the output of that create command.", 'start': 774.752, 'duration': 9.062}, {'end': 784.134, 'text': 'you could.', 'start': 783.814, 'duration': 0.32}, {'end': 791.275, 'text': 'so you can either copy and paste that into your browser or you can simply run Heroku open to open that in your browser.', 'start': 784.134, 'duration': 7.141}, {'end': 793.136, 'text': 'so this is the URL here.', 'start': 791.275, 'duration': 1.861}, {'end': 798.037, 'text': 'you can copy and paste that into a browser, or let me clear my screen here,', 'start': 793.136, 'duration': 4.901}, {'end': 804.02, 'text': 'or I can just say Heroku open and it will automatically open that URL in my browser.', 'start': 798.037, 'duration': 5.983}], 'summary': "Creating a django app on heroku generates a domain that can be accessed via url or the 'heroku open' command.", 'duration': 33.709, 'max_score': 770.311, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc770311.jpg'}, {'end': 903.818, 'src': 'heatmap', 'start': 865.913, 'weight': 0.73, 'content': [{'end': 870.898, 'text': 'so if we run that, then this is going to start pushing our code up to heroku.', 'start': 865.913, 'duration': 4.985}, {'end': 874.041, 'text': "so we can see that it's going to do a lot of different things here.", 'start': 870.898, 'duration': 3.143}, {'end': 880.888, 'text': "so it's saying that a python app is detected, that it's installing python, installing pip and all of these different things.", 'start': 874.041, 'duration': 6.847}, {'end': 884.092, 'text': "so let me, uh, let's run through this installation here.", 'start': 880.888, 'duration': 3.204}, {'end': 891.167, 'text': 'Okay, so if you just have a simple Python application, then that might have worked for you and push that up to Heroku.', 'start': 885.242, 'duration': 5.925}, {'end': 897.733, 'text': "Now ours didn't work because our application is a bit more complex and it ran into an issue while it was deploying.", 'start': 891.547, 'duration': 6.186}, {'end': 903.818, 'text': "Now the good part is that if it runs into an error like this, then your app just doesn't get deployed.", 'start': 898.093, 'duration': 5.725}], 'summary': 'The process of pushing code to heroku is described, with details on detecting a python app, installation of python and pip, and handling deployment errors.', 'duration': 37.905, 'max_score': 865.913, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc865913.jpg'}, {'end': 934.663, 'src': 'embed', 'start': 908.662, 'weight': 5, 'content': [{'end': 915.188, 'text': 'So if we scroll up here a little bit, then we should see a detailed trace back of exactly what went wrong.', 'start': 908.662, 'duration': 6.526}, {'end': 918.231, 'text': 'Now my text is a bit larger here so that you all can see.', 'start': 915.548, 'duration': 2.683}, {'end': 926.758, 'text': "So this is going to be a bit bunched together, but I'll see if I can find the part where it ran into an error.", 'start': 918.251, 'duration': 8.507}, {'end': 934.663, 'text': 'So we can see that the error happened when it ran this command, python manage.py collect static.', 'start': 927.139, 'duration': 7.524}], 'summary': "Detailed trace back of error when running 'python manage.py collect static.'", 'duration': 26.001, 'max_score': 908.662, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc908662.jpg'}, {'end': 1176.593, 'src': 'embed', 'start': 1147.543, 'weight': 0, 'content': [{'end': 1151.685, 'text': "So I'll run Heroku open to open our application in the browser.", 'start': 1147.543, 'duration': 4.142}, {'end': 1156.066, 'text': 'And now let me make this a little larger here so that you all can read it.', 'start': 1152.185, 'duration': 3.881}, {'end': 1159.828, 'text': "So now it's telling us that we're getting an application error.", 'start': 1156.486, 'duration': 3.342}, {'end': 1162.989, 'text': 'So this is different than getting an error during deployment.', 'start': 1160.228, 'duration': 2.761}, {'end': 1164.709, 'text': 'So it gives us a hint here.', 'start': 1163.349, 'duration': 1.36}, {'end': 1171.992, 'text': "It says that if we're the owner of this application, then we can run this command, heroku logs dash dash tail.", 'start': 1164.749, 'duration': 7.243}, {'end': 1176.593, 'text': 'That command will allow us to see the latest logs of our application.', 'start': 1172.572, 'duration': 4.021}], 'summary': "Running 'heroku logs --tail' allows to see latest application logs", 'duration': 29.05, 'max_score': 1147.543, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1147543.jpg'}], 'start': 580.055, 'title': 'Managing .gitignore and heroku deployment', 'summary': 'Covers creating a .gitignore file by copying a template from github and ignoring specific files, as well as adding files to git, deploying code to heroku, encountering deployment errors, debugging errors, and modifying settings.py for redeployment.', 'chapters': [{'end': 669.705, 'start': 580.055, 'title': 'Creating a .gitignore file', 'summary': 'Demonstrates creating a .gitignore file by copying the template from github and adding specific files to ignore, including a mac-specific file .ds_store.', 'duration': 89.65, 'highlights': ["I'm actually going to copy this template gitignore file from GitHub and use that as a starting point for my gitignore file. Now, one tip is that if you're ever copying something from GitHub, then you can just click on this raw link here, towards the top right of the page, and it will take you to just the text of the file, so that it's easier to copy and paste.", "I'm going to create a gitignore file. So I'm going to go to a new file. And this is actually going to be a dot file. So it is dot gitignore. So don't forget the dot before gitignore. I'm going to paste in what we got from GitHub and then scroll up here to the top. So we can see that it is ignoring a lot of these different files.", "At the top, I'm also going to add a section for Mac. And I'm going to add a file here that is . ds underscore store. And that's just an annoying file that gets created on Mac sometimes that we don't want to commit with our project as well."]}, {'end': 1207.986, 'start': 670.025, 'title': 'Git commit, heroku deployment, and error debugging', 'summary': 'Covers adding files to gitignore, committing changes to git, creating a heroku app, pushing code to heroku, encountering deployment errors, and debugging the errors by modifying settings.py and redeploying.', 'duration': 537.961, 'highlights': ['Heroku deployment was successful after modifying settings.py to set the static root, but application error occurred when attempting to open the deployed application. The deployment to Heroku was successful after setting the static root in settings.py, but an application error occurred when attempting to open the deployed application.', 'Encountered deployment error due to missing static root setting in settings.py, leading to a failed deployment. The deployment failed initially due to the absence of the static root setting in settings.py, causing a deployment error.', 'Detailed the process of adding files to gitignore, committing changes to git, and creating a Heroku app with multiple attempts to set a unique app name. The process of adding files to gitignore, committing changes to git, and creating a Heroku app was detailed, including multiple attempts to set a unique app name.']}], 'duration': 627.931, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc580055.jpg', 'highlights': ['Heroku deployment was successful after modifying settings.py to set the static root, but application error occurred when attempting to open the deployed application.', "I'm actually going to copy this template gitignore file from GitHub and use that as a starting point for my gitignore file. Now, one tip is that if you're ever copying something from GitHub, then you can just click on this raw link here, towards the top right of the page, and it will take you to just the text of the file, so that it's easier to copy and paste.", "At the top, I'm also going to add a section for Mac. And I'm going to add a file here that is . ds underscore store. And that's just an annoying file that gets created on Mac sometimes that we don't want to commit with our project as well.", 'The deployment to Heroku was successful after setting the static root in settings.py, but an application error occurred when attempting to open the deployed application.', "I'm going to create a gitignore file. So I'm going to go to a new file. And this is actually going to be a dot file. So it is dot gitignore. So don't forget the dot before gitignore. I'm going to paste in what we got from GitHub and then scroll up here to the top. So we can see that it is ignoring a lot of these different files.", 'Encountered deployment error due to missing static root setting in settings.py, leading to a failed deployment. The deployment failed initially due to the absence of the static root setting in settings.py, causing a deployment error.', 'Detailed the process of adding files to gitignore, committing changes to git, and creating a Heroku app with multiple attempts to set a unique app name. The process of adding files to gitignore, committing changes to git, and creating a Heroku app was detailed, including multiple attempts to set a unique app name.']}, {'end': 1708.792, 'segs': [{'end': 1240.292, 'src': 'embed', 'start': 1208.287, 'weight': 0, 'content': [{'end': 1211.409, 'text': "So we can see that the error that we're getting is right here at the bottom.", 'start': 1208.287, 'duration': 3.122}, {'end': 1219.754, 'text': "And it's running on two different lines here, but we can see that the description of this error says that there are no web processes running.", 'start': 1211.969, 'duration': 7.785}, {'end': 1225.518, 'text': "So what's going on here is that we haven't told Heroku how we want to run our application.", 'start': 1220.134, 'duration': 5.384}, {'end': 1230.282, 'text': "So in order to do this, we're going to need to create something called a proc file.", 'start': 1225.918, 'duration': 4.364}, {'end': 1233.425, 'text': "So I'm going to create this and explain along the way.", 'start': 1230.683, 'duration': 2.742}, {'end': 1240.292, 'text': "So in the root of our project directory, I'm going to create that proc file.", 'start': 1234.226, 'duration': 6.066}], 'summary': 'Error due to no web processes running, solution: create a proc file', 'duration': 32.005, 'max_score': 1208.287, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1208287.jpg'}, {'end': 1446.493, 'src': 'heatmap', 'start': 1411.61, 'weight': 0.731, 'content': [{'end': 1413.392, 'text': 'And now we can commit our changes.', 'start': 1411.61, 'duration': 1.782}, {'end': 1419.857, 'text': "So again, if we want to see what changes we've made, we can do a get status and we can see that we have a new file here, proc file.", 'start': 1413.572, 'duration': 6.285}, {'end': 1426.501, 'text': "So I'll add that and say git add dash a to add all of our changes and now do a commit.", 'start': 1420.217, 'duration': 6.284}, {'end': 1431.243, 'text': 'So git commit with a message of added proc file.', 'start': 1426.721, 'duration': 4.522}, {'end': 1433.424, 'text': "And now I'll clear the screen.", 'start': 1431.924, 'duration': 1.5}, {'end': 1435.786, 'text': "Now let's push this up to Heroku.", 'start': 1433.885, 'duration': 1.901}, {'end': 1442.63, 'text': "So I'll say git push Heroku master and run that.", 'start': 1435.966, 'duration': 6.664}, {'end': 1446.493, 'text': "Okay, so now we've pushed those changes up to Heroku.", 'start': 1443.85, 'duration': 2.643}], 'summary': "Added new file 'proc file', committed and pushed changes to heroku.", 'duration': 34.883, 'max_score': 1411.61, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1411610.jpg'}, {'end': 1666.683, 'src': 'embed', 'start': 1628.358, 'weight': 2, 'content': [{'end': 1633.782, 'text': "Now, while we're setting environment variables, we should also move our secret key to an environment variable while we're at it.", 'start': 1628.358, 'duration': 5.424}, {'end': 1639.607, 'text': "So the secret key shouldn't be something that we put in our code potentially for other people to see.", 'start': 1634.123, 'duration': 5.484}, {'end': 1643.49, 'text': "So I'm going to create an environment variable for the secret key as well.", 'start': 1640.027, 'duration': 3.463}, {'end': 1650.074, 'text': "And I'm actually going to create a new secret key for our application since we've been using the current one for development.", 'start': 1644.051, 'duration': 6.023}, {'end': 1653.016, 'text': 'So the new one that we create will be for production.', 'start': 1650.395, 'duration': 2.621}, {'end': 1660.659, 'text': 'Now there are a bunch of ways that we can generate a new secret key, but the way that I like to do this is from the Python interpreter.', 'start': 1653.396, 'duration': 7.263}, {'end': 1666.683, 'text': "So I'm just going to open up my command line here And I'm going to run Python.", 'start': 1660.979, 'duration': 5.704}], 'summary': 'Creating new secret key for production environment to enhance security.', 'duration': 38.325, 'max_score': 1628.358, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1628358.jpg'}], 'start': 1208.287, 'title': 'Heroku deployment for django', 'summary': 'Explains fixing heroku web process error by creating a proc file and configuring heroku deployment for a django application, addressing security concerns, and generating a new secret key.', 'chapters': [{'end': 1357.701, 'start': 1208.287, 'title': 'Fixing heroku web process error', 'summary': "Explains the process of creating a proc file to resolve the 'no web processes running' error on heroku by detailing the necessary steps and commands.", 'duration': 149.414, 'highlights': ["The chapter details the creation of a proc file to resolve the 'no web processes running' error on Heroku by explaining the necessary steps and commands.", "The explanation includes creating a simple text file called proc file without a .txt extension and specifying the web process using the command 'web:gunicorn django_project.wsgi'.", "The chapter also clarifies the purpose of 'gunicorn' as a way for Python code to communicate with the web server and the significance of 'WSGI' as an acronym for 'Web Service Gateway Interface'."]}, {'end': 1708.792, 'start': 1358.081, 'title': 'Configuring heroku deployment', 'summary': 'Explains the process of configuring heroku deployment for a django application, including specifying a wsgi file, creating a procfile to define the web process, pushing changes to heroku, addressing security concerns by turning off debug mode, setting environment variables for debug and secret key, and generating a new secret key using the python interpreter.', 'duration': 350.711, 'highlights': ['The chapter explains the process of configuring Heroku deployment for a Django application, including specifying a WSGI file, creating a Procfile to define the web process, and pushing changes to Heroku. This includes specifying the WSGI file, creating a Procfile to define the web process, and pushing changes to Heroku, which is essential for deploying a Django application.', 'Addressing security concerns by turning off debug mode and setting environment variables for debug and secret key. The chapter emphasizes the importance of turning off debug mode to prevent vulnerabilities in production, setting environment variables for debug and secret key, and the significance of using environment variables for machine-specific values.', 'Generating a new secret key using the Python interpreter and setting it as an environment variable. The chapter demonstrates the process of generating a new secret key using the Python interpreter and setting it as an environment variable to enhance security in the application.']}], 'duration': 500.505, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1208287.jpg', 'highlights': ["The chapter details the creation of a proc file to resolve the 'no web processes running' error on Heroku by explaining the necessary steps and commands.", 'The chapter explains the process of configuring Heroku deployment for a Django application, including specifying a WSGI file, creating a Procfile to define the web process, and pushing changes to Heroku.', 'Addressing security concerns by turning off debug mode and setting environment variables for debug and secret key.', 'Generating a new secret key using the Python interpreter and setting it as an environment variable.']}, {'end': 2256.124, 'segs': [{'end': 1768.583, 'src': 'heatmap', 'start': 1709.173, 'weight': 0, 'content': [{'end': 1713.556, 'text': "So I'm going to copy that and I'm going to add that to my environment variables.", 'start': 1709.173, 'duration': 4.383}, {'end': 1719.061, 'text': "Now, since I'm on a Mac, I can put these in my dot bash underscore profile file.", 'start': 1713.957, 'duration': 5.104}, {'end': 1726.827, 'text': "But, like I said, if you're on a different operating system and don't know how to create environment variables for your operating system,", 'start': 1719.521, 'duration': 7.306}, {'end': 1729.97, 'text': 'then you can watch that other video that I mentioned just a bit ago.', 'start': 1726.827, 'duration': 3.143}, {'end': 1732.152, 'text': "that's linked in the description section below.", 'start': 1729.97, 'duration': 2.182}, {'end': 1735.675, 'text': "So I'm going to open my bash profile here.", 'start': 1732.612, 'duration': 3.063}, {'end': 1744.082, 'text': "So I'm going to exit out of the Python interpreter and open up my bash profile file in my home directory.", 'start': 1735.895, 'duration': 8.187}, {'end': 1748.545, 'text': 'Now I used a sublime command to open this up.', 'start': 1745.002, 'duration': 3.543}, {'end': 1755.691, 'text': "But if you don't have that sublime command set up on your system, then you can just open that in whatever editor of your choice.", 'start': 1749.026, 'duration': 6.665}, {'end': 1760.175, 'text': 'Once we have that open, let me turn off word wrap here so that we can read this a little better.', 'start': 1756.392, 'duration': 3.783}, {'end': 1768.583, 'text': "Once we have that open, I'm going to set this secret key under this section here where we have our Django blog variables.", 'start': 1760.855, 'duration': 7.728}], 'summary': 'Adding environment variables to bash profile for setting secret key in django blog', 'duration': 46.518, 'max_score': 1709.173, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1709173.jpg'}, {'end': 1898.715, 'src': 'embed', 'start': 1870.257, 'weight': 1, 'content': [{'end': 1875.3, 'text': 'So Heroku config set, and I will set that secret key equal to that value.', 'start': 1870.257, 'duration': 5.043}, {'end': 1882.224, 'text': "And now I'll also say Heroku config colon set.", 'start': 1875.68, 'duration': 6.544}, {'end': 1889.908, 'text': 'Go back to our environment variables here and set this debug value equal to true.', 'start': 1882.764, 'duration': 7.144}, {'end': 1898.715, 'text': "And if you've been following along with this series, then you also need to set a few more environment variables.", 'start': 1894.17, 'duration': 4.545}], 'summary': 'Setting environment variables on heroku for secret key and debug value.', 'duration': 28.458, 'max_score': 1870.257, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1870257.jpg'}, {'end': 2137.836, 'src': 'embed', 'start': 2115.475, 'weight': 3, 'content': [{'end': 2123.867, 'text': "Okay, so remember we didn't push our SQLite database that we've been using in deployment because we're going to use Postgres in production.", 'start': 2115.475, 'duration': 8.392}, {'end': 2129.19, 'text': "So this is a little expected since we haven't created any tables in a Postgres database yet.", 'start': 2124.287, 'duration': 4.903}, {'end': 2134.494, 'text': "So first of all, we're going to need Postgres installed on our machine to get this working.", 'start': 2129.671, 'duration': 4.823}, {'end': 2137.836, 'text': "So let me pull up Heroku's documentation on this.", 'start': 2134.834, 'duration': 3.002}], 'summary': 'Sqlite database not pushed for postgres deployment, need to install postgres for heroku', 'duration': 22.361, 'max_score': 2115.475, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2115475.jpg'}, {'end': 2261.546, 'src': 'embed', 'start': 2232.673, 'weight': 2, 'content': [{'end': 2235.875, 'text': 'But if you ever need any more performance, then you can always bump that up.', 'start': 2232.673, 'duration': 3.202}, {'end': 2240.917, 'text': 'And we can see more about that if we were to run Heroku PG.', 'start': 2236.375, 'duration': 4.542}, {'end': 2243.558, 'text': 'we can see there.', 'start': 2242.978, 'duration': 0.58}, {'end': 2246.139, 'text': 'it shows us a bit more about that database.', 'start': 2243.558, 'duration': 2.581}, {'end': 2251.622, 'text': 'so we can see that it has for the rows zero out of ten thousand.', 'start': 2246.139, 'duration': 5.483}, {'end': 2256.124, 'text': 'so the free tier does have a ten thousand row limit.', 'start': 2251.622, 'duration': 4.502}, {'end': 2261.546, 'text': 'okay. so now that we have a postgres database now we actually need to create tables for it.', 'start': 2256.124, 'duration': 5.422}], 'summary': 'Heroku pg shows database with 0 out of 10,000 rows limit, free tier has 10,000 row limit.', 'duration': 28.873, 'max_score': 2232.673, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2232673.jpg'}], 'start': 1709.173, 'title': 'Setting environment variables', 'summary': 'Covers setting environment variables on a mac, including the use of the dot bash profile file, and for heroku deployment, encompassing setting various variables like secret key, debug value, aws credentials, and email user and password, as well as configuring the postgres database.', 'chapters': [{'end': 1755.691, 'start': 1709.173, 'title': 'Setting environment variables on mac', 'summary': 'Discusses setting environment variables on a mac, mentioning the use of the dot bash profile file and the process of opening and editing it, providing alternative options for different operating systems.', 'duration': 46.518, 'highlights': ['The process involves adding the environment variables to the dot bash underscore profile file on a Mac.', 'Instructions are provided for opening and editing the bash profile file, including the use of the sublime command for those who have it set up on their system.', 'Alternative options are suggested for individuals on different operating systems who may not be familiar with creating environment variables.']}, {'end': 2256.124, 'start': 1756.392, 'title': 'Setting environment variables for heroku deployment', 'summary': 'Demonstrates setting environment variables for heroku deployment, including setting the secret key, debug value, aws credentials, and email user and password, and also discusses the configuration of postgres database for deployment.', 'duration': 499.732, 'highlights': ['Setting environment variables for local and Heroku deployment Demonstrates setting environment variables for both local and Heroku deployment, including the secret key, debug value, AWS credentials, and email user and password.', 'Configuration of Postgres database for Heroku deployment Discusses the configuration of Postgres database for deployment, including the installation of Postgres on the local machine, checking for existing database on Heroku, and creating a Postgres database if needed.', "Explanation of Heroku database plans and limitations Provides an overview of Heroku database plans and limitations, including the free tier's ten thousand row limit and the option to upgrade for better performance."]}], 'duration': 546.951, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc1709173.jpg', 'highlights': ['Instructions for adding environment variables to the dot bash underscore profile file on a Mac.', 'Demonstration of setting environment variables for both local and Heroku deployment, including secret key, debug value, AWS credentials, and email user and password.', "Overview of Heroku database plans and limitations, including the free tier's ten thousand row limit and the option to upgrade for better performance.", 'Configuration of Postgres database for deployment, including installation of Postgres on the local machine, checking for existing database on Heroku, and creating a Postgres database if needed.', 'Instructions for opening and editing the bash profile file, including the use of the sublime command for those who have it set up on their system.', 'Suggested alternative options for individuals on different operating systems who may not be familiar with creating environment variables.']}, {'end': 3197.667, 'segs': [{'end': 2298.822, 'src': 'embed', 'start': 2256.124, 'weight': 0, 'content': [{'end': 2261.546, 'text': 'okay. so now that we have a postgres database now we actually need to create tables for it.', 'start': 2256.124, 'duration': 5.422}, {'end': 2267.828, 'text': 'so we also need to create a super user where we can log in to our django admin site.', 'start': 2261.546, 'duration': 6.282}, {'end': 2276.992, 'text': 'so first things, first we need to add the credentials to our settings.py file so that our Django application can talk to the database.', 'start': 2267.828, 'duration': 9.164}, {'end': 2283.195, 'text': "Now, instead of doing this manually, we're going to use a helper function that Heroku provides for us to do this.", 'start': 2277.373, 'duration': 5.822}, {'end': 2287.137, 'text': 'And we can get that by running a pip install.', 'start': 2283.715, 'duration': 3.422}, {'end': 2297.761, 'text': "So here within our command line, I'm going to do an installation of pip install django-heroku.", 'start': 2287.637, 'duration': 10.124}, {'end': 2298.822, 'text': "So I'll run that.", 'start': 2298.182, 'duration': 0.64}], 'summary': 'Create tables in postgres database and install django-heroku using pip.', 'duration': 42.698, 'max_score': 2256.124, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2256124.jpg'}, {'end': 2350.893, 'src': 'embed', 'start': 2323.981, 'weight': 2, 'content': [{'end': 2327.846, 'text': "But I like setting those myself since I'm already in there anyways.", 'start': 2323.981, 'duration': 3.865}, {'end': 2332.372, 'text': 'Okay, so the way that we get this to work is to open up our settings.py file.', 'start': 2328.207, 'duration': 4.165}, {'end': 2334.435, 'text': 'So let me open that up here.', 'start': 2332.512, 'duration': 1.923}, {'end': 2339.06, 'text': 'And at the top of our file, we want to import that module.', 'start': 2335.015, 'duration': 4.045}, {'end': 2343.865, 'text': "So I'm going to import Django underscore Heroku.", 'start': 2339.38, 'duration': 4.485}, {'end': 2350.893, 'text': "Now I know that we installed that as Django dash Heroku, but when we import it, it's Django underscore Heroku.", 'start': 2344.045, 'duration': 6.848}], 'summary': 'Import django_heroku in settings.py to enable functionality.', 'duration': 26.912, 'max_score': 2323.981, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2323981.jpg'}, {'end': 2603.918, 'src': 'embed', 'start': 2556.334, 'weight': 3, 'content': [{'end': 2564.761, 'text': "So if I run that, then it's going to run python manage.py migrate on our Heroku machine.", 'start': 2556.334, 'duration': 8.427}, {'end': 2570.443, 'text': 'So that should have run our migrations for our application and created our tables.', 'start': 2566.061, 'duration': 4.382}, {'end': 2574.105, 'text': "And if we scroll up here, we can see that it looks like that's what it did.", 'start': 2570.803, 'duration': 3.302}, {'end': 2577.746, 'text': 'We have a bunch of green marks here that said everything went okay.', 'start': 2574.165, 'duration': 3.581}, {'end': 2580.968, 'text': 'Okay, so now our tables should be created.', 'start': 2578.687, 'duration': 2.281}, {'end': 2586.25, 'text': "Now, while we're at it, let's also create a super user that can log in to the admin panel.", 'start': 2581.368, 'duration': 4.882}, {'end': 2589.912, 'text': "Remember, we're starting over with a new production database here.", 'start': 2586.91, 'duration': 3.002}, {'end': 2594.754, 'text': 'So our old one that we used in development, it no longer exists.', 'start': 2590.652, 'duration': 4.102}, {'end': 2596.735, 'text': 'We have to also create this on Heroku.', 'start': 2594.794, 'duration': 1.941}, {'end': 2603.918, 'text': 'Now another way that we can run commands on Heroku is to actually run a bash shell from Heroku itself.', 'start': 2597.035, 'duration': 6.883}], 'summary': 'Ran python manage.py migrate on heroku, created tables, and super user for new production database.', 'duration': 47.584, 'max_score': 2556.334, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2556334.jpg'}, {'end': 2737.257, 'src': 'embed', 'start': 2711.511, 'weight': 5, 'content': [{'end': 2717.692, 'text': 'So we can see our application is running here at myawesomejangoapp.herokuapp.com.', 'start': 2711.511, 'duration': 6.181}, {'end': 2721.773, 'text': 'So this should be accessible to anyone on the internet at this point.', 'start': 2718.393, 'duration': 3.38}, {'end': 2728.155, 'text': "Now there currently aren't any posts because we created a new Postgres database for production.", 'start': 2722.253, 'duration': 5.902}, {'end': 2733.096, 'text': "So let's test out some of the functionality of this site and see if everything is working.", 'start': 2728.555, 'duration': 4.541}, {'end': 2737.257, 'text': "So let's try to log in with that super user that we just created.", 'start': 2733.516, 'duration': 3.741}], 'summary': 'Application is running at myawesomejangoapp.herokuapp.com, accessible to anyone. testing functionality and login with super user.', 'duration': 25.746, 'max_score': 2711.511, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2711511.jpg'}, {'end': 2860.055, 'src': 'embed', 'start': 2827.192, 'weight': 6, 'content': [{'end': 2828.132, 'text': 'That seems to work well.', 'start': 2827.192, 'duration': 0.94}, {'end': 2829.713, 'text': 'Let me try to delete that post.', 'start': 2828.292, 'duration': 1.421}, {'end': 2832.652, 'text': "Okay, and that's working well also.", 'start': 2831.01, 'duration': 1.642}, {'end': 2833.993, 'text': 'That second post was deleted.', 'start': 2832.712, 'duration': 1.281}, {'end': 2839.658, 'text': "So we're just kind of going through here and making sure that all this functionality is working correctly.", 'start': 2834.313, 'duration': 5.345}, {'end': 2846.944, 'text': "Now. this is also why it's a good idea to have tests set up for your website so that you can just automate all of these tests,", 'start': 2839.938, 'duration': 7.006}, {'end': 2853.17, 'text': 'because doing this manually every time you make some updates takes a long time, as you can see.', 'start': 2846.944, 'duration': 6.226}, {'end': 2856.152, 'text': "But I'm going to try to update a profile picture here.", 'start': 2853.73, 'duration': 2.422}, {'end': 2860.055, 'text': 'So it looks like our profile picture updated successfully.', 'start': 2856.432, 'duration': 3.623}], 'summary': 'Successfully deleted second post and updated profile picture, emphasizing need for automated tests.', 'duration': 32.863, 'max_score': 2827.192, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2827192.jpg'}, {'end': 2917.858, 'src': 'embed', 'start': 2894.362, 'weight': 7, 'content': [{'end': 2902.968, 'text': 'Django has a deployment checklist on their website that you can look through to make sure that you did everything that you need to do when deploying applications.', 'start': 2894.362, 'duration': 8.606}, {'end': 2905.45, 'text': 'So let me actually search for this.', 'start': 2903.548, 'duration': 1.902}, {'end': 2913.175, 'text': 'So I will go to Django deployment checklist, and it should be the first result here.', 'start': 2905.51, 'duration': 7.665}, {'end': 2917.858, 'text': "Okay, so this deployment checklist, it'll kind of tell you the things that you need to do.", 'start': 2913.595, 'duration': 4.263}], 'summary': "Django's website offers a deployment checklist to ensure all necessary steps are taken when deploying applications.", 'duration': 23.496, 'max_score': 2894.362, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2894362.jpg'}, {'end': 3116.048, 'src': 'embed', 'start': 3088.058, 'weight': 8, 'content': [{'end': 3090.24, 'text': "So if that's something that you want to see, then just let me know.", 'start': 3088.058, 'duration': 2.182}, {'end': 3097.182, 'text': "Now there's also a lot more that we could learn about the Heroku platform itself and what all capabilities that are available to us.", 'start': 3090.76, 'duration': 6.422}, {'end': 3102.444, 'text': "So for example, they have a great versioning system where it's easy to roll back if you ever make a mistake.", 'start': 3097.682, 'duration': 4.762}, {'end': 3105.384, 'text': 'So for example, let me just show a quick example here.', 'start': 3103.004, 'duration': 2.38}, {'end': 3116.048, 'text': 'If I was to do Heroku and run the releases command, then this will show us all of the deployments that we made in this video.', 'start': 3105.745, 'duration': 10.303}], 'summary': 'Heroku platform offers great versioning system for easy rollbacks.', 'duration': 27.99, 'max_score': 3088.058, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc3088058.jpg'}], 'start': 2256.124, 'title': 'Configuring django for heroku deployment', 'summary': 'Covers configuring a postgres database for a django application, using a helper function to install django-heroku, updating settings.py file, deploying changes to heroku, setting up a django app on heroku, creating tables and a super user, testing the functionality of the deployed site, testing a django application including creating, updating, and deleting posts, updating a profile picture, verifying email functionality, deploying the application to heroku, and utilizing the django deployment checklist.', 'chapters': [{'end': 2461.137, 'start': 2256.124, 'title': 'Configuring postgres database and django-heroku', 'summary': 'Discusses configuring a postgres database for django application, using a helper function to install django-heroku, updating settings.py file, and deploying changes to heroku.', 'duration': 205.013, 'highlights': ['Configuring Postgres database and creating tables for Django application The chapter discusses the need to create tables in a Postgres database for a Django application.', 'Using a helper function to install Django-Heroku The transcript explains the process of using a helper function to install the Django-Heroku package using pip install.', 'Updating settings.py to import Django-Heroku module and deploying changes to Heroku The chapter details the process of importing the Django-Heroku module in the settings.py file and updating the requirements.txt file before deploying changes to Heroku.']}, {'end': 2791.468, 'start': 2461.979, 'title': 'Setting up django app on heroku', 'summary': 'Details the process of setting up a django app on heroku, including running commands to create tables and a super user, as well as testing the functionality of the deployed site.', 'duration': 329.489, 'highlights': ["Running 'python manage.py migrate' command on Heroku to create tables and confirm successful execution with green marks.", "Creating a super user on Heroku using 'python manage.py createsuperuser' command with specific username and password.", 'Accessing the deployed website via Heroku to confirm successful deployment and functionality, including logging in as a super user, accessing the admin panel, and creating a new user.']}, {'end': 3197.667, 'start': 2791.468, 'title': 'Testing and deploying django application', 'summary': "Documents the testing process for a django application, including creating, updating, and deleting posts, updating a profile picture, and verifying email functionality. it also discusses deploying the application to heroku and utilizing the django deployment checklist. additionally, it mentions future topics such as setting debug value, custom domain names, and exploring heroku's capabilities.", 'duration': 406.199, 'highlights': ['The application was successfully tested for creating, updating, and deleting posts, updating a profile picture, and verifying email functionality. The chapter describes the successful testing of various functionalities within the application, including creating, updating, and deleting posts, updating a profile picture, and verifying email functionality.', 'Deployment to Heroku was completed, and it was mentioned that Django has a deployment checklist for ensuring all necessary steps are taken. The transcript documents the deployment of the application to Heroku and highlights the availability of a deployment checklist on the Django website to ensure all necessary deployment steps are completed.', "Exploring Heroku's capabilities, including versioning system and rollback functionality, was discussed, along with the recommendation to go through Heroku's documentation to learn more. The chapter discusses the capabilities of Heroku, such as its versioning system and rollback functionality, and recommends exploring Heroku's documentation for further learning."]}], 'duration': 941.543, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6DI_7Zja8Zc/pics/6DI_7Zja8Zc2256124.jpg', 'highlights': ['Configuring Postgres database and creating tables for Django application', 'Using a helper function to install Django-Heroku package', 'Updating settings.py to import Django-Heroku module and deploying changes to Heroku', "Running 'python manage.py migrate' command on Heroku to create tables and confirm successful execution", "Creating a super user on Heroku using 'python manage.py createsuperuser' command", 'Accessing the deployed website via Heroku to confirm successful deployment and functionality', 'The application was successfully tested for creating, updating, and deleting posts, updating a profile picture, and verifying email functionality', 'Deployment to Heroku was completed, and Django has a deployment checklist for ensuring all necessary steps are taken', "Exploring Heroku's capabilities, including versioning system and rollback functionality, was discussed"]}], 'highlights': ['Heroku abstracts the setup of web servers and firewalls, making it easier to deploy applications without system administration knowledge and offers a free tier for deployment, allowing users to scale up as needed.', 'Heroku does not have a normal file system for storing images or user uploads, requiring the use of external services like Amazon Web Services and S3 buckets for such data storage.', 'The video focuses on deploying the Django application using Heroku to make it accessible over the internet, emphasizing the current limitation of the application only living on the local machine and the need for deployment for internet accessibility.', 'The chapter covers the process of setting up a Heroku account, installing Git and the Heroku CLI, and authenticating the CLI for deployment. This encompasses the main focus of the chapter, outlining the steps required for setting up Heroku deployment.', 'Heroku steers you towards best practices by using Git and version control for deployments. Highlighting the benefit of using Git and version control for deployments, emphasizing best practices.', 'Instructions for downloading Git and the Heroku CLI for Mac, Windows, or Linux are provided. Clear instructions are given for downloading Git and the Heroku CLI for various operating systems, enhancing accessibility.', 'Authentication is required through the command line to validate running commands on the Heroku account. Emphasizing the importance of authentication through the command line for running commands on the Heroku account.', "Creating a requirements.txt file to hold project dependencies. The requirements.txt file holds all the dependencies used in the application and is created by using 'pip freeze' command to list out all the pip installations and then adding the output to the requirements.txt file.", "Installing the gunicorn package for deployment. The gunicorn package is installed using 'pip install gunicorn' to be used when the application is deployed.", "Using Git for version control within the project. Git is initialized within the project by running the command 'git init', enabling version control for the application.", 'Ignoring certain files with a gitignore template. A gitignore template is used to specify files to ignore tracking with Git, such as PYC files, logs, db.sqlite file, and any machine-specific files.', 'Heroku deployment was successful after modifying settings.py to set the static root, but application error occurred when attempting to open the deployed application.', "I'm actually going to copy this template gitignore file from GitHub and use that as a starting point for my gitignore file. Now, one tip is that if you're ever copying something from GitHub, then you can just click on this raw link here, towards the top right of the page, and it will take you to just the text of the file, so that it's easier to copy and paste.", "At the top, I'm also going to add a section for Mac. And I'm going to add a file here that is . ds underscore store. And that's just an annoying file that gets created on Mac sometimes that we don't want to commit with our project as well.", 'The deployment to Heroku was successful after setting the static root in settings.py, but an application error occurred when attempting to open the deployed application.', "I'm going to create a gitignore file. So I'm going to go to a new file. And this is actually going to be a dot file. So it is dot gitignore. So don't forget the dot before gitignore. I'm going to paste in what we got from GitHub and then scroll up here to the top. So we can see that it is ignoring a lot of these different files.", 'Encountered deployment error due to missing static root setting in settings.py, leading to a failed deployment. The deployment failed initially due to the absence of the static root setting in settings.py, causing a deployment error.', 'Detailed the process of adding files to gitignore, committing changes to git, and creating a Heroku app with multiple attempts to set a unique app name. The process of adding files to gitignore, committing changes to git, and creating a Heroku app was detailed, including multiple attempts to set a unique app name.', "The chapter details the creation of a proc file to resolve the 'no web processes running' error on Heroku by explaining the necessary steps and commands.", 'The chapter explains the process of configuring Heroku deployment for a Django application, including specifying a WSGI file, creating a Procfile to define the web process, and pushing changes to Heroku.', 'Addressing security concerns by turning off debug mode and setting environment variables for debug and secret key.', 'Generating a new secret key using the Python interpreter and setting it as an environment variable.', 'Instructions for adding environment variables to the dot bash underscore profile file on a Mac.', 'Demonstration of setting environment variables for both local and Heroku deployment, including secret key, debug value, AWS credentials, and email user and password.', "Overview of Heroku database plans and limitations, including the free tier's ten thousand row limit and the option to upgrade for better performance.", 'Configuration of Postgres database for deployment, including installation of Postgres on the local machine, checking for existing database on Heroku, and creating a Postgres database if needed.', 'Instructions for opening and editing the bash profile file, including the use of the sublime command for those who have it set up on their system.', 'Suggested alternative options for individuals on different operating systems who may not be familiar with creating environment variables.', 'Configuring Postgres database and creating tables for Django application', 'Using a helper function to install Django-Heroku package', 'Updating settings.py to import Django-Heroku module and deploying changes to Heroku', "Running 'python manage.py migrate' command on Heroku to create tables and confirm successful execution", "Creating a super user on Heroku using 'python manage.py createsuperuser' command", 'Accessing the deployed website via Heroku to confirm successful deployment and functionality', 'The application was successfully tested for creating, updating, and deleting posts, updating a profile picture, and verifying email functionality', 'Deployment to Heroku was completed, and Django has a deployment checklist for ensuring all necessary steps are taken', "Exploring Heroku's capabilities, including versioning system and rollback functionality, was discussed"]}