Skip to main content

Posts

Showing posts with the label url

URL Shortner with Python and Flask - Chapter 4 - Blueprints

Remember? In the previous part we created flask app which had all the code in a single file and we called it app.py . As our site was small, we were able to manage the code. But what if, you want to create a website as big as facebook? Yes, features like groups, friends, newsfeed, Pages etc. can be created using flask. But do you think, that it would be better if all the data were to be on the same file? If you are becoming bigger then you should consider separating code into different files so that if you want to edit one feature then you can do easily. The main point here is, organising the files and features becomes easy. But how do we do we organize and seperate features in flask? The best answer is Flask-Blueprints. There are many advantages of using Blueprints, and you can read them from here: Why Blueprints? . Starting from scratch ¶ Now that you are convinced, how do we use blueprints?. Lets see an example. The following is the __init__.py file which you will st...

URL shortener with python and flask - Chapter 3 - Let's play with flask

In this chapter, we will look at some of the important concepts of flask. I am assuming that you know what flask is all about and what you can do with flask. If not then visit Flask I am also assuming that you have a solid understanding of python programming language. If not just google python tutorial and you will see a lot of tutorials. But Python docs is the best way to learn python. In this chapter, we will be creating a lot of scripts or python files which we will run from the command prompt. To create a script you can open your favourite text editor and then type the python code, save it with a file extension .py . Now open the command prompt in the folder you have saved python and then type python your_file_name.py Then command prompt will run the script and gives the expected output.

URL shortener with python and flask - Chapter 2 - Let's play with python

In this chapter we will be brushing up our concepts in python. If you are good in python then you can skip this chapter and continue with the next one. But I recommend you to just skim through the contents of this chapter. I am assuming that you already have python installed and the same is accessible from the command prompt. Now to get a hands on experience, open your IDLE or command prompt and start typing the code. Just remember that you will be typing line by line. As I am using Ipython notebook, we will see a little bit of variation from your output at some points. But the core concepts are the same.

URL shortener with python and flask - chapter 1 - Installations

In this chapter we will make some important installations. We will use these modules and softwares in the upcoming chapters. I am assuming that you are beginner and so we will start with python installation.

URL shortener with python and flask- Chapter 0 - Introduction

In this tutorial series, we will use flask to create a URL shortener service. At the end of this tutorial series, I am expecting that you will be in a position to extend this knowledge for use in some other application.