Django Rest Framework serialization component

drf serialization component Basic use urls.py from django.urls import re_path urlpatterns = [ re_path(r'books/$', views.BookView.as_view()), re_path(r'books/(?P<pk>\d+)/$', views.BookFilterView.as_view()), ] serialization class from rest_framework import serializers class BookSerializer(serializers.Serializer): title = seri ...

Posted by robcrozier on Fri, 13 Dec 2019 17:54:49 +0100

Python Django Basics

As the most popular web framework of python, django has been loved by the majority of Python. This site is based on django. Therefore, it is necessary to summarize some basic knowledge of django to lead beginners into the python web world. 1. Basic knowledge1.1.django command parsingpython manager.py "commands" is the encapsulation ...

Posted by delassus on Sun, 08 Dec 2019 07:12:25 +0100

Oauth2.0 social ABCD micro blog third party login

Third party login of python website, social auth app Django module, The social auth app Django module is a third-party login OAuth2 protocol module for Django At present, the popular third-party login adopts OAuth2 protocol   Installation:   pip install social-auth-app-django     settings.py configuration: INSTALLED_APPS = [ 'django.cont ...

Posted by topflight on Sat, 07 Dec 2019 22:39:49 +0100

Using mysql steps in django framework

On the basis of creating django project, explain the use of orm framework Note: first, create a database manually or by command in mysql, and I will create a database named orm. 1: configure mysql database link string and time zone configuration in settings.py file in project folder # Registered app INSTALLED_APPS = [ 'teacher', ...

Posted by eddieblunt on Wed, 04 Dec 2019 18:24:33 +0100

damin management interface of django

Environmental Science: The physical machine is win7, the VM workstation 14 virtual machine software is installed, the virtual machine system is centos7, and the python version is 3.5.2. Define model class: ]# cd /root/py3/django-test1/test5 ]# vim bookshop/models.py from django.db import models class BookInfo(models.Model):     btitle = mode ...

Posted by jesse_james on Sun, 01 Dec 2019 23:09:58 +0100

Django and Python build personal blogs and websites

Build a personal blog Preface: Why do I blog?Why did I start blogging? I'm not a big fan This article tells me, not only me, but also the new rookie like meTo write a blog and build a website is not to show off knowledge, or to entertain, but to summarize their knowledge, improve the structure system, and express their feelings Get to the point ...

Posted by audiomove on Sun, 17 Nov 2019 15:17:34 +0100

Model description and problem collection of Django frame model

1. How to determine whether modal is successful? Open the database directly, and check whether there are tables you created and whether the table structure is consistent in the database Open the user model / migrations / directory to view the PY file inside. 0001 ﹣ initial.py is the PY generated during the initial generation ...

Posted by janm2009 on Tue, 12 Nov 2019 19:25:02 +0100

Django framework learning - getting started - project completion (1.7)

The basic knowledge points are all finished. Next, complete the sample project Li The code needed now includes three aspects, which are in no order. 1. Define view 2. Define URLconf 3. Define template Definition view Write the file booktest/views.py as follows: from django.shortcuts import render from booktest.m ...

Posted by KeeganWolf on Sat, 09 Nov 2019 20:30:34 +0100

Notes on the use of include tab in template language

  Include ABCD tags are mostly used to return html code fragments (mostly used in master build) First, create a new package of templatetags in the app of django project (place the custom tags file in it) Then you need to import template and register in your own defined tags to instantiate a Library() object Add "include& ...

Posted by jweissig on Fri, 08 Nov 2019 21:10:17 +0100

Demo android face recognition based on rainbow soft face recognition

Participate in a competition to specify the face recognition function with soft rainbow. However, if you want to build your own face database for soft rainbow face recognition, you can only use it offline, you can't always put on a look. Just look at the soft rainbow Demo, and decide to use this simple method to achieve online face recognition: ...

Posted by Louis11 on Thu, 07 Nov 2019 16:38:07 +0100