Python I / O advanced learning notes dynamic properties, new and metaclass programming

content: Upper: 1.property dynamic properties 2. The difference between "getattr" and "setattr" and their role in attribute searching 3. Property descriptor and property search process 4. Difference between new and init Next: 5. What are metaclasses and custom metaclasses 6. Implement orm with metaclass ==================== ...

Posted on Sat, 07 Dec 2019 06:12:59 -0800 by eskimowned

Upload files of django

The use environment is the same as the django article. Upload the file in django and add the upload page: To install pilot: ]# cd py3/django-test1/test5 ]# pip install pillow==3.4.1 If other versions have been installed before, it doesn't matter. After executing this command, it will be overwritten directly. Configure to add media directory ...

Posted on Fri, 06 Dec 2019 11:51:56 -0800 by daniminas

Django advanced auth integrated authentication module

auth authentication module is a user authentication module integrated in Django. auth authentication module method Method Interpretation auth.authenticate() Authentication verification auth.login(request,user) Encapsulate the authenticated user object auth.logout(request) Delete all session data and the cookie is invalid Example of ...

Posted on Fri, 06 Dec 2019 02:16:43 -0800 by PHP_PhREEEk

Preliminary experience of Django 3.0 asynchronous communication

The blogger has written a blog before, introducing the new features of Django 3.0, the most important of which is to add support for ASGI to realize full duplex asynchronous communication. On December 2, 2019, Django finally released version 3.0. With great expectation, let's try it! (ASGI official document address: https://asgi.readthedocs.io/ ...

Posted on Thu, 05 Dec 2019 02:08:27 -0800 by damienmcd

django's browser uses POST to submit forms, and the back end obtains data

The environment is the same as the previous django article. Note: use form submission to comment out the middleware crsf in settings.py. vim /root/py3/django-test1/test3/test3/settings.py MIDDLEWARE_CLASSES = (     #'django.middleware.csrf.CsrfViewMiddleware',     ... ) To configure view functions: vim /root/py3/django-test1/test3/booktest/v ...

Posted on Wed, 04 Dec 2019 08:11:22 -0800 by misty

Simple application of python tonado framework

In the previous article, we learned about the services of building tonado. For the convenience of our better use, we suggest that you follow the django framework to build. First, set up static to place static files such as js, jquery, etc Create templates file and put it into html Create upfile file to place the uploaded file Set up the views f ...

Posted on Tue, 03 Dec 2019 23:53:26 -0800 by Tainted Kitten

Using xadmin to override Django's admin

Install xadmin pip install xadmin may report an error pip install git+git://github.com/sshwsfc/xadmin.git   To use after installation, you need to register three app s in setting INSTALLED_APPS = [ .... #xadmin 'xadmin', 'crispy_forms', 'reversion', ] Modify the urls.py file in the root directory import xadmin xadmin.au ...

Posted on Tue, 03 Dec 2019 00:43:01 -0800 by buildernaut1

django - exception handling on JSON encoding format

This is an exception of the encoding format, because in the docking of the crawler meta service, when sending data through http, the packaged data package is not in the correct format string={'domain': 'android.myapp.com', 'url': 'https://android.myapp.com/myapp/searchAjax.htm?kw=MM%E5%BA%94%E7%94%A8%E5%95%86%E5%9C%BA&pns=&sid='} Becau ...

Posted on Mon, 02 Dec 2019 20:02:16 -0800 by Mythic Fr0st

Bulk insert data, custom pager

Catalog Using ajax with sweetalert Bulk [create bulk insert data Custom pager Using ajax with sweetalert Click to download Bootstrap-sweetalert One pass CV method: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> < ...

Posted on Mon, 02 Dec 2019 13:41:45 -0800 by wizardry

Vue usage steps

Catalog 1. Determine the bound data range 2. Define data 3. Call the defined data 4. Common methods of vue binding calls Write the view file views.py in advance from django.shortcuts import render def studentList(request): render(request,"student_v1.html",locals()) Routing file urls.py from Student.views import stu ...

Posted on Mon, 02 Dec 2019 04:16:33 -0800 by davieboy