[python] Django–templates, static files, django template syntax, requests and responses

The notes are study notes compiled by myself. If there are any mistakes, please point them out~ [Django column] Django–Introduction to Django, installation of Django, creating projects, and getting started quickly Django – templates, static files, django template syntax, requests and responses Django – connect to mysql database Django–templates, static files, django template syntax, requests […]

◢Django self-written paging and usage

Table of Contents 1. Set the paging style and display it to the browser 2. Simulate page number 3. Generate paging 4. Data display 5. Previous pageNext page 6. Database data paging 7. Package paging 8. Use encapsulated paging After building the app, set the path path(‘in2/’, views.in2), view def in2(request): , HTML: in2.html 1. […]

Django – routing layer

1. Route matching 1. Notes on route matching urlpatterns = [ url(r’^admin/’, admin.site.urls), # front page url(r’^$’,views.home), # Route matching url(r’^test/$’,views.test), url(r’^testadd/$’,views.testadd), # Last page (understand): Use exception capture processing later. Such a last page makes Django’s second slash APPEND_SLASH=True in the path meaningless, and the mechanism of appending slashes in the second redirect is […]

Django view functions and resources

Article directory 1.View 1.1 File or folder 1.2 Relative and absolute import urls 1.3 View parameters 1.4 Return value 1.5 Response header 1.6 FBV and CBV 2. Static resources 2.1 Static files 2.2 Media files 1. View 1.1 File or folder 1.2 Relative and absolute import urls Note on implementation: Do not make relative imports […]

Django file configuration, request object, connection to MySQL, ORM

Article directory Django static files and related configurations Static file preface Static file related configuration form form request object request request result GET request POST request pycharm connects to database Django connects to MySQL Introduction to Django ORM Django static files and related configuration In this blog I will introduce relevant knowledge through a user […]

The use of data, the creation of table relationships, and the request life cycle flow chart of the Django framework

Table of Contents 1. Add, delete, modify and check data 1. Display of user list 2. Modify the logical analysis of data 3. Analysis of deletion function 2. How to create table relationships 3. Django’s request life cycle flow chart 1. Add, delete, modify and check data 1. Display of user list Query all user […]

Django+MySQL data desensitization and encryption access

1. Overview In the Django project, desensitizing the user name and password registered by the front-end client (after encrypting it) and storing it in the target database MySQL can be achieved through the following steps: Install the necessary libraries: Make sure that password hashing libraries such as bcrypt or passlib are installed in the current […]

Django website building process (4) Create document display page

Django website building process (4) Create document display page Create document display page The file urls.py in the project main folder schoolapps Create url.py file in APP “baseapps” Write view Template inheritance bootstrap Create head.html Create doclist.html Create docdetail.html Use markdown editor Install module Modifications defined in the documents of the Model model: Execute makemigrations […]

web framework and Django

web application What is web A web application is an application that can be accessed through the Web. The biggest benefit of the program is that it is easy for users to access the application. Users only need to have a browser and do not need to install other software. The application has two modes: […]