Django learning notes and project production process

 pip install django Create project Enter the d:\projects directory and execute Django admin startproject bysms Create the following directory structure: bysms / project root         manage.py is a tool script used for project management The bysms / directory is a python package. It contains importan ...

Posted by yeldarb on Wed, 05 Jan 2022 03:34:03 +0100

Django's open source full-text search framework - Haystack

Haystack 1. What is Haystack Haystack is Django's open-source full-text search framework (full-text search is different from fuzzy queries in specific fields, and it is more efficient to use full-text search). The framework supports Solr,Elasticsearch,Whoosh, **Xapian search engines. It is a pluggable back end (much like Django's database ...

Posted by samuraitux on Mon, 03 Jan 2022 01:02:45 +0100

django2.2——18. Cache framework

1, Django caching framework When a dynamic website receives every user request, it will perform operations such as querying the database and rendering templates. These operations are much more expensive and not necessarily necessary than simply reading files from the file system. Therefore, we can save the calculation results and directly ...

Posted by gfrank on Sun, 02 Jan 2022 20:50:24 +0100

Django database operations

CRUD (add, delete, modify, query) 1 increase There are two ways to add data. 1)save By creating a model class object, execute the save() method of the object and save it to the database. >>> from datetime import date >>> book = BookInfo( btitle='Journey to the West', bpub_date=date(1988,1,1), bread=10, bcomm ...

Posted by dwfait on Sun, 02 Jan 2022 19:52:22 +0100

2021-08-04-dj-027 send mail in Django, set QQ mailbox, and log logger send mail to administrator

The password and account settings in the source code need to be added by yourself : finish the source code of this section 1, Email specific people 1. Open mail service If you want to send mail, you must first have an email, open relevant services, and then the email will give you an authorization code. Here is a demonstration of Netease ...

Posted by melrse on Sat, 01 Jan 2022 13:12:08 +0100

Some knowledge points in Django

preface django and vue are used Tip: the following is the main content of this article. The following cases can be used for reference 1, setting configuration after installation Static resource allocation templates configuration static (note the last comma, the data type is tuple) STATICFILES_DIRS = ( os.path.join(BASE_DIR, "st ...

Posted by The Bat on Sat, 01 Jan 2022 01:58:18 +0100

Python Django's settings Py parsing

Novice on the road, please help correct the mistakes in the article. The information in the article is compiled from English websites and videos, and some translations may also need correction. Thank you in advance! """ Django settings for myFirstDjango project. Generated by 'django-admin startproject' using Django 3.1. For more information ...

Posted by The Bat on Fri, 31 Dec 2021 14:19:20 +0100

Tell you some basic Python methods you don't know about

When in if perhaps while Statement, or as the operand of the following Boolean operation, an object will be checked to determine whether a value is true By default, an object, if its class defines an object that returns False __bool__() Function, or a function that returns 0 __len__() Function, then it will be judged as false. In other cases, ...

Posted by Henks on Tue, 28 Dec 2021 00:57:28 +0100

Tanabata Festival is coming soon. Those with objects and those without objects must be magical. Make a fireworks show in Python

Today is Wednesday, and there are three days left for Tanabata Festival. I'm afraid it's too late to buy gifts for my girlfriend! Then what shall I do? Then prepare a fireworks video for her. But not everyone can set off fireworks in the whole city except local tyrants. I can only think about an ordinary one. Although the dream is far away, I ...

Posted by bigbob on Sun, 26 Dec 2021 08:01:29 +0100

Today, Tsinghua senior told you that the library in python had better be converted from pdf to docx. This library is very easy to use

environment windows 10 64 bitanaconda with python 3.7pdf2docx 0.5.2 preface Converting PDF files into word files is a very common operation. I believe that most people's free solution is to use some online conversion services, but there will be a problem of data leakage. This article introduces an open source free local conversion tool, pdf2d ...

Posted by parijat_php on Mon, 20 Dec 2021 12:33:55 +0100