HTML (Hypertext Markup Language) is the standard markup language for creating web pages. It defines the structure and content of a web page using a system of tags and attributes.
- HTML Document Structure: An HTML document consists of a
<!DOCTYPE>,<html>,<head>(with<title>), and<body>sections. - Elements and Tags: HTML elements are represented by tags (e.g.,
<p>,<a>,<div>). - Attributes: Elements can have attributes (e.g.,
href,src,class) that provide additional information. - Text Content: You can add text content using elements like
<p>,<h1>,<span>, etc. - Links: Create hyperlinks using the
<a>tag with thehrefattribute. - Images: Embed images using the
<img>tag with thesrcattribute. - Lists: Create ordered
<ol>or unordered<ul>lists with<li>items. - Forms: Build forms for user input.
- Form Elements: Common form elements include
<input>,<textarea>,<select>, and<button>. - Form Attributes: Attributes like
action,method, andnamedefine form behavior. - Input Types: Different
typeattributes (e.g.,text,password,checkbox) for<input>elements.
- Form Elements: Common form elements include
Python is a high-level, versatile programming language known for its simplicity and readability.
- Syntax: Python uses indentation (whitespace) for code blocks.
- Variables: Declare variables with
variable_name = <some value>where<some value>can be another variable or any of the python data types. - Data Types: Common types include booleans, integers, floats, strings, lists, and dictionaries.
- Operators: Arithmetic (
+,-,*,/), comparison (==,!=,<,>), and logical (and,or,not) operators. - Control Structures: Use
if,elif,elsefor conditional logic andforandwhileloops for iteration. - Range: range() function generates a sequence of numbers
- Functions: Define reusable code blocks using the
defkeyword. Functions can be defined with parameters that get passed in as arguments when the function is called/invoked in a program. - Lists: 0 based index ordered, mutable (changeable) collections of items.
- Dictionaries: Collections of key-value pairs.
- Modules and Libraries: Import and use external code with
import. Can be third-party packages installed withpipor modules that you create yourself. - Exception Handling: Handle errors with
tryandexcept. - Built-in methods: Lots of built in methods like
str,int,len,sum, and so on.
Object-oriented programming (OOP) allows you to define classes and create objects with shared attributes and methods.
- Classes: Define classes with attributes (variables) and methods (functions).
- Objects: Create objects (instances) of classes.
- Constructor (
__init__): Initialize object attributes. - Inheritance: Create new classes that inherit attributes and methods from existing classes.
- Superclass and Subclass: The parent class is a superclass, and the child class is a subclass.
Django is a high-level Python web framework for building web applications efficiently.
- MVT Architecture: Django follows the Model-View-Template (MVT) architectural pattern.
- Django ORM: Object-Relational Mapping for database interactions.
- Django Admin: Built-in admin interface for managing application data.
- Django Templates: HTML templates for rendering views.
- URL Routing: Define URL patterns to route requests to views.
- Django Models: Define data models using Python classes.
- Django Views: Create views to handle HTTP requests and return responses.
- Django Templates: Render dynamic content using Django template language.
- Forms: Generate and process HTML forms with Django forms.
- Foreign Key and One-to-Many Relationships: Establish relationships between models.