100% found this document useful (1 vote)
17 views

Python Flask And Django Full Stack Python For Web Development Build Web Applications In Python Using Flask And Django Frameworks Emenwa Global download

The document is a comprehensive guide on full-stack web development using Python frameworks Flask and Django. It covers essential topics such as project organization, routing, database management, and deployment, along with practical examples and exercises. The book aims to equip readers with the skills to create dynamic web applications and emphasizes the importance of full-stack development in today's job market.

Uploaded by

brihmtubil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
17 views

Python Flask And Django Full Stack Python For Web Development Build Web Applications In Python Using Flask And Django Frameworks Emenwa Global download

The document is a comprehensive guide on full-stack web development using Python frameworks Flask and Django. It covers essential topics such as project organization, routing, database management, and deployment, along with practical examples and exercises. The book aims to equip readers with the skills to create dynamic web applications and emphasizes the importance of full-stack development in today's job market.

Uploaded by

brihmtubil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

Python Flask And Django Full Stack Python For

Web Development Build Web Applications In Python


Using Flask And Django Frameworks Emenwa Global
download
https://ebookbell.com/product/python-flask-and-django-full-stack-
python-for-web-development-build-web-applications-in-python-
using-flask-and-django-frameworks-emenwa-global-49118646

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Foundation Dynamic Web Pages With Python Create Dynamic Web Pages With
Django And Flask 1st Ed David Ashley

https://ebookbell.com/product/foundation-dynamic-web-pages-with-
python-create-dynamic-web-pages-with-django-and-flask-1st-ed-david-
ashley-22417576

Python Programming Blueprints Build Nine Projects By Leveraging


Powerful Frameworks Such As Flask Nameko And Django Daniel Furtado
Marcus Pennington

https://ebookbell.com/product/python-programming-blueprints-build-
nine-projects-by-leveraging-powerful-frameworks-such-as-flask-nameko-
and-django-daniel-furtado-marcus-pennington-46502508

Handson Python Deep Learning For The Web Integrating Neural Network
Architectures To Build Smart Web Apps With Flask Django And Tensorflow
Anubhav Singh

https://ebookbell.com/product/handson-python-deep-learning-for-the-
web-integrating-neural-network-architectures-to-build-smart-web-apps-
with-flask-django-and-tensorflow-anubhav-singh-11117144

Ai Web Chatbot From Scratch With Python Flask And Tensorflow Build
Intelligent Web Chatbots With Python Flask And Tensorflow Jahani

https://ebookbell.com/product/ai-web-chatbot-from-scratch-with-python-
flask-and-tensorflow-build-intelligent-web-chatbots-with-python-flask-
and-tensorflow-jahani-59480516
Building Web Apps With Python And Flask Learn To Develop And Deploy
Responsive Restful Web Applications Using Flask Framework English
Edition Malhar Lathkar

https://ebookbell.com/product/building-web-apps-with-python-and-flask-
learn-to-develop-and-deploy-responsive-restful-web-applications-using-
flask-framework-english-edition-malhar-lathkar-34605194

The Wellgrounded Python Developer How The Pros Use Python And Flask
Doug Farrell

https://ebookbell.com/product/the-wellgrounded-python-developer-how-
the-pros-use-python-and-flask-doug-farrell-232365054

Practical Python Backend Programming Build Flask And Fastapi


Applications Asynchronous Programming Tim Peters

https://ebookbell.com/product/practical-python-backend-programming-
build-flask-and-fastapi-applications-asynchronous-programming-tim-
peters-57128208

Python To Be Dangerous Software Development Flask Web Apps And


Beginning Data Science With Python 1st Edition Michael Hartl

https://ebookbell.com/product/python-to-be-dangerous-software-
development-flask-web-apps-and-beginning-data-science-with-python-1st-
edition-michael-hartl-110719966

Microservice Apis Using Python Flask Fastapi Openapi And More 1st
Edition Jos Haro Peralta

https://ebookbell.com/product/microservice-apis-using-python-flask-
fastapi-openapi-and-more-1st-edition-jos-haro-peralta-47399612
Python
Flask & Django

Full Stack Python for Web


Development
www.emenwa.com
Contents

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

INTRODUCTION TO FULL STACK PYTHON WEB


DEVELOPMENT
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 JavaScript, 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 JavaScript 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.

Full-stack development with Python


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.
Back-end development using Python
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.
Django
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.

Flask
Another well-liked Python web framework is Flask. It's referred to as a
micro-framework and is lighter than Django. The back end of APIs is
frequently developed using Flask. The Flask community has lots of pluggable
features available.

Front-end development using Python


Python front-end development is still in its infancy in comparison to back-
end development. Because of this, the front-end typically uses HTML,
JavaScript, and CSS. In this course, you will learn how to implement
Bootstrap with Django and Flask to create a beautiful front-end interface.
The first part of this book focuses on the Flask framework, and the latter part
discusses Django. We hope you find it interesting.
Typically, it should not take you more than a few weeks at most to learn
Flask and start to develop apps. However, that depends on your other
commitments and reasons for learning.
This book is divided into short chapters, which are isolated lessons. Many
teachers would write their books and tutorials as a long lesson where they
create an example app and update it throughout the book to demonstrate
concepts and tasks. That is not the case here. In this book, we include
examples in each lesson to illustrate the concepts, but we have examples from
other chapters that may not even be related to the previous. Hence, the book
is not meant to be combined into one large project.
This book will help you learn Flask by building a series of projects and
showing you verifiable screenshots so that you can use the skills to create
different projects with Flask. Please, as you read this book, I recommend
opening your computer and implementing the codes as we go. The lessons in
this book will help you create a web application on your own.
The second part of this book is for Django. Django is exciting if you are
interested in building websites. Django is a framework for making websites.
It saves you a lot of time and makes building websites easier and more fun.
Django makes it easy to build and maintain high-quality web applications.
Web development is a creative journey, fun-filled and full of adventure, with
enough stress to last a day! Django lets you focus on your web application's
fun and critical parts while making the tedious parts easier. In other words, it
makes it easier to create common programming tasks and abstract common
web development patterns. It also gives clear rules for how to solve
problems. It does all these things and allows you to work outside the
framework's scope when needed. My goal with this book is to help you learn
and master Django. I want you to go as far as you possibly want to go in and
understand the Django web framework.

What is Django Used For?


Django's ORM layer is powerful. It speeds up development by streamlining
data and database management. Without ORM, web developers would have
to form tabular displays and explain operations or queries, resulting in a large
amount of SQL that is difficult to track.

Its models are all in one file, unlike other web frameworks. In larger projects,
models.py may be slow.

Django supports multiple databases.


SQLite can be used for development and testing without additional software.
Production databases are PostgreSQL or MYSQL.
For a NoSQL database, use MongoDB with Django.

In this book, you will walk with me as we create really awesome web
development projects, CRUD (wiki style) blogs, and so on. The best way to
learn is by doing. So, follow along on your computer as you read the steps
and keep up with me. You don’t have to cram every step. You will always
have this book as a reference. Follow me.
PART 1 FLASK
CHAPTER 1 – LEARNING THE STRINGS
Assuming that you are an intelligent programmer, you must identify and use
specific terms and conventions that guide the format of Python codes. You
might even know some of these conventions. This chapter discusses them. It
will be brief.

The PEP Talk


A PEP is an abbreviation for "Python Enhancement Proposal." Python.org
indexes and hosts these proposals. PEPs are classified into several categories
in the index, including meta-PEPs, which are more informative than
technical. On the other hand, technical PEPs analyze enhancements to
Python's internals.
PEPs such as PEP 8 and PEP 257 guide how we write our code. Guidelines
for coding style are included in PEP 8. PEP 257 specifies procedures for
docstrings, the widely used method of documenting code.
PEP 8: Style Guide for Python Code
Python code should follow PEP 8 as the coding style. This is like a format for
writing Python programs. You can read about it if you want.
When your code grows to multiple files with hundreds or thousands of lines
of code, PEP 8 style will make it much more readable. Furthermore, if your
project will be open source, potential contributors will likely expect and feel
at ease working with code written with PEP 8 in mind.
One crucial suggestion is to use four spaces per indentation level. Not tabs. If
you violate this convention, switching between projects will be difficult for
you and other developers. Inconsistency like this is annoying in any
language. Because that indented space is vital in Python, switching between
tabs and spaces could result in errors that are difficult to debug.
PEP 257: Docstring Conventions
Another Python standard is covered by PEP 257, and it is called docstrings.
A docstring is a string literal that appears as the first statement in the
definition of a module, function, class, or method. A docstring of this type
becomes the object's __doc__ unique attribute.
Relative imports
When developing Flask apps, relative imports make things a little easier. The
idea is straightforward.
For example, if you are developing an app and need to import User model
from myapp/models.py module. You might use the app's package name, such
as myapp.models. This would indicate the location of the target module
relative to the source using relative imports. We use a dot notation instead of
a slash, with the first dot representing the current directory and each
subsequent dot representing the following parent directory.
# myapp/views.py

# An absolute import gives us the User model


from myapp.models import User

# A relative import does the same thing


from .models import User

This method makes the package much more modular, which is a good thing.
Now you can change the name of your package and use modules from other
projects without changing the import statements.

In summary, what will help you advance in your development journey is to


follow the style used in this book,
follow the coding style shown in PEP 8,
use docstrings defined in PEP 257 to document your app,
import internal modules with relative imports.

Application Directory
I assume you are new to Flask, but you can use Python. Otherwise, I highly
recommend starting your journey by learning Python basics.
Anyway, open your Python text editor or IDE and let us start. The first task is
to create a folder where your project will sit. I use Visual Studio Code.
Open the Terminal, and type in the following code:
mkdir microblog

That will create the folder. Now cd into your new folder with cd microblog.

Installing Python
Install Python if you don't already have it on your computer. It is possible to
download an installer for Python from the official website if your operating
system does not include a package. Please keep in mind that if you're using
WSL or Cygwin on Windows, you won't be able to use the Windows native
Python; instead, you'll need to download a Unix-friendly version from
Ubuntu or Cygwin, depending on your choice.

Installing Python
First, go to Python’s official website and download the software. It is pretty
straightforward. Now, after downloading, run the program.
When installing, click on Customise, and you can check these boxes. Most
significantly, pip and py launcher. You may leave out the “for all users” if the
computer is not yours.
Click on next. Check Add Python to environment variables,” and install.
Install Pip
Pip is a Python package manager that will be used to add modules and
libraries to our environments.
To see if Pip is installed, open a command prompt by pressing Win+R, typing
"cmd," and pressing Enter. Then type "pip help."
You should see a list of commands, including one called "install," which we'll
use in the next step:

It's time for Flask to be installed, but first, I'd like to talk about the best
practices for installing Python packages.
Flask, for example, is a Python package available in a public repository and
can be downloaded and installed by anyone. PyPI (Python Package Index) is
the name of the official Python package repository (some people also refer to
this repository as the "cheese shop"). A tool called pip makes it easy to install
a package from the PyPI repository.
You can use pip to install a program on your computer as follows:
pip install <package-name>

Unfortunately, this method of installing packages does not work in


many cases. To run the command above, you'll need to be an administrator on
your computer, which means you'll need to be logged in as an administrator.
Even if you don't have to deal with that, think about what happens when you
do the installation described above. The package will be downloaded from
PyPI and added to your Python installation using the pip command-line tool.
After that, all your Python scripts can access the package you just installed.
Suppose you've finished a web application using Flask version 1.1, which
was the most current version of Flask when you started but has since been
replaced by Flask version 2.0. You'd like to use the 2.0 version for a second
application, but if you replace the 1.1 version you already have installed, you
could end up causing problems for your older application. Do you see what
I'm getting at? It would be ideal if Flask 1.1 and Flask 2.0 could coexist on
the same computer. Flask 1.1 will work as a backend for your older
application, and the newer app will have the current version at the time.
Python uses virtual environments to deal with the issue of maintaining
various versions of packages for various applications. That is what we will
discuss in the next chapter.
CHAPTER 2 – VIRTUAL ENVIRONMENTS
You can install more software now that the application directory has been
configured. For your app to function correctly, you will require various
software. You must first have at least the Flask package, and the Python
installed. If not, you might be reading the incorrect book. The environment
for your program is everything that must be accessible for it to run. There are
numerous things we can do to set up and maintain the environment for our
app. This chapter is focused on that.
When installing packages privately without impacting the Python interpreter
that is already installed on your system, you can do so in a virtual
environment, which is a duplicate of the Python interpreter.
Virtual environments are highly useful because they prevent the system's
Python interpreter from becoming clogged with mismatched packages and
versions. You may make sure that applications only have access to the
packages they require by setting up a virtual environment for each project.
This allows you to create more virtual environments and keeps the global
interpreter clean. Additionally, since virtual environments may be created and
operated without administrator privileges, they are superior to the system-
wide Python interpreter.

Use virtualenv to manage your environment


virtualenv is a program that isolates whatever application you are developing
in a virtual environment. A virtual environment implies that all the software
your program depends on is stored in a single folder. This means that the
software is only usable by your application.
The Python interpreter is a type of virtual environment (a copy). Installing
packages in a virtual environment has no impact on the Python interpreter
used by the entire system. Only the copy is. As a result, creating a separate
virtual machine just for each application is the best way to ensure you can
install any version of your packages. Additionally, virtual environments do
not require an administrator account because they are owned by the user who
creates them.
Instead of using system-wide or user-wide package directories, we can
download them to a separate, dedicated folder for our application. For each
project, we can choose the version of Python we want to use and which
dependencies we want to have available.
It's possible to switch between various versions of the same package with
Virtualenv. This kind of scalability can be crucial when working on an older
system with multiple projects requiring different software versions.
As a result of using virtualenv, you'll be limited to a small number of Python
packages on your machine. Virtualenv will be one of these. Pip may be used
to install virtualenv.
Virtual environments can be created as soon as virtualenv is installed on your
computer. Run the virtualenv command in your project's directory to get
started. The virtual environment's destination directory is the only parameter
required.
pip install virtualenv

Now that we've installed virtualenv, we can make different environments to


test our code. But it can be hard to keep track of all of these places. So we'll
pip install another package that will help us.

Install virtualenvwrapper
virtualenvwrapper is a package that lets you control the virtual environments
that virtualenv makes. Use the following line to install the virtual wrapper for
our Flask projects.
pip install virtualenvwrapper-win

Make a Virtual Environment


The structure of the command that makes a virtual environment looks like
this:
python -m venv virtual-environment-name

The -m venv suggestion launches the venv package from the source file as a
standalone script with the name given as an argument.
Inside the microblog directory, you will now make a virtual environment.
Most people call virtual environments "venv," but you can call them
something else if you'd like. Make sure that microblog is your current
directory, and then run this command:
python3 -m venv venv

(you can use any name different from venv)


After the command is done, you'll have a subdirectory called venv (or, like
mine, blog inside the microblog folder. This subdirectory will have a brand-
new virtual environment with a Python interpreter for this project only.

Now, activate the virtual environment by using the following line:


blog\Scripts\activate

Once done with activating the virtual environment, You’ll see “(blog)” next
to the command prompt. The line has made a folder with python.exe, pip, and
setuptools already installed and ready to go. It will also turn on the Virtual
Environment, as shown by the (blog).
The PATH environment variable is updated to include the newly enabled
virtual environment when you activate it. A path to an executable file can be
specified in this variable. When you run the activation command, the name of
the virtual environment will be appended to the command prompt as a visual
cue that the environment is now active.
After a virtual environment has been activated, the virtual environment will
be used whenever python is typed at the command prompt. Multiple
command prompt windows necessitate individual activation of the virtual
environment.

Installing Python Packages


All virtual environments have the pip package manager, which is used to
install Python packages. Similar to the python command, entering pip at a
command prompt will launch the version of this program that is a part of the
active virtual environment.
Make sure the virtual environment is active before running the following
command in order to install Flask into it:
pip install flask

When you run this prompt, pip will install Flask, and every software Flask
needs to work. You can check the packages installed in your virtual
environment using pip freeze. Type the following command:

Type deactivate at the command prompt to return your Terminal's PATH


environment variable and the command prompt to their default states once
you've finished working in the virtual environment.
Each installed package's version number is shown in the output of pip freeze.
Most likely, the version numbers you get will be different from those shown
here.
You can also make sure Flask was installed correctly by starting Python and
trying to import it:

If there
are no errors, you can give yourself a pat on the back. You are ready to move
on to the next level.
CHAPTER 3 – PROJECT ORGANISATION
Flask doesn't help you to organize your app files. All of your application's
code should be contained in a single folder, or it could be distributed among
numerous packages. You may streamline developing and deploying software
by following a few organizational patterns.
We'll use different words in this chapter, so let's look at some of them.
Repository - This is the folder for your program on the server. Version
control systems are typically used to refer to this word.
Package: This is a Python library that holds the code for your application.
Creating a package for your project will be covered in greater detail later in
this chapter, so just know that it is a subdirectory of your repository.
Module: A module is one Python file that other Python files can import. A
package is nothing more than a collection of related modules.

Patterns of organization
Most Flask examples will have all the code in a single file, usually called
app.py. This works well for small projects with a limited number of routes
and fewer than a few hundred lines of application code, such as those used
for tutorials.

When you're working on a project that's a little more complicated, a single


module can get cluttered. Classes for models and forms must be defined, and
they will be mixed in with the script for your routes and configuration. All of
this can slow down progress. To solve this problem, we can separate the
different parts of our app into a set of modules that work together. This is
called a package.
This listing's structure lets you group the different parts of your application in
a way that makes sense. Model class definitions are grouped together in
models. The definitions of routes and forms are in views.py. and forms.py,
respectively (we have a whole chapter for forms later).
This table gives a breakdown of the parts included in the majority of Flask
projects. You will likely have many additional files in your repository, typical
of Flask apps.
This file is executed to launch a
development server. It obtains a copy
of the application from the package
run.py and runs it. This will not be used in
production but is heavily utilized
throughout the development phase.
This file lists all Python packages on
which your application depends. You
requirements.txt can have different files for
development and production
dependencies.
This file contains most of the
config.py variables your project needs for
configuration.
This file includes configuration
variables that should not be tracked
by version control. This includes API
keys and database URIs with
embedded passwords. Additionally,
this contains variables unique to this
/instance/config.py instance of your program. For
example, you may have DEBUG =
False in config.py but DEBUG =
True in instance/config.py on your
local development system. Because
this file will be read after config.py,
DEBUG = True.
This is the package that contains your
/yourapp/ application.
This file initializes your application
/yourapp/__init__.py and assembles its diverse
components.
This is where route definitions are
made. It may be separated into its
/yourapp/views.py package (yourapp/views/), with
related views organized into
modules.
This is where you define the
application's models. Similar to
/yourapp/models.py views.py, this may be separated into
many modules.py.
This directory contains the public
CSS, JavaScript, images and other
/yourapp/static/ files you want to make public via
your app. It is accessible from
yourapp.com/static/ by default.
This is where you’ll put the Jinja2
/yourapp/templates/ templates for your app.

Initialization
All Flask applications need to create an application instance. Using a protocol
called WSGI, pronounced "wiz-ghee", the web server sends all requests from
clients to this object so that it can handle them. The application instance is an
object of the class Flask. Objects of this class are usually made in this way:
from flask import Flask

app = Flask(__name__)

The only thing that has to be given to the Flask class constructor is the name
of the application's main module or package. Most of the time, the __name__
variable in Python is the correct answer for this argument.
New Flask developers often get confused by the __name__ argument passed
to the application constructor. Flask uses this argument to figure out where
the application is, which lets it find other files that make up the application,
like images and templates.

Blueprints
At some time, you may discover that there are numerous interconnected
routes. If you're like me, your initial inclination will be to divide opinions. Py
into a package and organize the views as modules. It may be time at this
stage to incorporate your application into blueprints.
Blueprints are essentially self-contained definitions of your application's
components. They function as apps within your app. The admin panel, front-
end, and user dashboard may each have their own blueprint. This allows you
to group views, static files, and templates by component while allowing these
components to share models, forms, and other features of your application.
Soon, we will discuss how to organize your application using Blueprints.
CHAPTER 4 – ROUTING & CONFIGURATION
Web applications that run on web browsers send requests to the web server to
the Flask application instance. For each URL request, the Flask application
instance needs to know the code to execute, so it keeps a map of URLs to
Python functions. A route is a link between a URL and the function that calls
it.
Modern web frameworks employ routing to aid users in remembering
application URLs. It is useful to be able to browse directly to the required
page without first visiting the homepage.
The Python programming language has them built in. Decorators are often
used to sign up functions as handler functions that will be called when certain
events happen.
The app.route decorator made available by the application instance is the
easiest way to define a route in a Flask application. This decorator is used to
declare a route in the following way:
@app.route("/")
def index():
return "<h1>Hello World!</h1>"

In the previous example, the handler for the application's root URL is set to
be the function index(). Flask prefers to register view functions with the app.
route decorator. However, the app.add_url_rule() method is a more traditional
way to set up the application routes. It takes three arguments: the URL, the
endpoint name, and the view function. Using the app.add_url_rule(), the
following example registers an index() function that is the same as the one
shown above:
def index():
return "<h1>Hello World!</h1>"

app.add_url_rule("/", "index", index)

Similar to index(), view functions manage application URLs. Going to


http://www.example.com/ in your browser would cause the server to run
index if the app runs on a server with the domain name www.example.com
(). This view function's return value is the response the client receives. This
answer is the page displayed to the user in the browser window if the client is
a web browser. As we'll see later, a response from a view function could be
as straightforward as an HTML string, or it might be more intricate.
You'll notice that many of the URLs for services you use on a daily basis
have sections that can be modified if you pay attention to how they are
constructed. For instance, https://www.facebook.com/your-name> is the URL
for your Facebook profile page. Your username is a part of this, making it
particular to you. Flask can handle these URLs using a special app.route
decorator. The steps to configure a route with an active portion are as
follows:
@app.route("/user/<name>")
def user(name):
return "<h1>Hello, {}!</h1>".format(name)

The portion of a URL for a route that is enclosed in angle brackets changes.
Any URLs that match the static portions will be mapped to this route, and the
active part will be supplied as an argument when the view function is called.
In the preceding illustration, a personalized greeting was provided in
response using the name argument.
The active components of routes can be of other kinds in addition to strings,
which are their default. If the id dynamic segment has an integer, for
example, the route /user/int:id> would only match URLs like /user/123.
Routes of the types string, int, float, and path are all supported by Flask. The
path type is a string type that can contain forward slashes, making it distinct
from other string types.

URL routing is used to link a specific function (with web page content) to its
corresponding web page URL.
When an endpoint is reached, the web page will display the message, which
is the output of the function associated with the URL endpoint via the route.

View decorators
Decorators in Python are functions used to tweak other functions. When a
function that has been decorated is called, the decorator is instead invoked.
The decorator may then perform an action, modify the parameters, pause
execution, or call the original function. You can use decorators to encapsulate
views with code to be executed before their execution.

Configuration
When learning Flask, configuration appears straightforward. Simply define
some variables in config.py, and everything will function properly. This
simplicity begins to diminish while managing settings for a production
application. You might need to secure private API keys or utilize different
setups for various environments. For example, you need a different
environment for production.
This chapter will cover advanced Flask capabilities that make configuration
management easier.
A basic application might not require these complex features. It may be
just enough to place config.py at the repository's root and load it in app.py or
yourapp/__init__.py.
Each line of the config.py file should contain a variable assignment. The
variables in config.py are used to configure Flask and its extensions, which
are accessible via the app.config dictionary — for example,
app.config["DEBUG"].
DEBUG = True # Turns on debugging features in Flask
BCRYPT_LOG_ROUNDS = 12 # Configuration for the Flask-Bcrypt extension
MAIL_FROM_EMAIL = "[email protected]" # For use in application emails

Flask, extensions, and you may utilize configuration variables. In this


example, we may use an app.config["MAIL_FROM_EMAIL"] to specify the
default "from" address for transactional emails, such as password resets.
Putting this information into a configuration variable makes future
modifications simple.

Instance folder
Occasionally, you may be required to define configuration variables
containing sensitive information. These variables will need to be separated
from those in config.py and kept outside of the repository. You may hide
secrets such as database passwords and API credentials or setting machine-
specific variables. To facilitate this, Flask provides us with the instance folder
functionality. The instance folder is a subdirectory of the repository's root
directory and contains an application-specific configuration file. We do not
wish to add it under version control.

How to use instance folders


If you want to load configuration variables from an instance folder, you can
use the function app.config.from_pyfile(). First, set the
instance_relative_config = True when creating your app with the Flask()
function. The app.config.from_pyfile() will load the file from the instance/
folder.
# app.py or app/__init__.py

app = Flask(__name__, instance_relative_config=True)


app.config.from_object("config")
app.config.from_pyfile("config.py")
Now, instance/config.py can contain variable definitions identical to those in
config.py. Additionally, you should add the instance folder to the ignore list
of your version control system. To accomplish this with Git, add instance/ to
a new line in.gitignore.

Secret keys
The instance folder's private nature makes it an ideal location for establishing
keys that should not be exposed to version control. These may include your
application's private or third-party API keys. This is particularly crucial if
your program is open source or maybe in the future. We generally prefer that
other users and contributors use their own keys.
# instance/config.py

SECRET_KEY = "Sm9obiBTY2hyb20ga2lja3MgYXNz"
STRIPE_API_KEY = "SmFjb2IgS2FwbGFuLU1vc3MgaXMgYSBoZXJv"
SQLALCHEMY_DATABASE_URI = (
"postgresql://user:TWljaGHFgiBCYXJ0b3N6a2lld2ljeiEh@localhost/databasename"
)

Configuring based on environment variables


Don’t add the instance folder under version control. This means you cannot
trace configuration changes to the config setup in your instance. If you have
one or two variables, this may be overlooked. Still, you don't want to risk
losing precisely calibrated setups for different environments (production,
staging, development, etc.).
Upon load, Flask gives us the option to choose a configuration file based on
the value of an environment variable. As a result, we can store different
configuration files in our repository and load the appropriate ones as needed.
Once a large number of configuration files have been produced, we can move
them into the appropriate configuration directory.
We'll take advantage of the app.config.from envvar() function to figure out
which configuration file to import.

# yourapp/__init__.py
app = Flask(__name__, instance_relative_config=True)

# Load the default configuration


app.config.from_object("config.default")

# Load the configuration from the instance folder


app.config.from_pyfile("config.py")

# Load the file specified by the APP_CONFIG_FILE environment variable


# Variables defined here will override those in the default configuration
app.config.from_envvar("APP_CONFIG_FILE")

Variable Rule
App routing is the process of mapping a certain URL to the function designed
to complete a given action. The most recent Web frameworks employ routing
to aid users in remembering application URLs.
To hard-code each URL while creating an application is pretty inconvenient.
Creating dynamic URLs is a better way to handle this problem.
Using variable elements in the rule parameter allows you to create URLs on
the fly. Variable-name> is the name of this variable component. It is passed
as a parameter to the function that corresponds to the rule.
Let's examine the idea of variable rules in great detail.
Dynamic URLs can be created with the use of variable rules. They are
essentially the variable sections added to a URL using the variable name> or
converter: variable name> tags. It is passed as a parameter to the function that
corresponds to the rule.
Syntax:
@app.route('hello/<variable_name>')
OR
@app.route('hello/<converter: variable_name>')
CHAPTER 5 – BUILD A SIMPLE APP
You've understood the various parts and configurations of a Flask web
application in the previous sections. Now it's time to write your first one. In
the example below, the application script defines an application instance, a
single route, and a single view function, as we've already said.
I'll be using Visual Studio Code, which has installed the Python extension.
The first step is to create a project folder. Mine is firstapp. Name yours
whatever.

After you have cd that folder, create a virtual environment. I will name mine
envi.
python -m venv envi

Now, type code in the Terminal, and run. Visual Studio Code will open in a
new window. Now, open the app folder in the new window like this:
Next, open the Command Palette. Go to View and click on Command Palette
(or press Ctrl+Shift+P). Select Python: Select the Interpreter command.
This means you want to see interpreters that are available to VS can locate.
Here's mine.
Go to the Command Pallete again and search Terminal. Click on Terminal:
Create New Terminal (SHIFT + CTRL + `)

Can you see the name of your virtual environment at the bottom left corner?
Mine has the "envi" as the name of my virtual environment.
Now that the Virtual environment is active, install Flask in the virtual
environment by running pip install flask in the Terminal.
When you start a separate command prompt, run envi\Scripts\activate to
activate the environment. It should begin with (envi), indicating that it is
engaged.

The actual app


Now, we will create a new file named app.py inside the firstapp folder.

In app.py, we will add a code to import Flask and construct a Flask object
instance. This object will serve as the WSGI application.
from flask import Flask

app = Flask(__name__)

We will now call the new application object's run () function to run the main
app.
if __name__ == "__main__":
app.run()
We develop a view function for our app to display something in the browser
window. We will construct a method named hello() that returns "Hello,
World!
def hello():
return "Hello World!";

Now, let us assign a URL route so that the new Flask app will know when to
call the hello() view function. We associate the URL route with each view
function. This is done with the route() decorator in front of each view
function like this.
@app.route("/")
def hello():
return "Hello World!"

The complete app.py script is like this:


from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
return "Hello World!"

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=3000)

Development Web Server


Using the flask run command, you can start a development web server for
Flask applications. This command looks in the FLASK_APP environment
variable for the name of the Python script that includes the application
instance.
To run the app.py application, first, make sure the virtual environment you
set up earlier is running, and that Flask is installed in it.
python -m flask run

When the server fires up, it goes into a loop that receives requests and
handles them. This loop will keep going until you press Ctrl+C to stop the
program.
Open your web browser and type http://localhost:5000/ in the url bar while
the server is running. The screenshot below shows what you'll see once
you're connected to the app.

Now that is the base url we set a route to. Adding anything else to the URL
will mean that your app won't know how to handle it and will send an error
code 404 to the browser.
The app.run() method can also be used to programmatically start the Flask
development web server. In older Flask versions that didn't have the flask
command, the server had to be started by running the application's main
script, which had to end with the following code:
if __name__ == "__main__":
app.run()

This is no longer necessary because of the flask run command. However, the
app.run() function can still be helpful in some situations, such as unit testing.
CHAPTER 6 - DYNAMIC ROUTES
Let's now consider an alternative routing method. The next illustration
demonstrates how an alternative implementation of the program adds a
second, dynamic route. Your name appears as a customized greeting when
you visit the active URL in your browser.
In this chapter, I will describe variable rules, converters, and an example of
dynamic routing.
We've discussed routes, views, and static routing when the route decorator's
rule parameter was a string.
@app.route("/about")
def learn():
return "Flask for web developers!"

If you want to use dynamic routing, the rule argument will not be a constant
string like the /about. Instead, it is a variable rule you passed to the route().
We have learned about Variable Rules. However, read through this script to
better get a glimpse of the variable rule:
"""An application to show Variable Rules in Routing"""
from flask import Flask

app = Flask(__name__)

@app.route("/")
def home():
"""View for the Home page of your website."""
return "This is your homepage :)"

@app.route("/<your_name>")
def greetings(your_name):
"""View function to greet the user by name."""
return "Welcome " + your_name + "!"

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=3000)
This is the result:

What happens if you add /name?

Like magic! How can you do this? Pretty easy. Follow me.
The first thing you will find different in the new code is the second view
function, greetings (). There is the variable rule: /<your_name>.
That means the variable is your_name (whatever you type after the /). We
then pass this variable as a parameter to the greetings() function. That is why
it is called to return a greeting to whatever name is passed to it. Facebook is
not that sleek now, is it?

Converter
The above example used the URL to extract the variable your_name. Flask
now converted that variable into a string and passed it to the greetings()
function. That is how converters work.
Here are the data types Flask converters can convert:
Strings: this goes without saying
int: they convert this only for when you pass in positive integers
float: also only works for positive floats
path: this means strings with slashes
uuid: UUID strings means Universally Unique Identifier strings used
for identifying information that needs to be unique within a system or
network.
Let us learn about another feature for web apps.
CHAPTER 7 – STATIC TEMPLATES
This chapter will teach you how to create and implement static and HTML
templates. You will also learn file structure strategies.
Clean and well-structured code is essential for developing apps that are
simple to maintain. Flask view functions have two different jobs, and this can
cause confusion.
As we can see, a view function's one obvious purpose is to respond to a
request from a web browser. The status of the application, as determined by
the view function, can also be altered by request.
Imagine a user signing up for the first time on your website. Before clicking
the Submit button, he fills up an online form with his email address and
password.
The view method, which manages registration requests, receives Flask's
request on the server containing the user's data. The view function interacts
with the database to add the new user and provide a response to display in the
browser. These two responsibilities are formally referred to as business logic
and presentation logic, respectively.
Complex code is produced when business and presentation logic are
combined. Imagine having to combine data from a database with the required
HTML string literals in order to create the HTML code for a large table. The
application's maintainability is improved by placing presentation logic in
templates.
That is why a template is necessary. A template is a file that contains
placeholder variables for the dynamic parts of a response that are only known
in relation to a request's context. The process known as rendering is what
gives variables their real-world values in exchange for the final response
string. Flask renders templates using the powerful Jinja2 template engine.

Rendering HTML Templates


Flask expects to find template files in the leading application directory's
templates subfolder. These templates are actually HTML files.
Flask can render HTML using two methods:
as string
using render_template function

A String
You can use HTML as a string for the function.
Here is an example:
from flask import Flask

app = Flask(__name__)

@app.route("/")
def home():
return "<h1>There's Something About Flask!</h1>"

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=3000)

When you run that and follow your local host link, this is what you get:

This came out well as a template because we use HTML tags h1. We can use
any HTML codes in the scripts, and Flask will read it well.
render_template() function
Now, the string is suitable for simple one-page websites. For big applications,
you must add your templates as separate files.
In this case, you create the HTML code and keep the file separate in the
folder. You will then call the file in the views function by the file names.
Flask will use the render_template() function to render the HTML templates.
This function uses the following parameters:
template_name_or_list: that is the template file name or names if they
are more than one
context: these are variables that are in the template script.
The render_template() returns the output using the view instead of a string.
Here is an example:
def view_name():
return render_template(template_name)

In this case, we would already have a template saved, perhaps as home.html


or index.html, with the HTML code in it. When you run the app, Flask will
run all the HTML codes included in the script, and the view will display them
on the web browser.

File Structure Strategies


When you run the program, Flask will execute the script and run through
your \templates folder to find the HTML files you reference in the script. You
must place the folder correctly so that there will be no errors. These are the
correct file structures that Flask can read:
Module File Structure
This is a very simple and straightforward structure where all the application
logic is in a single .py file. The templates folder will be the same folder as the
.py file where the developer keeps the HTML files.
Package File Structure
In many complex apps, the script is divided into separate .py files. In this
case, you must present all the .py files in the same package. A package is a
folder that contains an __init__.py file.
You must create the templates folder in the main application package to use
this structure in your application.

So, let us do it together. First, know what we want to do: we want to render a
home.html template with the render_template() function in our web app,
app.py.
You will create a templates folder and then create a file inside the new folder
and call it home.html.
Fill home.html with this code:
<!DOCTYPE html>
<html>
<h1>This is where we say FLASK! :)</h1>

</html>

Now, we can change our app.py code to call the HTML code.
from flask import Flask, render_template

app = Flask(__name__)

@app.route("/")
def home():
return render_template("home.html")

if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=3000)

Look at the result!


CHAPTER 8 - THE JINJA2 TEMPLATE ENGINE
Jinja2 is a Python template engine. It can be used instead of Python's standard
string interpolation, that is, adding data to strings. Flask can easily read Jinja2
templates, which is easier to write than the typical Python code. Jinja2
templates have a more natural language format.
Jinja2 templates are written in HTML or XML and then turned into "jinja"
bytecode, which the Jinja environment can read and use. The python
compiler module turns the templates into bytecode, which is then run by an
interpreter that parses and runs jinja scripts built from HTML or XML
templates.
Templates are files that contain both static and dynamic data placeholders. To
create a finished document, a template is rendered with precise data. The
Jinja template library is used by Flask to render templates. Templates will be
used in your application to render HTML shown in the user's browser.
We have to place the template file in the templates folder. The templates are
in the root folder of the project.
For example, we can have our home.html to be:
<!DOCTYPE html>
<html>
{% raw %}
<h1>Hello {{ name }} </h1>
{% endraw %}
<h1>This is where we say FLASK! :)</h1>

</html>

We will now write the view function as the following code:


@app.route("/user/<name>")
def index(name):
return render_template("home.html", name=name)

The Jinja2 template engine is built into the application by the Flask function
render_template(). The template's filename is the first argument to the
render_template() function. The rest of the arguments are key-value pairs that
show the real values of the variables in the template.

Variables
A template file is just a normal text file. The part to be replaced is marked
with double curly brackets ({{ }} ), in which the variable name to be replaced
is written. This variable supports basic data types, lists, dictionaries, objects,
and tuples. The same as in template.html:
{% raw %}

<p> A value form a string: {{ name }}. </p>


<p> A value form a int: {{ myindex }}. </p>
<p> A value form a list: {{ myindex }}.
<p> A value form a list: {{ mylist[3]] }}. </p>
<p> A value form a list: {{ mylist[3] }}.</p>
<p> A value form a list, with a variable index: {{ mylist[myindex] }}. </p>
<p> A value form a dictionary: {{ mydict['key'] }}. </p>
<p> A value form a dictionary: {{ mydict['key'] }}.
<p> A value form a tuple: {{ mytuple }}. </p>
<p> A value form a tuple: {{ mytuple }}.</p>
<p> A value form a tuple by index: {{ mytuple[myindex] }}. </p>

{% endraw %}

Filters
As you write your apps, you may want to change some parts of your values in
the template when they come on. For example, you may set the code to
capitalize the first letter in a string, remove spaces, etc. In Flask, one way to
do this is by using a filter.
Filters in the Jinjia2 template engine work like pipes in Linux commands. For
example, they can capitalize the first letter of a string variable.
{% raw %}

<h1>{{ name | capitalize}}</h1>

{% endraw %}

Both filters and the Linux pipeline command can be spliced. For example,
you can splice a line to do two things at the same time. Let us write a line to
capitalize values and take out whitespace before and after.
{% raw %}

<h1>{{ name | upper | trim }}</h1>

{% endraw %}

As you see in the code, we connected the filter and the variable with the pipe
symbol |. That is the same as processing the variable value.
Here are some standard filters web developers use:
filter description
safe rendering is not escaped
capitalize initial capitalization
lower all letters lowercase
upper all letters uppercase
title Capitalize the first letter of each word in the value
trim removes the first blank character
stripttags removes all HTML tags from the value when rendering

Control structure
Jinja2 has a number of control structures that can be used to change how the
template is run. This section goes over some of the most useful ones and
shows you how to use them.
Many times, a smarter template rendering is needed, which means being able
to program the rendering, such as having a style for boys and the same style
for girls. Control structure instructions need to be specified with command
markers, and some simple control structures are explained below.
Random documents with unrelated
content Scribd suggests to you:
me very much. The sooner you read them, the sooner I shall be relieved, if I
am to be relieved. If it would not trouble you too much to go over them to-
night?”
“My dear Clare, of course I will read them directly if you wish it,” said
Edgar, half-provoked. “You have but to say so. Of course, nothing troubles
me that you wish. I sent down to ask after poor little Jeanie this morning,”
he added, after a pause, falling into his usual tone; “and the doctor says she
has had a tolerably good night. I must go and see Miss Somers after church.
She will have learned all about it by this time, and that story about Arthur
Arden and the Pimpernels. Miss Pimpernel, I told you, was thrown out of
the carriage as well as Jeanie——”
“I think you told me,” said Clare faintly. “I know so little about Miss
Pimpernel; and I do not like that other girl. It may be prejudice, but I don’t
like her. I wish you would not talk of her to me.”
Edgar looked up at his sister with grave wonder—“As you please,” he
said seriously, but his cheek flushed, half with anger, half with
disappointment. What could have happened to Clare? She was not like
herself. She scarcely looked at him even when she spoke. She was
constrained and cold as if he were the merest stranger. She had again
avoided his kiss, and never addressed him by his name. What could it
mean? Scarcely anything more was said at breakfast. Clare could not open
her lips, and Edgar was annoyed, and did not. It seemed so very mysterious
to him. He was indeed as nearly angry as it was in his nature to be. It
seemed to him a mere freak of temper—an ebullition of pride. And he was
so entirely innocent in respect to Jeanie! The child herself was so innocent.
Poor little Jeanie!—he thought of her with additional tenderness as he
looked at his sister’s unsympathetic face.
“I suppose we may walk together to church as usual,” he said. It was the
only remark that had broken the silence for nearly half an hour.
“If you have no objection”—said Clare formally, with something of that
aggravating submission which wives sometimes show to their husbands,
driving them frantic, “I think I shall drive—but not if you object to the
horses being taken out.”
“Why should I object?” he said, restraining himself with an effort,
“except that I am very sorry not to have your company, Clare.”
Then she wavered once more, feeling the empire of old affection steal
over her. But he had turned away to the window, grieved and impatient. It
was like a conjugal quarrel, not like the frank differences between brother
and sister. And this was not how Clare’s temper had ever shown itself
before. Edgar left the table, with a sense of pain and disappointment which
it was very hard to bear. Why was it? What had he done? His heart was so
open to her, he was so full of confidence in her, and admiration for her, that
the check he had thus received was doubly hard. His sister had always been
to him the first among women. Gussy of course was different—but Gussy
had never taken the same place in his respect and admiring enthusiasm.
Clare had been to him, barring a few faults which were but as specks on an
angel’s wing, the first of created things; and it hurt him that she should thus
turn from him, and expel him, as it were, from her sympathies. He stood
uncertain at the window, not knowing whether he should make another
attempt to win her back; but when he turned round he found, to his
astonishment, that she was gone. How strange—how very strange it was. As
she had abandoned him, he saw no advantage in waiting. He could go and
ask for Jeanie, and see how things were going on, at least, if he was not
required here. He gave Wilkins orders about the carriage with a sigh. “My
sister proposes to drive,” he said; and as he said it he looked out upon the
lovely summer Sunday morning, and the wonder of it struck him more than
ever. She had liked to walk with him down the leafy avenue, under the
protecting shadows, when he came home first, and now she changed her
habits to avoid him. What could it mean? Could this, too, be Arthur Arden’s
fault?
Thus it was that Edgar left the house so early, ill at ease. His sister
thought that probably the effect of her constraint and withdrawal of
sympathy would be that, tracing her changed demeanour to its right cause,
he would hasten to read the packet she had given him. But Edgar never
thought of the packet. It did not occur to him that a parcel of old letters
could have anything to do with this most present and painful estrangement.
While he went out, poor fellow, with his heart full of pain, Clare looked at
him from the window with anger and astonishment. What did he care?
Perhaps he had known it all along—perhaps he was a conscious—— But
no, no. Not till the last moment—not till evidence was before her which she
could not resist—would she believe that. So the carriage came round, and
she was driven to church in solitary state—sometimes excusing, sometimes
condemning herself. It was a thing which happened so rarely that the village
folks were in a state of commotion. Miss Arden was ill, they thought—
nothing else could explain it; and so thought the kind old Rector and even
Dr. Somers, who knew, or thought he knew, better than any of the others. As
for Arthur Arden, who had gone to church with the hope of being invited by
Edgar to accompany him home, he was in despair.
Edgar, for his part, walked down very gloomily through the village to
ask for Jeanie, and had his news confirmed that she had spent a tolerably
good night. “But in a dead faint all the time,” said Mrs. Hesketh, who had
taken the place of nurse. “She breathes, poor dear, and her heart it do beat.
But she don’t know none of us, nor open her eyes. It’s awful to see one as is
living, and yet dead. T’ou’d dame, she never leaves her, not since she was
a-talking to you, sir, last night.”
“Could I see her now?” said Edgar; but Mrs. Hesketh shook her head;
and he could not tell why he wanted to see her, except as some relief to the
painful dulness which had come over him. The next best thing he could do
seemed to be to walk to the Red House, and ask after Alice Pimpernel.
There he found no lack of response. Mr. Pimpernel himself came out, and
so did Mrs. Pimpernel, with profuse and eager thanks. “If it had not been
for you Mr. Arden, my child might have perished,” said the mother. “No,
no, not so bad as that,” Edgar could not but say with surprise. “And the
person who was most to blame never even gave himself the trouble to
inquire till all was over,” the lady added with a look of rage. They wanted to
detain him, to give him breakfast, to secure his company for Mr. Pimpernel,
who was going to drive to church with the younger children. But Edgar did
not desire to join this procession, and suffer himself to be paraded as his
cousin’s successor. Somehow the village and everything in it seemed to
have changed its aspect. He thought the people looked coldly at him—he
felt annoyed and discouraged, he could not tell why. It seemed to him as if
the Thornleighs would not come, or coming, would hear bad accounts of
him, and that he would be abandoned by all his friends. And he did not
know why, that was the worst of it; there seemed no reason. He was just the
same as he had been when Clare received him as her dearest brother. What
had happened since to change her mind towards him he was totally unable
to tell. The sourd and obscure atmosphere of family discord was quite novel
to Edgar. For most of his existence he had known nothing about family life;
and then it had seemed to him so warm, so sweet, so bright. The domestic
life, the warm sense of kindred about him had been his chief attraction to
Gussy. His heart was so full, he wanted sisters and brothers and quantities
of kinsfolk. And now the discovery that those good things could bring pain
as well as pleasure confused him utterly. Clare! his only sister, the sole
creature who belonged to him, whom nature gave him to love, to think that
without a cause she should be estranged from him! When he fairly
contemplated the idea, he gave himself, as it were spiritually, a shake, and
smiled. “It takes two to make a quarrel,” he said to himself, and resolved
that it was impossible, and could not last another hour.
CHAPTER V.
Mr. Fielding preached one of his gentle little sermons upon love to your
neighbour on that especial morning. The Doctor had been quiet, and had not
bothered the Rector for some time back. There had been a good deal of
sickness at the other end of the parish, and his hands had been full. It was a
sermon which the Arden folks had heard a good many times before; but
there are some things which, like wine, improve in flavour the longer that
they are kept. Mr. Fielding produced it about once in five years, and
preached it with little illustrations added on, drawn from his own gentle
experience. And each time it was better than the last. The good people did
not remember it, having listened always with a certain amount of distraction
and slumberousness; but Dr. Somers did, and had noted in his pocket-book
the times he had heard it. “Very good, with that story about John Styles in
the appendix,” was one note; and four or five years later it occurred again
thus—“Little sketch of last row with me put in as an illustration—John
Styles much softened; always very good.” Next time it was—“John Styles
disappeared altogether—quarrel with me going out—old Simon in the
foreground; better than ever.” The Arden folks were not alert enough in
their minds to discern this; but the gentle discourse did them good all the
same.
And there in front of him, listening to him, in the Arden pew, were three
who needed Mr. Fielding’s sermon. First, Clare, pale with that wrath and
distrust which takes all happiness out of a woman’s face, and almost all
beauty. Then, sitting next to her, with a great gap between, now and then
looking wistfully at her, now casting a hasty glance to his other side—
anxious, suspicious, watchful—Arthur Arden, at the very lowest ebb, as he
thought, of his fortunes. He had been as good as turned out of the Red
House. He had no invitation nearer than the end of August. Clare had
passed him at the church door with a bow that chilled him. Edgar, coming
in late, had taken scarcely any notice of him. Nothing could appear less
hopeful than his plan of getting himself invited once more to Arden,
covering the Pimpernels with confusion, and showing publicly his
superiority over them. Alas! he would not look superior, he could not be
happy in the Arden Arms. Accordingly he sat, anxious about his cousins,
hating all the world besides. Could he have crushed Mrs. Pimpernel by a
sudden blow he would have done it. Could he have swept Jeanie out of his
way he would have done it. Even underneath his anxiety for their favour, a
bitter germ of envy and indignation was springing up in his heart towards
his kinsfolk, Edgar and Clare.
And next to him sat Edgar, whose heart was heavy with that sense of
discord—the first he had ever known. He had not been the sort of man with
whom people quarrel. If any of his former comrades had been out of temper
with him, it had been but for a moment—and he had no other relation to
quarrel with. The sense of being at variance with his sister hung over him
like a cloud. Edgar was the only one to whom the Rector’s gentle sermon
did any good. He was guiltless in his quarrel, and therefore he had no
amour-propre concerned, no necessity laid upon him to justify himself. He
was quite ready to say that he was wrong if that would please any one; yes,
no doubt he had been wrong; most people were wrong; he was ready to
confess anything. And though he was not a very close listener generally to
Mr. Fielding’s sermons, he took in this one into his heart. And the summer
air, too, stole into his heart; and the faint fragrance of things outside that
breathed in through the open door, and even the faint mouldy flavour of age
and damp which was within. The little village church, when he looked
round it, filled him with a strange emotion. What was it to others? What
was it to himself? A little break in life—a pause bidding the sleepy peasant
rest in the quiet, dropping warm langour on the eyelids of the children,
giving to the old a slumberous pensiveness. He saw them softly striving to
keep themselves awake—sometimes yielding to the drowsy influence—
sometimes open-eyed, listening or not listening—silent between life and
death. Such sweet, full, abounding life outside; hum of insects, flutter of
leaves, soft, all-pervading fragrance of summer roses. And within, the
monuments on the wall glimmering white; the white head in the pulpit; the
shadowy, quiet, restful place where grandsires had dozed and dreamed
before. What an Elysium it was to some of those weary, hardworking old
bodies! Edgar looked out upon them from the stage-box in which he sat
with a thrill of tender kindness. To himself it might have been a mental and
spiritual rest before the agitations of the next week. But something had
disturbed that and made it impossible. Something! That meant Clare.
When they all left the church Arthur Arden made a bold stroke. “I will
walk up with you to the Hall if you will let me,” he said. Clare was within
hearing, and she could not restrain a slight start and tremor, which he saw.
Was she afraid of him? Did she wish him to come or to stay away? But
Clare never turned round or gave the slightest indication of her feelings.
She walked out steadily, saying a word here and there to the village people
who stood by as she passed to the carriage, which was waiting for her at the
gate.
“I am going to see Miss Somers,” said Edgar, “and Clare is driving—but
if you choose to wait——”
It was not a very warm invitation, but Arden accepted it. He wished the
Pimpernels to see him with his cousin. This much of feeling remained in
him. He would have been mortified had he supposed that they knew he was
only at the Arden Arms. He would go to the Doctor’s house with Edgar, and
declared himself quite ready to wait. “I don’t think Miss Somers likes me,
or I should go with you,” he said, and then he went boldly up to Mr.
Pimpernel and asked for his daughter. “I am sorry I had to leave so
abruptly,” he said, “but I could not help myself,” and he gave his shoulders
a shrug, and looked compassionately with a half smile at the master of the
Red House.
“Yes,” said Mr. Pimpernel, accepting the tacit criticism with a certain
cleverness. “Mrs. Pimpernel expresses herself strongly sometimes. Alice is
better. Oh, yes! It was an affair of scratches only—though for a time I was
in great fear.”
“I never was so afraid in my life,” said Arthur, and he shuddered at the
thought, which his companion thought a piece of acting, though it was
perfectly genuine and true.
“You did not show it much,” he said, shrugging his shoulders in his turn,
“at least so far as we were concerned. But, however, that is your affair.”
And with a nod which was not very civil he called his flock round him, and
drove away. Arthur followed Edgar to the Doctor’s open door. He went into
the Doctor’s sacred study, and took refuge there. Dr. Somers did not like
him he was aware; but still he did not hesitate to put himself into the
Doctor’s easy chair. Why didn’t people like him? It was confounded bad
taste on their part!
In the meantime Edgar had gone up stairs, where Miss Somers awaited
him anxiously. “Oh, my dear Edgar,” she said, “what a sad, sad—— Do you
think she will never get better? My brother always says to me—— but then,
you know, this isn’t asking about nothing—it’s asking about Jeanie. And
Alice, whose fault it was—— Oh Edgar, isn’t it just the way of the world?
The innocent little thing, you know—and then the one that was really to
blame escaping—it is just the way of the world.”
“Then, it is a very disagreeable way,” said Edgar. “I wish poor little
Jeanie could have escaped, though I don’t wish any harm to Miss
Pimpernel.”
“No, my dear,” said Miss Somers; “fancy my calling you ‘my dear,’ as if
you were my own sister! Do you know I begin now to forget which is a
gentleman and which a lady—me that was always brought up—— But what
is the good of being so very particular?—when you consider, at my time of
life. Though some people think that makes no difference. Oh, no, you must
never wish her any harm; but a little foolish, flighty—with nothing in her
head but croquet you know, and—— Young Mr. Denbigh has so fallen off.
He used to come and talk quite like—— And then he would tell my brother
what he should do. My brother does not like advice, Edgar. Doctors never
do. They are so used, you know—— And then about these German baths
and everything. He used to tell my brother—— and he was not nice about
it. Sometimes he is not very nice. He has a good heart, and all that; but
doctors, you know, as a rule, never do—— And then your cousin—do you
think he meant anything?—— I once thought it was Clare; but then these
people are rich, and when a man like that is poor——”
“I don’t know what he meant,” said Edgar; “but I am sure he can’t mean
anything now, for he has left the Pimpernels.”
“And I suppose he is going to you?” said Miss Somers, “for he can’t stay
in the Arden Arms; now, can he? He is sure to be so particular. When men
have no money, my dear—and used to fine living and all that—— And I
don’t believe anything is to be had better than a chop—— Chops are greasy
in such places—— And then Arthur Arden is used to things so—— But my
dear, I think not, if I were you—on account of Clare. I do think not, Edgar,
if you were to take my advice.”
“But I fear I can’t help myself,” said Edgar, with a shadow passing over
his face——
Miss Somers shook her head; but fortunately not even the gratification of
giving advice could keep her long to one subject. “Well—of course Clare is
like other girls, she is sure to marry somebody,” she said—“and marriage is
a great risk Edgar. You shouldn’t laugh. Marriage is not a thing to make you
laugh. I never could make up my mind. It is so very serious a thing, my
dear. Suppose afterwards you were to see some one else? or suppose—— I
never could run the risk—though of course it can’t be so bad for a
gentleman—— But, Edgar, when you are going to be married—vows are
nothing—I wouldn’t make any vow—but,—it is this, Edgar—it is wrong to
have secrets from your wife. I have known such trouble in my day. When a
man was poor, you know—and she would go on, poor thing, and never find
out—and then all at once—— Oh, my dear, don’t you do that—tell her
everything—that is always my—and then she knows exactly what she can
do——”
“But I am not going to be married,” said Edgar with a smile, which did
not pass away as common smiles do, but melted over all his face.
“I hope not,” said Miss Somers promptly, “oh, I hope not—after all this
about the Pimpernels—and—— But that was your cousin, not you. Oh, no,
I hope not. What would Clare do? If Clare were married first, then perhaps
—— But it would be so strange; Mrs. Arden—Edgar, fancy! In my state of
health, you know, I couldn’t go to call on her, my dear. She wouldn’t expect
—but then sometimes young ladies are very—— And perhaps she won’t
know me nor how helpless—— I hope she’ll be very nice, I am sure—and
—pretty, and—— Some people think it doesn’t matter—about beauty, you
know, and that—— It’s a long, long time since I took any interest in such
things—but when I was a young girl, it used to be said—— Now I know
what you are thinking in yourself—how vain and all that—but it is not
vanity, my dear. You like to look nice, you know, and you like to please
people, and you like—of course, you like to look nice. When I was young
there were people that used to say—the little one—they always called me
the little one—or little Letty, or something—— I suppose because they
were fond of me. Edgar, everybody is fond of you when you are young.”
“And when you are old too,” said Edgar; “everybody has been fond of
you all your life, I am sure—and will be when you are a hundred—of
course you know that.”
“Ah, my dear,” said Miss Somers, shaking her head. “Ah my dear!”—
and two soft little tears came into the corners of her eyes—“when you are
old—— Yes. I know people are so kind—they pity you—and then every
one tries; but when you were young, oh, it was so—— There was no trying
then. People thought there was nobody like—— and then such quantities of
things were to happen—— But sometimes they never happen. It was my
own fault, of course. There was Mr. Templeton and Captain Ormond, and—
what is the good of going over——? That is long past, my dear, long past
——”
And Miss Somers put her hands up softly to her eyes. She had a sort of
theoretical regret for the opportunity lost, and yet, at the same time, a
theoretical satisfaction that she had not tempted her fate—a satisfaction
which was entirely theoretical; for did she not dream of her children who
might have been, and of one who called Mamma? But Miss Somers was
incapable of mentioning such a thing to Edgar, who was a “gentleman.” To
have betrayed herself would have been impossible. Arthur Arden was below
waiting in the Doctor’s study, and he came out as Edgar came down and
joined him. He had not been idle in this moment of waiting. Something told
him that this was a great crisis, a moment not to be neglected; and he had
been arranging his plan of operations. Only Edgar, for this once thoughtless
and unwary, thought of no crisis, until Tuesday came, when he should go to
Thorne. He thought of nothing that was likely to change his happy state so
long as he remained at home.
CHAPTER VI.
“The fact is, I am a little put out by having to change my quarters so
abruptly,” said Arthur Arden. “I am going to Scotland in the beginning of
September, but that is a long way off; and to go to one’s lodgings in town
now is dreary work. Besides, I said to the Pimpernels when they drove me
out—they actually turned me out of the house—I told them I was coming
here. It was the only way I could be even with them. If there is a thing they
reverence in the world it is Arden; and if they knew I was here——”
“It does not entirely rest with me,” said Edgar, with some
embarrassment. “Arden, we had a good deal of discussion on various
subjects before I went away.”
“Yes; you went in order to turn me out,” said Arthur meditatively. “By
George, it’s pleasant! I used to be a popular sort of fellow. People used to
scheme for having me, instead of turning me out. Look here! Of course,
when you showed yourself my enemy, it was a point of religion with me to
pursue my own course, without regard to you; but now, equally of course, if
you take me in to serve me, my action will be different. I should respect
your prejudices, however they might run counter to my own.”
“That means——?” said Edgar, and then stopped short, feeling that it
was a matter which he could not discuss.
“It is best we should not enter into any explanations. Explanations are
horrid bores. What I want is shelter for a few weeks, to be purchased by
submission to your wishes on the points we both understand.”
“For a few weeks!” said Edgar, with a little horror.
“Well, say for a single week. I must put my pride in my pocket, and beg,
it appears. It will be a convenience to me, and it can’t hurt you much. Of
course, I shall be on my guard in respect to Clare.”
“I prefer that my sister’s name should not be mentioned between us,”
said Edgar, with instinctive repugnance. And then he remembered Mrs.
Murray’s strange appeal to him on behalf of his cousin. “You have all but as
much right to be in Arden as I have,” he said. “Of course, you must come.
My sister is not prepared; she does not expect any one. Would it not be
wiser to wait a little—till to-morrow—or even till to-night?”
“Pardon me,” said Arthur; “but Miss Arden, I am sure, will make up her
mind to the infliction better—if I am so very disagreeable—if she gets over
the first shock without preparation. Is it that I am getting old, I wonder? I
feel myself beginning to maunder. It used not to be so, you know. Indeed,
there are places still—but never mind, hospitality that one is compelled to
ask for is not often sweet.”
It was on Edgar’s lips to say that it need not be accepted, but he
refrained, compassionate of his penniless kinsman. Why should the one be
penniless and the other have all? There was an absence of natural justice in
the arrangement that struck Edgar whenever his mind was directed to it; and
he remembered now what had been his intention when his cousin first came
to the Hall. “Arden,” he said, “I don’t think, if I were you, I would be
content to ask for hospitality, as you say; but it is not my place to preach.
You are the heir of Arden, and Arden owes you something. I think it is my
duty to offer, and yours to accept, something more than hospitality. I will
send for Mr. Fazakerly to-morrow. I will not talk of dividing the
inheritance, because that is a thing only to be done between brothers; but, as
you may become the Squire any day by my death——”
“I would sell my chance for five pounds,” said Arthur, giving his
kinsman a hasty look all over. “I shall be dead and buried years before you
—more’s the pity. Don’t think that I can cheat myself with any such hope.”
This was intended for a compliment, though it was almost a brutal one;
but its very coarseness made it more flattering—or so at least the speaker
thought.
“Anyhow, you have a right to a provision,” Edgar continued hastily, with
a sudden flush of disgust.
“I am agreeable,” said Arthur, with a yawn. “Nobody can be less
unwilling to receive a provision than I am. Let us have Fazakerly by all
means. Of course, I know you are rolling in money; but Old Arden to Clare
and a provision to me will make a difference. If you were to marry, for
instance, you would not find it so easy to make your settlements. You are a
very kind-hearted fellow, but you must mind what you are about.”
“Yes,” said Edgar, “you are quite right. What is to be done must be done
at once.”
“Strike while the iron is hot,” said Arthur, languidly. He did not care
about it, for he did not believe in it. A few weeks at Arden in the capacity of
a visitor was much more to him than a problematical allowance. Fazakerly
would resist it, of course. It would be but a pittance, even if Edgar was
allowed to have his way. The chance of being Clare’s companion, and
regaining his power over her, and becoming lawful master through her of
Old Arden, was far more charming to his imagination. Therefore, though he
was greedy of money, as a poor man with expensive tastes always is, in this
case he was as honestly indifferent as the most disinterested could have
been. Thus they strolled up the avenue, where the carriage wheels were still
fresh which had carried Clare; and a certain relief stole over her brother’s
mind that they would be three, not two, for the rest of the day. Strange, most
strange that it should be so far a relief to him not to be alone with Clare.
Clare received them with a seriousness and reserve, under which she
tried to conceal her excitement. Her cousin had deceived her, preferred a
cottage girl to her, insulted her in the most sensitive point, and yet her heart
leapt into her throat when she saw him coming. She had foreseen he would
come. When he came into church, looking at her so wistfully, when he
followed her out, asking to walk with Edgar, it became very evident to her
that he was not going to relinquish the struggle without one other attempt to
win her favour. It was a vain hope, she thought to herself; nothing could
reverse her decision, or make her forget his sins against her; but still the
very fact that he meant to try, moved, unconsciously, her heart—or was it
his presence, the sight of him, the sound of his voice, the wistfulness in his
eyes? Clare had driven home with her heart beating, and a double tide of
excitement in all her veins. And then Arthur, too, was bound up in the
whole matter. He was the first person concerned, after Edgar and herself;
they would be three together in the house, between whom this most strange
drama was about to be played out. She waited their coming with the most
breathless expectation. And they came slowly up the avenue, calm as the
day, indifferent as strangers who had never seen each other; pausing
sometimes to talk of the trees; examining that elm which had a great branch
blown off; one of them cutting at the weeds with his cane as undisturbed as
if they were—as they thought—walking quietly home to luncheon, instead
of coming to their fate.
“Arden is going to stay with us a little, Clare, if you can take him in,”
Edgar said, with that voluble candour which a man always exhibits when he
is about to do something which will be disagreeable to the mistress of his
house—be she mother, sister, or wife. “He has no engagements for the
moment, and neither have we. It is a transition time—too late for town, too
early for the country—so he naturally turned his eyes this way.”
“That is a flattering account to give of it,” said Arthur, for Clare only
bowed in reply. “The fact is, Miss Arden, I was turned out by my late
hostess. May I tell you the story? I think it is rather funny.” And, though
Clare’s response was of the coldest, he told it to her, giving a clever sketch
of the Pimpernels. He was very brilliant about their worship of Arden, and
how their hospitality to himself was solely on account of his name. “But I
have not a word to say against them. My own object was simply self-
interest,” he said. He was talking two languages, as it were, at the same
moment—one which Edgar could understand, and one which was addressed
to Clare.
And there could be no doubt that his presence made the day pass more
easily to the other two—one of whom was so excited, and the other so
exceedingly calm. They strolled about the park in the afternoon, and got
through its weary hours somehow. They dined—Clare in her fever eating
nothing; a fact, however, which neither of her companions perceived. They
took their meal both with the most perfect self-possession, hurrying over
nothing, and giving it that importance which always belongs to a Sunday
dinner. Dinner on other days is but a meal, but on Sunday it is the business
of the day; and as such the two cousins took it, doing full justice to its
importance, while the tide rose higher and higher in Clare’s veins. When
she left them to their wine, she went to her own room, and walked about
and about it like a caged lioness. It was not Clare’s way, who was above all
demonstration of the kind; but now she could not restrain herself. She
clenched her two hands together, and swept about the room, and moaned to
herself in her impatience. “Oh, will it never be night? Will they never have
done talking? Can one go on and go on and bear it?” she cried to herself in
the silence. But after all she had to put on her chains again, and bathe her
flushed face, and go down to the drawing-room. How like a wild creature
she felt, straining and chafing at her fetters! She sat down and poured out
tea for them, with her hand trembling, her head burning, her feet as cold as
ice, her head as hot as fire. She said to herself it was unlady-like,
unwomanly, unlike her, to be so wild and self-indulgent, but she had no
power to control herself. All this time, however, the two men made no very
particular remark. Edgar, who thought she was still angry, only grieved and
wondered. Arthur knew that she was dissatisfied with himself, and was
excited but not surprised. He gave her now and then pathetic looks. He
wove in subtle phrases of self-vindication—a hundred little allusions, which
were nothing to Edgar but full of significance to her—into all he said. But
he could not have believed, what was the case, that Clare was far past
hearing them—that she did not take up the drift of his observations at all—
that she hardly understood what was being said, her whole soul being one
whirl of excitement, expectation, awful heartrending fear and hope. It was
Edgar at last who perceived that her strength was getting worn out. He
noticed that she did not hear what was said—that her face usually so
expressive, was getting set in its extremity of emotion. Was it emotion, was
it mania? Whatever it was, it had passed all ordinary bounds of endurance.
He rose hastily when he perceived this, and going up to his sister laid his
hand softly on her shoulder. She started and shivered as if his hand had been
ice, and looked up at him with two dilated, unfathomable eyes. If he had
been going to kill her she could not have been more tragically still—more
aghast with passion and horror. A profound compassion and pity took
possession of him. “Clare,” he said, bending over her as if she were deaf,
and putting his lips close to her ear, “Clare, you are over-exhausted. Go to
bed. Let me take you up stairs—and if that will be a comfort to you, dear, I
will go and read them now.”
“Yes,” she said, articulating with difficulty—“Yes.” He had to take her
hand to help her to rise; but when he stooped and kissed her forehead Clare
shivered again. She passed Arthur without noticing him, then returned and
with formal courtesy bade him good-night; and so disappeared with her
candle in her hand, throwing a faint upward ray upon her white woe-begone
face. She was dressed in white, with black ribbons and ornaments, and her
utter pallor seemed to bring out the darkness of her hair and darken the blue
in her eyes, till everything about her seemed black and white. Arthur Arden
had risen too and stood wondering, watching her as she went away. “What
is the matter?” he said abruptly to Edgar, who was no better informed than
himself.
“I don’t know. She must be ill. She is unhappy about something,” said
Edgar. For the first time the bundle of old letters acquired importance in his
eyes. “I want to look at something she has given me,” he added simply.
“You will not think me rude when you see how much concerned my sister
is? You know your room and all that. I must go and satisfy Clare.”
“What has she given you?” asked Arthur, with a certain precipitation.
Edgar was not disposed to answer any further questions, and this was one
which his cousin had no right to ask.
“I must go now,” he said. “Good-night. I trust you will be comfortable.
In short, I trust we shall all be more comfortable to-morrow. Clare’s face
makes me anxious to-night.”
And then Arthur found himself master of the great drawing-room, with
all its silent space and breadth. What did they mean? Could it be that Clare
had found this something for which he had sought, and instead of giving it
to himself had given it to her brother, the person most concerned, who
would, of course, destroy it and cut off Arthur’s hopes for ever. The very
thought set the blood boiling in his veins. He paced about as Clare had done
in her room, and could only calm himself by means of a cigar which he
went out to the terrace to smoke. There his eyes were attracted to Clare’s
window and to another not far off in which lights were burning. That must
be Edgar’s, he concluded; and there in the seclusion of his chamber, not in
any place more accessible, was he studying the something Clare had given
him? Something! What could it be?
CHAPTER VII.
More than one strange incident happened at Arden that soft July night. Mr.
Fielding was seated in his library in the evening, after all the Sunday work
was over. He did not work very hard either on Sundays or on any other
occasions—the good, gentle old man. But yet he liked to sit, as he had been
wont to do in his youth when he had really exerted himself, on those
tranquil Sunday nights. His curate had dined with him, but was gone,
knowing the Rector’s habit; and Mr. Fielding was seated in the twilight,
with both his windows open, sipping a glass of wine tenderly, as if he loved
it, and musing in the stillness. The lamp was never lighted on Sunday
evenings till it was time for prayers. Some devout people in the parish were
of opinion that at such moments the Rector was asking a blessing upon his
labours, and “interceding” with God for his people—and so, no doubt, he
was. But yet other thoughts were in his mind. Long, long ago, when Mr.
Fielding had been young, and had a young wife by his side, this had been
their sacred hour, when they would sit side by side and talk to each other of
all that was in their hearts. It was “Milly’s hour,” the time when she had
told him all the little troubles that beset a girl-wife in the beginning of her
career; and he had laughed at her, and been sorry for her, and comforted her
as young husbands can. It was Milly’s hour still, though Milly had gone out
of all the cares of life and housekeeping for thirty years. How the old man
remembered those little cares—how he would go over them with a soft
smile on his lip, and—no, not a tear—a glistening of the eye, which was not
weeping. How frightened she had been for big Susan, the cook; how
bravely she had struggled about the cooking of the cutlets, to have them as
her husband liked them—not as Susan pleased! And then all those
speculations as to whether Lady Augusta would call, and about Letty
Somers, and her foolish, little kind-hearted ways. The old man remembered
every one of those small troubles. How small they were, how dear, how
sacred—Milly’s troubles. Thank Heaven, she had never found out that the
world held pangs more bitter. The first real sorrow she had ever had was to
die—and was that a sorrow? to leave him; and had she left him? This was
the tender enjoyment, the little private, sad delight of the Rector’s Sunday
nights; and he did not like to be disturbed.
Therefore, it was clear the business must be of importance which was
brought to him at that hour. “Your reverence won’t think as it’s of my own
will I’m coming disturbing of you,” said Mrs. Solmes, the housekeeper;
“but there’s one at the door as will take no denial. She says she aint got but
a moment, and daren’t stay for fear her child would wake. She’s been in a
dead faint from yesterday at six till now. The t’oud woman as lives at oud
Sarah’s, your reverence; the Scotchy, as they calls her—her as had her
granddaughter killed last night.”
“God bless me!” said Mr. Fielding, confused by this complication. He
knew Jeanie had not been killed; but how was he to make his way in this
twilight moment through such a maze of statements? “Killed!” he said to
himself. It was so violent a word to fall into that sacred dimness and
sadness—sadness which was more dear to him than any joy. “Let her come
in,” he added, with a sigh. “Lights? no! I don’t think we want lights. I can
see you, Mrs. Solmes, and I can see to talk without lights.”
“As you please, sir,” said the housekeeper; “but them as is strangers, and
don’t know your habits, might think it was queer. And then to think how a
thing gets all over the village in no time. But, to be sure, sir, it’s as you
please.”
“Then show Mrs. Murray in,” said Mr. Fielding. He had never departed
from his good opinion of her, notwithstanding that she was a Calvinist, and
looked disapproval of his sermons; but that she should come away from her
child’s sick-bed, that was extraordinary indeed.
And then in the dark, much to the scandal of Mrs. Solmes, Mrs. Murray
came in. Even the Rector himself found it embarrassing to see only the tall,
dark figure beside him, without being able to trace (so short-sighted as he
was, too) the changes of her face. “Sit down,” he said, “sit down,” and
bustled a little to get her a chair—not the one near him, in which, had she
been alive, his Milly would have sat—(and oh! to think Milly, had she
lived, would have been older than Mrs. Murray!)—but another at a little
distance. “How is your child?” he asked. “I meant to have gone to see her
to-night, but they told me she was insensible still.”
“And so she is,” said the grandmother, “and I wouldna have left her to
come here but for something that’s like life and death. You’re a good man. I
canna but believe you’re a real good man, though you are no what I call
sound on all points. I want you to give me your advice. It’s a case of a
penitent woman that has done wrong, and suffered for it. Sore she has
suffered in her bairns and her life, and worse in her heart. It’s a case of
conscience; and oh! sir, your best advice——”
“I will give you the best advice I can, you may be sure,” said Mr.
Fielding, moved by the pleading voice that reached him out of the darkness.
“But you must tell me more clearly. What has she done? I will not ask who
she is, for that does not matter. But what has she done; and has she, or can
she, make amends? Is it a sin against her neighbour or against God?”
“Baith, baith,” said the old woman. “Oh, Mr. Fielding, you’re an
innocent, virtuous man. I ken it by your face. This woman has been airt and
pairt in a great wrong—an awfu’ wrong; you never heard of the like. Partly
she knew what she was doing, and partly she did not. There are some more
guilty than her that have gone to their account; and there’s none to be
shamed but the innocent, that knew no guile, and think no evil. What is she
to do? If it was but to punish her, she’s free to give her body to be burned or
torn asunder: oh, and thankful, thankful! Nothing you could do, but she
would take and rejoice. But she canna move without hurting the innocent.
She canna right them that’s wronged without crushing the innocent. Oh, tell
me, you that are a minister, and an old man, and have preached God’s way!
Many and many a time He suffers wrong, and never says a word. It’s done
now, and canna be undone. Am I to bear my burden and keep silent till my
heart bursts, or must I destroy, and cast down, and speak!”
The woman spoke with a passion and vehemence which bewildered the
gentle Rector. Her voice came through the dim and pensive twilight,
thrilling with life and force and vigour. In that atmosphere, at that hour, any
whisper of penitence should have been low and soft as a sigh. It should
have been accompanied by noiseless weeping, by the tender humility which
appeals to every Christian soul; but such was not the manner of this strange
confession. Not a tear was in the eye of the penitent. Mr. Fielding felt,
though he could not see, that her eyes, those eyes which had lost none of
their brightness in growing old, were shining upon him in the darkness, and
held him fast as did those of the Ancient Mariner. Suddenly, without any
warning, he found himself brought into contact, not with the moderate
contrition of ordinary sinners, but with tragic repentance and remorse. He
could not answer for the first moment. It took away his breath.
“My dear, good woman,” he said, “you startle me. I do not understand
you. Do you know what you are saying? I don’t think you can have done
anything so very wrong. Hush, hush! compose yourself, and think what you
are saying. When we examine it, perhaps we will find it was not so bad.
People may do wrong, you know, and yet it need not be so very serious. Tell
me what it was.”
“That is what I cannot do,” she said. “If I were to tell you, all would be
told. If it has to be said, it shall be said to him first that will have the most to
bear. Oh, have ye been so long in the world without knowing that a calm
face often covers a heavy heart! Many a thing have I done for my ain and
for others that cannot be blamed to me; but once I was to blame. I tell ye, I
canna tell ye what it was. It was this—I did what was unjust and wrong. I
schemed to injure a man—no, no me, for I did not know he was in
existence, and who was to tell me?—but I did the wrong thing that made it
possible for the man to be injured. Do you understand me now? And here I
am in this awful strait, like Israel at the Red Sea. If I let things be, I am
doing wrong, and keeping a man out of his own; if I try to make amends, I
am bringing destruction on the innocent. Which, oh, which, tell me, am I to
do?”
She had raised her voice till it sounded like a cry, and yet it was not loud.
Mrs. Solmes in the kitchen heard nothing, but to Mr. Fielding it sounded
like a great wail and moaning that went to his heart. And the silence closed
over her voice as the water closes over a pebble, making faint circles and
waves of echo, not of the sound, but of the meaning of the sound. He could
not speak, with those thrills of feeling, like the wash after a boat, rolling
over him. He did not understand what she meant; her great and violent pain
bewildered the gentle old man. The only thing he could take hold of was her
last words. That, he reflected, was always right—always the best thing to
advise. He waited until the silence and quietness settled down again, and
then he said, his soft old voice wavering with emotion, “Make amends!”
“Is that what you say to me?” she said, lifting up her hands. He could see
the vehement movement in the gloom.
“Make amends. What other words could a servant of God say?”
He thought she fell when he spoke, and sprang to his feet with deep
anxiety. She had dropped down on her knees, and had bent her head, and
was covering her face with her hands. “Are you ill?” he said. “God bless us
all, she has fainted! what am I to do?”
“No; the like of me never faints,” she answered; and then he perceived
that she retained her upright position. Her voice was choked, and sounded
like the voice of despair, and she did not take her hands from her face. “Oh,
if I could lie like Jeanie,” she went on, “quietly, like the dead, with nae
heart to feel nor voice to speak. My bit little lily flower! would she have
been broken like that—faded like that, if I had done what was right? But, O
Lord my God, my bonnie lad! what is to become of him?”
“Mrs. Murray! Mrs. Murray!” said Mr. Fielding, “let me put you on that
sofa. Let me get you some wine. Compose yourself. My poor woman, my
good woman! All this has been too much for you. Are you sure it is not a
delusion you have got into your mind?”
The strange penitent took no notice of him as he stood thus beside her.
Her mind was occupied otherwise. “How am I to make amends?” she was
murmuring; “how am I to do it? Harm the innocent, crush down the
innocent!—that’s all I can do. It will relieve my mind, but it will throw
nothing but bitterness into theirs. The prophet he threw a sweetening herb
into the bitter waters, but it would be gall and wormwood I would throw.
The wrong’s done, and it canna be undone. It would but be putting off my
burden on them—giving them my pain to bear; and it is me, and no them,
that is worthy of the pain.”
“Mrs. Murray,” said the Rector, by this time beginning to feel alarmed;
for how could he tell that it was not a madwoman he had beside him in the
dark? “you must try and compose yourself. I think things cannot be so bad
as you say. Perhaps you are tormenting yourself for nothing. My dear good
woman, sit down and rest, and compose yourself, while I ring the bell for
the lamp.”
Then she rose up slowly in the darkness between him and the window,
and took her hands from her face. She did not raise her head, but she put out
her hand and caught his arm with a vigour which made Mr. Fielding
tremble. “I was thinking if I had anything else to say,” she said, in a low
desponding tone, “but there’s nothing more. I cannot think but of one thing.
If you’ve nothing more to say to me, I’ll go away. I’ll slip away in the dark,
as I came, and nobody will be the wiser. Mr. Fielding, you’re a real good
man, and that was your best advice?”
“It’s my advice to everybody, in ordinary circumstances,” said Mr.
Fielding. “If you have done wrong, make amends—the one thing
necessitates the other. If you have done wrong, make amends. But, Mrs.
Murray, wait till the lamp comes and a glass of wine. You are not fit to go
back to your nursing without something to sustain you. Sit down again.”
“I am fit for a great deal more than that,” she said; “but no, no, nae
lights. I’ll go my ways back. I’ll slip out in the dark, as I slipped in. I’m like
the owls—I’m dazzled by the shinin’ light. That’s new to me, that always
liked the light; but, sir, I thank ye for your goodness. I must slip away now.”
“You are not fit to walk in this state,” he said, following her anxiously to
the door; “take my arm; let me get out the pony—I will send you
comfortably home.”
Mrs. Murray shook her head. She declined the offer of the old man’s
arm. “I have mair strength than you think,” she said; “and Jeanie must never
know that I have been here. Oh, I’m strengthened with what you said. Oh,
I’m the better for having opened my heart; but I’ll slip out, as long as there
are none to see.”
And, while the gentle Rector stood and wondered, she went out by the
open window, as erect and vigorous as if no emotion could touch her.
Swiftly she passed into the darkness, carrying with her her secret. What was
it? Mr. Fielding sunk into his chair with a sigh. Never before had any
interruption like this come into Milly’s hour.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like