How to use Python production site?

Website / Web application consists of two main parts.

Front: the client.

Rear: the server side.

Front-end client / user is just what you see in the browser, the small web pages, layouts, images and buttons and badges and other components.

We need front-end design of any website / Web applications

HTML: add a title, text, paragraphs and other elements on our website.

This is a normal HTML website General website:

Here Insert Picture Description

Very plain boring, is not it?

In order to make things look better and to add color, we use content called CSS or Cascading Style Sheets to set the HTML page.

The following is the appearance of HTML and CSS web site:

Here Insert Picture Description

It looks very neat, but if you want to add interactivity to your website?

When you click the button, how to make your website perform certain actions?

This is the place JavaScript into the picture, the use of JavaScript, you can move the mouse, clicks, etc. to interact with your site via keyboard input.

Once you learn HTML, CSS and JS, you can build one of these applications:

Here Insert Picture Description
You can accept user input and process data input and gives a particular result.

Now let's talk about the back-end:

Let's say you want to build some complicated stuff, maybe social networking applications like Facebook.

By basic knowledge of HTML, CSS and JavaScript, you will be able to design layout that looks like a Facebook page.

It's all cool well, but where is your store user data?

This is the place to database, the database is only a central repository to store all site data.

Not only database for storing data, should also be able to retrieve data.

For example, when you enter the URL for the https://www.facebook.com/zuck, Facebook will send a request to the server, we need to declare who owns the data associated with the user name zuck.
Here Insert Picture Description

This is the case technically happens when you type a URL in a browser, the URL request will be sent to the server. The server then sends back the appropriate response, in our case, it queries the database and find the data for the profile that Zuck, and the data is sent back to us.

When you query a number of other URL, ie let us assume facebook.com/quora, we understand that it has requested a different page, and therefore returns a different set of information.

However, exactly how the server knows how to handle user requests?

That is because the server is programmed to process incoming client requests.

How do we program the server so that it can add and retrieve data / communication with the database?

Here is a picture of Python, Python can ensure that you can use some of the results of the query in the database, you can also update, delete, and add data in the database.

This is called server-side programming / backend programming.

But wait, is not starting from scratch programming server is a tedious task?

This is the Python framework Django and Flask and the like.

Django is a high-level Python framework that can facilitate rapid development.

Use Django, time required to build scalable Web applications greatly reduced, which is why Django was recently startups reason for building their products / prototypes.

Django not only allows you to build online database for Web applications, but also allow you to handle user authentication, it comes with built-in management panel.

You should start learning how to use Python production site?

This is my advice, if you are already familiar with HTML, CSS and JS, you can start learning Python.

Before you even go directly to Django, you must first in-depth study and understanding of Python, because Django framework based on Python.

Upon completion of Python, you can start learning from Django Django documentation

If you are a beginner, I strongly recommend that you learn Python, and then began to use Django.
"Micro-channel public number of full-stack nest welcome attention to learning" "

Guess you like

Origin blog.csdn.net/gzyiCG/article/details/91952290