Skip to main content

13 docs tagged with "Web Development"

View all tags

Basic Web Concepts: HTTP, URLs, and the Request/Response Cycle

Welcome to a new chapter in your Python journey! We're moving from writing command-line scripts and applications to the exciting world of web development. Before we can build web applications with Python frameworks like Flask or Django, we must first understand the fundamental concepts that power the entire internet.

Forms in Flask: Using request.form

Following our exploration of Handling HTTP Methods Using request.form. This is key to building interactive web applications that collect and process user input.

Handling HTTP Methods: GET, POST

Following our exploration of Templates in Flask (Part 2) GET, POST. This concept is essential for creating interactive web applications that can receive and process user data.

Introduction to Web Frameworks: WSGI and ASGI

In the last article, we learned about the request/response cycle that powers the web. A client sends an HTTP request, and a server sends back an HTTP response. But how does a web server (like Apache or Nginx) communicate with a Python script?

Request and Response Objects in Flask

We now know how to route a URL to a specific view function. But web development is a two-way street. Our application needs to be able to receive data from the user and send back more than just a simple string of HTML.

Routing in Flask: Variable Rules and URL Building

We've successfully created a simple Flask application that can serve a response from a single URL. But a real website has many pages: an about page, a contact page, user profiles, and so on. The system that maps URLs to the Python functions that handle them is called routing.

Templates in Flask (Part 1): Template Inheritance

We've learned how to use Flask's render_template() function to serve HTML files and pass variables to them. This is great, but as you build a website with multiple pages, you'll notice that a lot of your HTML is repetitive. The navigation bar, the footer, the `` section with all your CSS links—these are the same on every page.

Templates in Flask (Part 2): Control Structures and Filters

We've learned how to render templates and pass variables from our Flask application to our HTML. Now, let's unlock the true power of the Jinja2 templating engine by exploring two of its most important features: control structures and filters.

The What and Why of Python (Part 2)

Following our exploration of The "What" and "Why" of Python (Part 1), this article delves into Python's role in modern software development. We'll explore why Python is the go-to language for web development, data science, machine learning, and automation.

What is Flask? A Micro Web Framework

Now that we understand the basic concepts of how the web works, it's time to choose a tool to help us build web applications in Python. There are many choices, but one of the most popular, especially for beginners and for building smaller applications and APIs, is Flask.

Your First Flask App (Part 2): Templates and Jinja2

In the last article, we created our first Flask application, but our view function returned a simple string of HTML. This is not practical for building real websites. A real website has complex HTML, and we need a way to keep our Python logic separate from the presentation markup.

Your First Flask App: 'Hello, Web!' (Part 1)

With our environment set up, it's time to write our very first web application with Flask. The traditional starting point for any new programming endeavor is the "Hello, World!" application. We'll create a simple web server that, when accessed, returns that classic phrase to the user's browser.