
Build a weather app with Python and Django that fetches air quality data from a third-party API and shows a score with color-coded categories for a zip code.
Check out my student Facebook Group...
It's a great place to get fast support for this course from me, to interact with other students, to post your projects and code, and to access course announcements and extras...
Join Now!
https://www.facebook.com/groups/codemycom/
Download and install Python on Windows, ensure add Python to path during installation, select the 32-bit version, and follow the prompts to complete setup.
Install Sublime Text and Git Bash terminal to set up your development environment for building a weather app with Python and Django.
Set up a Python virtual environment to isolate Django dependencies, activate it across platforms, and verify installations with pip freeze as you prepare to install Django in the next video.
Install Django in a virtual environment, create a weather project with django-admin startproject weather, and run the server with python manage.py runserver to see your first Django project.
Django has updated to version 3.0 since this course was released. You can use the latest version of Django with no problems in this course.
Set up the Django admin area by creating a superuser, applying migrations, and logging in to manage users and backend data.
Create a django app called look up using python manage.py startapp, add it to settings.py installed apps, and set up the app's urls to integrate with the project.
Edit django urls.py by importing path and include, add a lookup.urls inclusion, and prepare to create the first page in the next video.
Learn how to build a Django page by wiring URLs, creating a templates directory with HTML files, and writing views that render templates with the request context.
Use a base.html template to centralize header and footer across pages. Extend base.html in each page and define a block content to pull in page-specific content, so changes reflect site-wide.
Learn to install the Bootstrap CSS framework using a starter template, paste it into the base template, and use a container div to improve layout, then reload to see changes.
Add a bootstrap navbar by copying code from bootstrap docs into the base HTML. Switch navbar to dark and secondary colors, and rename links to weather app and about page.
Utilize Django links to auto update site-wide links when URL patterns change by referencing named URLs from urls.py in templates.
Explore version control fundamentals with Git. Initialize repositories, configure user details, stage and commit changes with descriptive messages, and prepare for pushing to GitHub.
Learn to set up Git version control, generate SSH keys, add them to GitHub, create repositories, and push commits from the command line.
Introduce the Air Now API for current ozone air quality, show color-coded readings, and guide signing up for an API key to access web services.
Learn to build a zip code query URL to fetch current air quality index in JSON, using an API key, and display AQI and category on the app home page.
Connect to the API by importing json and requests, install the package, and fetch data into a Django view; parse with json loads and render it on the homepage.
Learn to parse a Python list of dictionaries from an API, extract the AQI value, area, and category name, and handle varying API formats for clean data display.
Learn to implement quick error handling for API calls in the home view of a weather app, including checking API existence, handling errors, and displaying user-friendly messages.
Learn how to enhance a weather app interface by using a Bootstrap jumbotron to display current Las Vegas air quality, with planned color coding and descriptive thresholds.
Learn to map air quality categories to descriptive messages (satisfactory to hazardous) using Python conditionals and HTML, including proper handling of 'unhealthy for sensitive groups'.
Create css classes for the jumbotron—good, moderate, unhealthy, very unhealthy, and hazardous—in a style block near the head, using hex colors, then apply and test.
Pass the category description and color into the Jumbotron div by refactoring the Django view to Python, moving code from the template into the view context.
Set up the Django form to post to the home URL by adding a CSRF token and using the post method, and name the input zip code for backend handling.
Learn to handle Django forms in the home view by distinguishing get and post requests, capture the zip code from the form, and render updated air quality data.
Enter a zip code to look up air quality on the map, and observe the color change to yellow as the value hits moderate in Saint Louis and Kirkwood.
Gain lifetime access to over 60 coding courses, including Python and Django, with a three-day $200 discount. Access the book library, certificates, and member support focused on course content.
Django and Python can seem overwhelming at first, but they don't have to be! In this course I’ll walk you through it step by step and you’ll be building your first web app in MINUTES. You’ll be amazed how quick and easy it is to create very professional looking websites, even if you have no programming or web design experience at all.
Watch over my shoulder as I build a cool Air Quality Weather app step by step right in front of you. You’ll follow along and build your own copy. By the time we’re finished, you’ll have a solid understanding of Django and how to use it to build awesome web apps.
The course contains 28 videos – and is just over 2 hours long. Watch the videos at your own pace, and post questions along the way if you get stuck. You don’t need any special knowledge or software to take this course, though any experience with HTML or CSS is a plus. You don’t even need to know the Python programming language. I’ll walk you through EVERYTHING.
Django is a great web development tool and learning it has never been this easy.
What We'll Build...
We'll build a cool Air Quality Weather app that let's you connect to a third party API to collect Air Quality information about your area!
We'll style the website using the popular Bootstrap CSS framework (I'll show you how to use it!)
Sign up today and I'll see you on the inside!