Book Image

Flask By Example

By : Gareth Dwyer
Book Image

Flask By Example

By: Gareth Dwyer

Overview of this book

This book will take you on a journey from learning about web development using Flask to building fully functional web applications. In the first major project, we develop a dynamic Headlines application that displays the latest news headlines along with up-to-date currency and weather information. In project two, we build a Crime Map application that is backed by a MySQL database, allowing users to submit information on and the location of crimes in order to plot danger zones and other crime trends within an area. In the final project, we combine Flask with more modern technologies, such as Twitter's Bootstrap and the NoSQL database MongoDB, to create a Waiter Caller application that allows restaurant patrons to easily call a waiter to their table. This pragmatic tutorial will keep you engaged as you learn the crux of Flask by working on challenging real-world applications.
Table of Contents (20 chapters)
Flask By Example
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Index

Installing MongoDB


MongoDB can be found in the Ubuntu software repositories, but as updates are frequent and the repository versions tend to lag behind, it's highly recommended to install it from the official Mongo package directly.

We'll go through how to do this step by step here, but as the installation procedures may change, it's advisable to get an updated version of the required URLs and steps from the official installation guide available at https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/.

The first thing we need to do is import MongoDB's public key so that the installation can be authenticated. On your VPS only (as before, we will not install a database server on our development machine), run the following:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

Now that we have the key, we can use the following command to add a link to the MongoDB package to our software sources. Note that this command is specific to Ubuntu 14.04 "Trusty", which...