
Explore a project-based Python Django course that guides you from setup to building a real estate web app with listings and inquiries, deploying to Digital Ocean with Gunicorn and Nginx.
Demonstrates a Django app with front end and admin, Postgres data, listings and realtors, search and filters, pagination, lightbox, and seller of the month.
Explore how Django, a high level Python web framework, enables fast, secure development with structured projects and apps, built-in authentication and admin, and flexible database options.
install python 3 on mac, verify version with python --version, download from python.org, use the installer with pip enabled, run python3, and start creating .py files before moving to Django.
Install Python 3 on Windows by downloading the latest from python.org, running the installer, and adding Python to your path; verify with python --version and explore a short shell session.
Set up Visual Studio Code and the Python sandbox, install the Python extension, and configure linting and the Python interpreter to run Python 3 files for future Django work.
Learn Python fundamentals by defining variables and exploring data types such as int, float, string, and bool. Practice casting, comments, and basic output with print and type checks.
Learn to create and concatenate strings in Python, format output with .format and f-strings (Python 3.6+), and apply common string methods like capitalize, upper, and replace.
Explore Python lists as ordered, mutable collections that allow duplicates, and learn common operations such as indexing, getting length, appending, removing, inserting, popping, reversing, and sorting.
Explore Python tuples and sets, focusing on their ordered, unchangeable nature, how they handle duplicates, and common operations such as indexing, length, add, remove, clear, and membership checks.
Learn Python dictionaries: create, access with brackets or get, add and remove keys, copy, clear, and view keys and items, plus handling lists of dictionaries.
Learn how to define functions in Python using def, indentation, and colons; pass parameters with defaults, return values, and understand doc strings, scope, and lambda equivalents.
Explore Python conditionals, including if, else, and elif, with comparison, logical, membership, and identity operators. Learn basic syntax, indentation, and how to structure nested and combined conditions in simple examples.
Learn Python loops by iterating over lists and other sequences with for loops, using break and continue, and applying range and while loops for controlled repetition in Django development.
Import core modules like date time, install Django with pip, and camel case. Practice from time import time and from validator import validate_email to show direct imports.
Explore Python classes as blueprints for creating objects with properties and methods, using self in an initializer, and extending via inheritance to build a customer class with balance.
Demonstrate Python file operations by creating, writing, appending, and reading text files, and closing them, using modes like w, a, and r to manage content.
Learn how to parse json in python using json.loads to convert json strings to dictionaries and json.dumps to convert dictionaries to json, illustrated with user data and a car dictionary.
Build a client-ready real estate app with an admin to manage listings, realtors, and inquiries, using the BT E Resources assets, with searchable listings and listing lightbox.
Explore using a bootstrap theme in a Django project, customizing with Sass to match branding colors, and building dynamic templates with Jinja, a lightbox two image gallery, and admin-driven listings.
Create and activate a Python virtual environment with venv to isolate project dependencies, ensuring the project runs Python and pip inside the venv before installing Django.
Activate a virtual environment, install Django, start a beta project with manage.py to run migrations and create a superuser, and initialize a git repository with a gitignore from gitignore.io.
Run the Django development server and explore the initial project files, including settings, urls, and wsgi, while understanding SQLite databases, migrations, and basic app structure for deployment readiness.
Create the pages app in Django to manage home and about pages, wiring views and urls, and optionally surface listings and realtors data from other apps.
Configure Django to locate templates and render pages. Create a base.html layout with blocks and extends for home and about templates.
Configure django static files by creating a static folder in the beta project, moving css, js, fonts, and images there, using collectstatic, and ignoring static and media in git.
Learn how to integrate a Bootstrap theme with Django by wiring static files, updating base HTML with static tags, and refactoring nav, top bar, and footer into reusable partials.
Learn to structure a Django app's front end by building a base template, loading static assets, wiring index and about pages, and dynamically highlighting nav links with template conditionals.
Create listings and realtors apps in Django, wire templates and urls for index, listing, and search views, update settings, and integrate navigation with the listings page.
Install Postgres and PgAdmin to configure a Django database, leverage the ORM instead of raw SQL, create beta database, set a password, and prepare to switch from SQLite to Postgres.
configure a Django app to use Postgres by installing psycopg2 drivers, updating settings with database credentials, and running migrations to create auth user and related tables.
Map out your database schema before coding by designing three tables: listing, realtor, and contact, defining fields, defaults, and foreign key relationships for Django models.
Create a Django listing model linked to a realtor via a foreign key, with fields for title, address, price, bedrooms, bathrooms, photos, and a listing date, then migrate.
Create a realtor model linked to listings via a foreign key with fields for name, photo, description, phone, email, is MVP, hire date. Run makemigrations and migrate to create tables.
Master the Django admin by creating a superuser and registering listing and realtor models in admin.py, enabling streamlined management, login control, and customizable admin interfaces.
Configure the Django media folder, define media URL and root, wire static in urls. Add realtors and listings data, and view uploaded photos stored in media/photos by year/month/day.
Customize the django admin by replacing the default branding with a logo, applying a branded color scheme via admin.css, and extending the base site template to reflect the course branding.
customize the Django admin to display listings and realtors with list_display, list_display_links, list_filter, search_fields, and list_per_page settings for efficient management.
Fetch all listings from the database with the Django model, pass them as context, and loop through them in the template to render dynamic front end listings.
Turn the listings template into dynamic content by looping through listings and displaying title, image, price with comma formatting, address, square footage, bedrooms, bathrooms, realtor name, and time since listing.
Implement pagination for property listings in Django using a paginator, request page, and bootstrap-styled controls, while ordering by descending date and filtering to only show published items.
Learn to render dynamic home and about pages in Django by listing the latest published items, displaying realtors and the seller of the month, and wiring the single listing view.
Build a dynamic Django single listing page by fetching a listing with get_object_or_404, passing it to a template, and rendering title, price, photos, and realtor details with conditional image blocks.
Explore building dynamic search filters in a django app by moving option data into python dictionaries, passing them via context, and looping to render state, bedroom, and price choices.
Learn to implement dynamic search filters for listings in Django by building a query set, then applying keywords, city, state, bedrooms, and price filters via get request.
preserve search inputs by passing the get request into the template context and binding value attributes and selected options for keywords, city, state, bedrooms, and price.
Build a Django accounts app to register, log in, and access a simple dashboard using Django’s built-in auth user model, with login.html, register.html, and dashboard.html templates and routes.
Learn to set up Django templates for register and login, extend base.html, and configure forms to post to accounts/register with csrf token, handling get vs post in views.
Configure Django's messages framework to display bootstrap alerts via a partial; map levels to bootstrap classes, render in templates, and use messages in views for form errors.
Register new users by validating a post form, ensuring passwords match and that usernames or emails are unique, then create the user with Django's user model and redirect to login.
Implement user login in Django by extracting username and password from the login form, authenticating with the authenticate method, and redirecting to the dashboard, with invalid credentials error handling.
Configure the navbar to show dashboard and a post logout form for authenticated users, using CSRF protection and a welcome message, with alerts for login status in Django templates.
Implement dynamic page titles in a Django app by adding a title block to the base template and rendering dynamic listing titles.
Create a django contacts app, define a Contact model with listing, listing_id, name, email, phone, message, and contact_date fields, and set up migrations and admin registration.
Configure the Django admin for the contacts model by creating a custom admin class, registering the model, and setting list displays, search fields, and pagination, while prepping the inquiry form.
Build a Django inquiry form in listing templates, posting to contact url with csrf protection, include hidden user, listing, and realtor fields, and prefill name and email for authenticated users.
Handle a Django contact form submission by validating post requests, capturing fields from request.POST (listing id, name, email, message), and redirecting to the correct listing, with feedback messaging.
Check authenticated users for duplicate inquiries on a listing and show an error; then send a property listing inquiry email to the realtor and a test address using Django's send_mail.
Turn a static dashboard into a dynamic, user-specific view by querying the contact model for the logged-in user and rendering each listing via a for loop in dashboard.html.
Push your django project to github, then deploy on a digital ocean droplet by configuring ubuntu, postgres, gunicorn, and nginx, using git and ssh keys for secure access.
Set up a Digital Ocean droplet on Ubuntu 18.04 for Django deployment. Generate an ssh key pair, add the public key to Digital Ocean, and log in securely via ssh.
Secure a Django server by creating a dedicated admin user with sudo privileges, configuring SSH keys, disabling root login, and enabling a basic UFW firewall.
Log in as Django admin on droplet, update packages, install python3, postgresql, nginx, and gunicorn, then create postgres database and user, and set up a virtual environment under pi apps.
Create and activate a python virtual environment in the pie apps directory, install dependencies from a requirements.txt, and deploy by cloning the repository with Git.
Implement local_settings.py on the production server, import it in settings.py with a safe ImportError fallback, and manage git pushes, production database, and port 8000 for deployment.
Run migrations to create Postgres tables, create a super user, and collect static files, then test with runserver before moving to gunicorn and nginx for production.
Install Gunicorn via Pip, add it to requirements.txt, and run your Django app on port 8000. Then configure nginx to proxy to Gunicorn on port 80.
Configure nginx with a port 80 server block, serve static and media, proxy to gunicorn, enable site, set debug false in local_settings.py, and raise client max body size to 20m.
Configure the domain with an A record to the Digital Ocean droplet IP and a CNAME for www, update allowed hosts and Nginx, then restart Nginx and Gunicorn to verify.
This is a very practical course where we take a list of requirements from a fictional company to build a real estate application using Django. We will take a basic html/css Bootstrap 4 theme and turn it into a real working application with an admin area to manage resources including property listings, realtors and contact inquiries. We also have a section on learning basic Python syntax
What You Will Learn:
Basic Python (lists, dictionaries, functions, conditionals, etc)
Setup Virtual Environments
Install & configure Django
Create Django "apps"
Postgres Setup (local and remote)
Schema planning, models & migration
Admin customization
Bootstrap integration
Full search functionality
User Authentication
Deploy to Digital Ocean with Gunicorn & Nginx