Get object (tag) name, property, content, comment
How to get object (tag) name, attribute, content, comment and other operations by using the Python crawler beautifulsop
1, Tag object
1. The tag object is the same as the tag in the XML or HTML native document.
from bs4 import BeautifulSoup
soup = BeautifulSoup('<b class="boldest">Extremely bold&l ...
Posted by etoast on Wed, 19 Feb 2020 17:41:47 +0100
python django project creation steps
There are many different Web frameworks under Python. The common ones are Django, Flask,Torand,. Django is the most representative of the heavyweight players. Many successful websites and apps are based on Django. Django adopts the framework mode of MVC, namely model M, view V and controller C.
1, P ...
Posted by Kookedoh on Tue, 18 Feb 2020 12:59:24 +0100
3-Use databases in Django
Database Settings
In the previous section, you learned how to create a Django project, create a web application in a Django project, and reference the URL of a web application in the URL of a Django main program.Here's how to use databases in Django.To use a database in Django, you first need to understand the settings for the database connecti ...
Posted by Sinikka on Sun, 16 Feb 2020 21:48:32 +0100
Django RESTFul (interface application)
Django interface application
Written in front
1. Try to write an interface
1.1 new django project
1.1.1. First, create a new django project in pycharm
1.1.2 write driver (used to connect mysql)
1.1.3 new database
1.1.4 migration
1.1.5 login database
1.2 first test whether django can start normall ...
Posted by andyhajime on Sun, 12 Jan 2020 12:20:50 +0100
AJAX of Django
Catalog
AJAX introduction
AJAX basic syntax structure
Data encoding format of front and back end interaction
Form form
ajax submission
How to get json data from the backend?
How can we take it ourselves?
AJAX send file
Automatic serialization
Pager ap ...
Posted by millwardt on Fri, 10 Jan 2020 14:48:46 +0100
JS realizes three methods of uploading pictures and preview pictures
In the common user registration page, users need to select a picture locally as their avatar and preview it at the same time.
There are two common ideas: first, upload the image to the temporary folder of the server, return the url of the image, and then render it on the html page;
Another idea is to preview the image directl ...
Posted by Phpdiot on Tue, 07 Jan 2020 08:21:43 +0100
Need a minimum Django file upload sample [Close]
As a novice to Django, it is difficult for me to make an upload application in Django 1.3.I can't find any recent examples/snippets.Can someone publish a minimum but complete (model, view, template) sample code to do this?
#1st floor
I must say I find the documentation on django confusing.Also for the simplest example, why mention the fo ...
Posted by tdelobe on Tue, 07 Jan 2020 05:19:02 +0100
django-4 field type data constraint table relation
django
mysql
model field type
'AutoField': 'integer AUTO_INCREMENT',
'BigAutoField': 'bigint AUTO_INCREMENT',
'BinaryField': 'longblob',
'BooleanField': 'bool',
'CharField': 'varchar(%(max_length)s)',
'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',
...
Posted by teng84 on Sat, 21 Dec 2019 20:57:48 +0100
django users and rights management
django stores the relationship between app and model by using the content U type table. In the permission table, name (name of permission, both in Chinese and English) content ﹣ type ﹣ ID (foreign key relationship with content ﹣ type, used to bind model) codename (permission name used when writing code) is set. How to customize permission?
1 ...
Posted by brbsta on Fri, 20 Dec 2019 14:53:47 +0100
restframework Component Details
Introduction to restfulrestful is an interface specification in which front-end and back-end interfaces are developed to improve team development efficiency, especially for front-end and back-end separation, according to which front-end and back-end development modules are not affected by each other2. Routing
from rest_framework.routers import ...
Posted by wintallo on Wed, 18 Dec 2019 03:15:03 +0100