Book Image

Learning Flask Framework

Book Image

Learning Flask Framework

Overview of this book

Table of Contents (17 chapters)
Learning Flask Framework
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a URL scheme


URLs are for people, therefore they should be easy to remember. A good URL scheme is easy to remember when it accurately reflects the implicit structure of the website. Our goal is to create a URL scheme that makes it easy for the visitors on our site to find blog entries on topics that interest them.

Referring back to the spec we created in Chapter 1, Creating Your First Flask Application, we know that we want our blog entries to be organized by tag and by date. Entries organized by tag and date will necessarily be a subset of the collection of all entries, so that gives us a structure like this:

URL

Purpose

/entries/

This displays all of our blog entries, ordered most-recent first

/entries/tags/

This contains all the tags used to organize our blog entries

/entries/tags/python/

This contains all the entries tagged with python

/entries/learning-the-flask-framework/

This is a detail page showing the body content for a blog entry titled Learning the Flask...