Book Image

Python Programming Blueprints

By : Daniel Furtado, Marcus Pennington
Book Image

Python Programming Blueprints

By: Daniel Furtado, Marcus Pennington

Overview of this book

Python is a very powerful, high-level, object-oriented programming language. It's known for its simplicity and huge community support. Python Programming Blueprints will help you build useful, real-world applications using Python. In this book, we will cover some of the most common tasks that Python developers face on a daily basis, including performance optimization and making web applications more secure. We will familiarize ourselves with the associated software stack and master asynchronous features in Python. We will build a weather application using command-line parsing. We will then move on to create a Spotify remote control where we'll use OAuth and the Spotify Web API. The next project will cover reactive extensions by teaching you how to cast votes on Twitter the Python way. We will also focus on web development by using the famous Django framework to create an online game store. We will then create a web-based messenger using the new Nameko microservice framework. We will cover topics like authenticating users and, storing messages in Redis. By the end of the book, you will have gained hands-on experience in coding with Python.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Dedication
Contributors
Packt Upsell
Preface
Index

Exploring the Django project's structure


If you look at the Django website, it says Django: The Web framework for perfectionists with deadlines, and I could not agree more with this statement. So far, we haven't written any lines of code, and we already have a site up and running. In just a few commands, we can create a new project with the same directory structure and boilerplate code. Let's start with the development.

We can set up a new database and create a superuser, and, on the top of that, Django comes with a very nice and useful admin UI, where you can visualize our data, , and users.

In this section, we are going to explore the code that Django created for us when starting a new project so that we can get familiar with the structure. Let's go ahead and start adding the other components of our project.

If you have a look inside of the project's root directory, you will find a file called db.sqlite3, another file called manage.py, and, lastly, a directory with the same name as the project...