Full stack developers are hard to find these days! You are among a tiny percentage that will stand out as a professional web developer.
As technology advances, the technological world undergoes rapid change. The days when a developer can easily keep a job with only one programming language for years without picking up new skills are long gone. Many of us enter the world of programming and web development knowing only one or two technologies, like Java, C++, or jаvascript, but that is no longer enough.
Before now, web developers used to work in groups on specialized projects, such as front-end development carried out by a different team of programmers and back-end development written by a different team of programmers, also referred to as server-side developers.
Nowadays, everyone is looking for full-stack developers, someone who is knowledgeable in both front-end and back-end technology and can work independently to develop a fully functional web application.
Two ways that people can use a computer to make websites are Django and Flask. Web developers use two different programs to create sites and web apps. These two programs are called frameworks, and they help people make fun, cool sites that look nice and run fast. Django is one of the top frameworks because it is open source and works well. But you must learn about web apps to build different web pages and website templates. You will need to create different apps from scratch to develop a single web app. The second way, Flask, is simpler and easier.
Flask is a newer framework that is easier to learn for building simple web apps. That is a lovely place to start learning web development.
That is why you should be happy that you are on this journey to learn how to build websites and web apps with Flask and Django. Two in one!
Learning a framework that complements your primary area of expertise is preferable. For example, a Python developer would learn more from Django and Flask than from Angular. Similarly, a jаvascript developer would learn React and Node JS better than Django and Node JS. This book is only for developers who are familiar with Python programming language.
The Python programming language has many advantages, one of which is a relatively quick development cycle. The career opportunities that Python as a full-stack engineer may open up for you, however, may be its best feature. Full-stack and back-end Python engineers are still needed. Python is frequently used in data science and machine learning, so as a full-stack engineer, you can add these to your repertoire of back-end skills.
Flask, Django, Turbogears, CherryPy, Pyramid, Bottle, and Falcon are just a few Python back-end frameworks. However, we'll talk about Django and Flask, the two most widely used frameworks. The developer community for the free and open-source project Django is sizable. As a result, its security, user, and role management, as well as database migration management feature, frequently improve. Additionally, RESTful Web APIs are fully supported by the REST framework in Django.
Author(s): Emenwa Global
Publisher: Emenwa Global
Year: 2022
Language: English
Pages: 280
Contents
Introduction To Full Stack Python Web Development
Full-stack development with Python
Back-end development using Python
Django
Flask
Front-end development using Python
What is Django Used For?
Part 1 Flask
Chapter 1 – Learning the Strings
The PEP Talk
PEP 8: Style Guide for Python Code
PEP 257: Docstring Conventions
Relative imports
Application Directory
Installing Python
Installing Python
Install Pip
Chapter 2 – Virtual Environments
Use virtualenv to manage your environment
Install virtualenvwrapper
Make a Virtual Environment
Installing Python Packages
Chapter 3 – Project Organisation
Patterns of organization
Initialization
Blueprints
Chapter 4 – Routing & Configuration
View decorators
Configuration
Instance folder
How to use instance folders
Secret keys
Configuring based on environment variables
Variable Rule
Chapter 5 – Build A Simple App
The actual app
Development Web Server
Chapter 6 - Dynamic Routes
Converter
Chapter 7 – Static Templates
Rendering HTML Templates
A String
render_template() function
File Structure Strategies
Module File Structure
Package File Structure
Chapter 8 - The Jinja2 Template Engine
Variables
Filters
Control structure
Conditions
loop
Chapter 9 - Bootstrap Integration with Flask
What is Bootstrap?
Getting Started
Code Flask App with Bootstrap
Create a Real Flask Website
Getting Bootsrap
Web App
Page redirect
Template inheritance
What is Template Inheritance
Adding Bootstrap
Nav bar From Bootstrap
Chapter 10 – HTTP Methods (GET/POST) & Retrieving Form Data
GET
POST
Web Forms
Login page template
Back-End
Bootstrap forms
Chapter 11 – Sessions vs. Cookies
Sessions
Sessions or Cookies?
How to set up a Session
Session Data
Session Duration
Chapter 12 – Message Flashing
flash() Function
Displaying Flash Message
Displaying More Than 1 Message
Chapter 13 – SQL Alchemy Set up & Models
Creating A Simple Profile Page
Database Management with Flask-SQL Alchemy
How to use database
Models
Chapter 14 - CRUD
The Flask Book Store
Your static web page with Flask
Handling user input in our web application
Templates
Back-end
Add a database
Front-end
Initializing
Retrieving books from our database
Updating book titles
Deleting books from our database
Chapter 15 – Deployment
Web Hosting
Amazon Web Services EC2
Heroku
Digital Ocean
Requirements for deployment
Gunicorn
Deploy!
Set up Git
Push your Site
Part 2 Django
Chapter 1 - Installing to Get Started
Introducing the Command Line
Shell Commands
Virtual Environments
Installing Django
Setup your Virtual Environment for Django on macOS/Linux
Installing Pipenv Globally
Your First Blank Django Project
Introducing Text Editors
Setting Up Django on VS Code
Lastly, Git
Chapter 2 - Create Your First Django Project
Setup
HTTP Request/Response Cycle
Model-View-Controller (MVC) and Model-View-Template (MVT)
Creating A Blank App
Designing Pages
Using Git
Chapter 3 - Django App With Pages
Setup
Adding Templates
Class and Views
Our URLs
About Page
Extending Templates
Testing
Website Production
Heroku
Let’s Deploy
Chapter 4 - Create Your First Database-Driven App And Use The Django Admin
Initial Setup
Let’s Create a Database Model
Activate the models
Django Admin
Views/Templates/URLs
Let’s Add New Posts
Tests
Storing to GitHub
Setup Heroku
Deploy to Heroku
Chapter 5 – Blog App
Initial Set Up
Database Models
Admin Access
URLs
Views
Templates
Add some Style!
Individual Blog Pages
Testing
Git
Chapter 6 – Django Web Forms
CreateView
Let Anyone Edit The Blog
Let Users Delete Posts
Testing Program
Chapter 7- User Accounts
User Login Access
Calling the User’s Name on The HomePage
User Log Out Access
Allow Users to Sign Up
Link to Sign Up
GitHub
Static Files
Time for Heroku
Deploy to Heroku
PostgreSQL vs SQLite
Conclusion
Follow-Up Actions
Third-party bundles