In the process of self-study python, I am puzzled by the use of if __name__= ' __main__ ' , in the Think Python book the author's source code is so interpreted if __name__= ' __main__ ' statement:# The following condition checks whether we are#
You should put Template_debugfalse in the production environment if this is set to ' True ', the Django template system will save some extra information for each template in order to display enough on that good-looking error page.
implement a 404
The remaining question about caching is the privacy of the data and the question of where the data should be stored in the cascading cache.
Typically the user will face two caches: his or her own browser cache (private cache) and his or her
It is possible to integrate Django with the username and password or authentication methods of other existing authentication systems.
For example, your company may already have LDAP installed, and the appropriate user name and password are stored
The examples in this article describe how Python automatically processes cookies based on Pycurl. Share to everyone for your reference. Specific as follows:
Import Pycurlimport Stringiourl = "http://www.google.com/" CRL = Pycurl. Curl ()
When you mark the translated string, you need to write (or get the existing) translation information for the language. Here's how it works.
Geographical restrictions
Django does not support localizing your app to a region where it has not yet been
Nagios is an open source, free network monitoring tool that effectively monitors Windows, Linux and UNIX host status, network settings such as switch routers, printers, and more. Send mail or SMS alarm when the system or service status is abnormal
Today I wrote something to calculate the time difference, I remember writing it last year, so mark again today, lest I forget
in [+]: from datetime import Datetimein [+]: A=datetime.now () in []: B=datetime.now () in [+]: aout[32]: Datetime.dateti
The previous period of time has been using Pycharm Write pandas program, for big data development, development is generally a step to take a step, pycharm not suitable. Online Recommended use Jupyter notebook, it is a web version of the editor,
Requests is a Python HTTP client library, similar to URLLIB,URLLIB2, why use requests instead of URLLIB2? This is stated in the official documentation:
Python's standard library URLLIB2 provides most of the HTTP functionality needed, but the API
Do not know people have such a worry, "their computer is always used by others, but also embarrassed to set the password", so the use of Python designed a program to achieve free control.
Although the function is simple, we can realize more
My style, nonsense not much to say, directly to everyone posted code, and in some difficult points to everyone with comments, the specific code is as follows:
#!/usr/bin/env python#-*-coding:utf-8-*-import urllib2,jsonimport datetime,timefrom
1. Install Ubuntu with Uwsgi PPA:
2. Replace Mod_wsgi with Uwsgi
Nginx's overall configuration here does not say, assuming already understand Nginx basic configuration, then UWSGI is similar to this configuration:
Location/{ include
The example of this article is to share the Python script monitoring Docker container method, for your reference, the specific content is as follows
Scripting Features:
1. Monitor CPU Usage
2. Monitor Memory usage Status
3. Monitor network
Python provides a variety of processing methods for time and date, mainly in the two modules of the Times and DateTime. Today, a little comb the two modules in the use of some of the differences and links.
TimeIn the Python documentation, time is
Python combines APIs for instant weather information
Import urllib.requestimport urllib.parseimport json "" "captures the real-time weather conditions with the most beautiful weather http://www.zuimeitianqi.com/" "" Class Zuimei ( ): Def __init__
UrllibLearn the basics of Python, some confused. The eyes closed, a kind of blank choking endless flow. or lack of practice, then take the crawler to practice practiced hand. After learning the Spartan Python crawler course, the following will be
Crawler is really an interesting thing ah, before the crawler, with the URLLIB2, BeautifulSoup to achieve a simple crawler, Scrapy has also been achieved. If you want to learn a reptile better recently, make a record of it as much as possible. This
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service