
Kick off the secure coding in Python Django course with an introduction that outlines the objectives, scope, and structure, setting the stage for practical secure development.
Identify the course targets—from Python developers to cybersecurity practitioners—and outline Django-focused web vulnerabilities, lab demos in Ubuntu with Kali, Docker, Python 3.x, Burp Suite, and a coffee shop Django app.
Dean Armada, a certified instructor with cybersecurity credentials, introduces secure coding in python django. He brings expertise in containers, python, and kubernetes from diverse vendor trainings.
Outline the eight-section course flow, from introduction and lab setup to Python basics, web fundamentals, and Django basics, then analyze vulnerabilities, test attacks, and secure Django deployments.
Explore a secure coding lab overview for Python Django, highlighting essential concepts and how to apply secure coding practices within Django projects.
Explore secure coding resources for Python Django by provisioning an insecure Django app and practicing vulnerability mitigation on a Kali Linux client and Ubuntu server in a private network.
Explore secure coding in Python Django through a simple topology with a Kali Linux client attacking a Django coffee shop web server, performing testing and attacks.
Download and set up the secure coding lab for Python Django by accessing the course downloads, unzip the resources, and locate slides, lab guides, Python basics, and Python scripts.
Provision Kali Linux in VMware Workstation by downloading and booting a bridged VM. Enable SSH and configure a static IP for secure remote access.
Provision ubuntu server 22.04 lts in vmware, install and configure networking, enable ssh, install docker and net-tools, and set docker group for passwordless commands.
Provision a Django coffee shop app by cloning from GitHub, provisioning with vagrant and docker, and testing access from Kali Linux to Ubuntu, including login with config.env credentials.
An overview of Python basics within secure coding for Django, equipping you to build safer web applications.
Explore Python concepts for beginners, highlighting its general purpose use in machine learning, web, desktop, mobile, and cloud automation, and compare Python 2.x and 3.x while considering cybersecurity implications.
Learn to execute Python with the dynamic interpreter shell and by running scripts via a shebang or the Python command, and use help, dir, type, and exit for guidance.
Explore strings as sequences of characters in quotes stored in Python variables. Apply operations like upper, replace, startswith, format, split, join, and f-strings for practical string handling.
Explore integer basics in Python, using numeric operators for addition, subtraction, multiplication, and division, then control decimals with round and verify integer types with the type function.
Show how to use lists in Python Django, with square brackets, nested objects, zero-based indexing, accessing values by index, handling duplicates, and measuring length with len while noting mutability.
Learn the difference between lists and tuples in Python Django, illustrating that lists are mutable and tuples immutable, with examples of item assignment errors.
Explore dictionaries as key value pair storage with colon separators and access values by keys like web one, web two, and web three, including a server list.
Practice Python basics with hands-on demos: create variables, print outputs, concatenate strings, distinguish string and integer types, format values, and run scripts with proper permissions and a shebang.
Explore Python basics by building lists and dictionaries, access values by index or key, and print data using f-strings and join with practical server and color examples.
Explore booleans and conditions in Python and Django by examining true and false, logical operators, comparisons, membership tests, and practical if statements.
Master how conditional statements in Python Django use if, elif, and else to evaluate a web_server variable and print the chosen engine X.
Learn to use for loops to print values from lists, tuples, or ranges, including index-based iterations, and contrast with while loops that run while a condition holds.
Demonstrate Python conditionals with if elif else to set a web server variable to Apache or Engine X and print it; then show a for loop printing servers and input.
Learn how to collect user input in Python 3.x with input, store it in variables, and securely handle passwords with getpass to hide input.
Define and call python functions with def, pass parameters and return values, then use if/elif/else logic, prints, and basic data structures like lists and dictionaries to process data.
Explore built-in and custom Python modules, and learn how to import, access system information with platform and os, and organize code across files.
Explore a prototype Python script flow that prompts for yes or no input, validates responses, and proceeds to a configurable block while printing output, illustrating input validation and control flow.
Create a proj1.py python script on kali linux that defines a y n function using input and if/else. Add a while loop to accept yes/no and re-prompt on invalid entries.
In project 2, initialize x at 75 and loop while x < 78, pinging 192.168.254.75, 192.168.254.76, and 192.168.254.77, printing connection status (success or failed) and incrementing x.
Build and test a Python project that pings 192.168.254.75 to 192.168.254.77 using a for loop and os.system, with single ping runs and output suppressed to /dev/null.
Discover the foundations of building secure web applications with Python Django through a concise overview of web application basics and secure coding practices.
Explore how devices communicate over a network using MAC and IP addresses, understand local area networks, NAT and DNS translation, and the client–server model with ports and web traffic.
Explore how HTTP is a TCP-based protocol on port 80 (and HTTPS on 443), powering static, dynamic, and interactive web pages via client–server interactions, DNS, URLs, and the TCP handshake.
Demonstrate http basics in a lab using a local server and browser. Edit the host file, map a hostname to an ip, and view the page source.
Explore how http operates as a connectionless protocol over tcp, where a client and server perform a three-way handshake, exchange a request and response after reestablishing connection, and remain stateless.
Observe tcpdump capturing http traffic on a linux interface, perform the tcp three-way handshake, and explain how packet-level captures hide application data while burp suite reveals http requests.
Explore the client–server model, TCP handshake, HTTP requests and responses, and the lamp stack (Linux, Apache, MySQL, PHP) for dynamic web pages.
Explore the lamp web development stack by logging into a php auction site on a Linux server, validating Apache, MySQL, and php services, and examining index.php and related web files.
Differentiate http requests from responses and summarize the start line, headers, and body, including method, path, status codes, and key headers like host and content type.
Explore http messages by inspecting request and response headers in Firefox's network tool, observe status codes like 200 and 404, and analyze with Burp Suite for debugging and security-focused testing.
Explore HTTP basics in a client–server model, covering request–response lifecycles, headers like user-agent, and common status codes such as 200, 201, 302, 304, 400, 401, 404, and 500.
Explore http request methods, including post and get, that drive login flow and how 200 and 302 status codes indicate success and redirect to the proper page.
Learn how http methods like get, post, put, and others drive web forms, how query strings and request bodies carry parameters, and how browser history reveals post vs get.
Explore web forms: text area, text, and password fields; check boxes, radio buttons, and drop down select boxes with predefined values, plus submit, reset, and hidden fields.
Analyze web forms by inspecting the form tag, inputs, and hidden fields to understand how data is sent. Compare post and get methods with concrete examples from login and search forms, including URL parameters such as q.
Explore the core concepts of Django basics to build secure Python Django web applications. Apply secure coding principles as you establish a solid foundation for Django development.
Explore Django, a free and open source Python web framework offering rapid development, security, built-in authentication and admin, and a strong community for fast deployment.
Explore Django's MTV architecture, where model handles data, template delivers presentation, and view processes requests via URL configuration, enabling rapid deployment, loose coupling, and improved security.
Install and configure Django on a fresh Ubuntu server, verify network and IP, create a Django project, run the server, adjust allowed hosts, and test from Kali Linux.
Provision a Django test server on a Ubuntu VM in VMware, configure a bridge network, install OpenSSH, set a fixed IP via netplan, and verify Python 3 availability.
Install Django on Ubuntu, verify version 3.2.12, install pip, create a main store project, run the development server, and add 192168254.88 to allowed hosts.
Explore Django’s file structure, from the root project and apps like books to core scripts such as manage.py, settings.py, and urls.py, and learn how URL routing enables admin access.
Install a GNOME desktop on an Ubuntu server and install the Sublime Text editor to explore the Django project structure.
Demonstrates running a Django project with manage.py, starting the web server, and configuring settings, databases, and urls, then creating a books app and registering it in installed apps.
Create a Django app folder with startapp, producing a books directory with views.py. Register the app in settings.py and map its URLs to expose a hello view under books.
Create a hello world view in views.py that returns an http response, then wire books.urls with include in the main urls.py and test the route.
Showcase how the Django template system separates Python code and HTML, using views.py and render to pass a context dictionary with a name variable to Hello.html for dynamic content.
Learn to create Django templates and render HTML via the render function, passing a context dictionary to display dynamic values like hello books.
Compare Django web forms URL parsing with PHP, detailing protocol, host, uri, path, and query strings. Explain get requests, parameter names, and csrf middleware token in search and product routes.
Explore how Django web forms use the post method to submit username and password to accounts/login, including csrf token management and the relevant http header details.
Explore web app vulnerabilities and attack vectors within secure coding in Python Django, and learn how to assess risks and apply mitigations in Django applications.
Compare the 2021 OWASP top ten with 2017 to assess vulnerabilities. Focus on Django security basics: injection (SQL injection and XSS), broken access control, misconfiguration, and software and data integrity.
Explore broken access control and insecure direct object references, highlighting unvalidated input, parameter tampering, forceful browsing, and path traversal.
Demonstrates insecure direct object reference (idor) in a Django app by altering primary keys in the url to access other users' data, illustrating broken access control.
Explore OWASP top eight software and data integrity failures. See how untrusted plugins, insecure ci/cd pipelines, and unsigned updates enable tampering and insecure deserialization, risking remote code execution.
Demonstrates insecure deserialization in Django, using a crafted xml payload to trigger a denial-of-service in a secure Python Django app.
Explore injection threats like SQL injection and cross-site scripting (XSS) per the OWASP top three, and how web forms and databases can be exploited.
Demonstrates SQL injection on a Django web application by exposing usernames and encrypted passwords from the auth_user table, highlighting a severe vulnerability.
Demonstrates testing cross-site scripting in a Django coffee shop app by logging in, posting a script-rich comment, and triggering a browser alert to verify vulnerability.
Explore security misconfiguration on the web server side, including unused features, insecure defaults, missing security headers, and outdated software, and learn how DOS and DDoS attacks threaten web applications.
Illustrates how a denial of service attack on a Django web application, using slow loris in Kali Linux, can render pages unresponsive by increasing socket counts.
Explore secure coding practices for Python Django and gain an overview of securing web applications with Django.
Enforce server-side access control to avert idor and replace direct ids with indirect references such as hashes, while validating input, applying csrf protection, and following secure coding practices in Django.
Explore securing against IDOR in a Django app by omitting sensitive primary keys from URLs, enforcing authentication checks, and relying on Django's built-in session security.
Prevent insecure deserialization by sanitizing XML bodies and enforcing strict format. Validate input as product with an integer value to return HTTP five error if invalid.
Secure coding in Python Django demonstrates defending a Django web application against insecure deserialization by implementing a strict policy, validating an XML post body, and returning quantity in JSON.
secure a django web application against sql injection by using orm, parameterized queries, input validation, input sanitization, stored procedures, least privilege, and up to date software.
Demonstrate securing a Django coffee shop app by replacing insecure raw sql with the orm approach using product.objects.filter and icontains. Verify the protection by restarting the container and retesting queries.
Learn to defend a django web app against cross-site scripting by validating inputs, encoding outputs, applying a content security policy, securing http-only cookies, and keeping software up to date.
Demonstrates securing a Django web app against cross-site scripting by testing for xss, removing unsafe code, and applying a content security policy to block inline scripts.
Defend web applications against ddos attacks with a multilayer approach including cdn, rate limiting, and waf. Learn to monitor traffic and harden Apache configurations, addressing slowloris techniques and ip-based limits.
Secure a Django app from DoS and DDoS by tuning Apache settings and enabling a protective module, enforcing per-IP connection limits. Restart Apache and verify improved responsiveness under simulated attack.
Wraps up the secure coding in Python Django course by reviewing Django basics, the web application lab, and web application vulnerabilities and attacks, then demonstrates securing web apps with Django.
Delve into secure coding in Python Django and map the web security landscape from defensive WAF and web defense to offensive security certifications, noting this course carries no real certification.
Complete secure coding in python django with the instructor's closing message that invites feedback and five-star ratings, promotes cloud data center and cyber security courses, social media, and YouTube channel.
Complete the secure coding in Python Django course and apply learned best practices for writing secure Django and Python applications. Review course completion takeaways and reinforce secure coding habits.
Welcome to the course on Secure Coding in Python Django!
In this course will be focusing on Web Application Vulnerabilities and Attacks/Hacking and securing in Python Django Framework. The approach of this course is to learn Web Technologies, Learn the basics of Python, Django and web vulnerabilities based on OWASP Top 10! The course consist of whiteboarding discussions and lots of hands-on lab demonstrations. The lab includes Kali Linux which is attackers and target websites that we will hack.
Python Django is a popular web framework used for developing web applications. With its user-friendly syntax and efficient architecture, it has become a preferred choice for many developers. However, as the number of web-based attacks and data breaches increases, it has become increasingly important to develop applications with security in mind.
This course is designed to help you develop secure coding practices while working with Python Django. Throughout this course, you will learn about the most common security vulnerabilities that web applications face and how to protect against them. You will also learn about various security features in Django and how to use them effectively.
Whether you are a beginner or an experienced Python developer, this course will provide you with the knowledge and skills to develop secure web applications using Python Django. So, get ready to dive deep into the world of secure coding and protect your applications from potential attacks.
Target Audience
Python Programmers (Aspiring)
Web App Django Specialist
Web App Penetration Testers
Cyber Security Practitioner
Expectations
Will cover basic Python
Will cover basic HTTP
Will cover basic Django
Will cover basic web attacks
You won’t become a professional Hacker
Need to learn many things
Software Technologies
Ubuntu Server (Django)
Kali Linux Client/Attacker
Docker
Python 3.X
Main Web Applications – Coffee Shop (Django)
Testing Web Applications – PHP Hack-it Auction (LAMP)
Sections
Introduction
Secure Coding in Python Lab
Python Basics
Web Application Basics
Django Basics
Web App Vulnerabilities and Attacks
Securing Web App using Django
Completion