django

Django Foreignkey Setting Allows To Be Empty

django ForeignKey (foreign key) setting allows to be empty for example ``` class Writer(mode…

Django3 Refused To Display 'Url' In A Frame Because It Set 'X-Frame-Options' To 'Deny'

## background When using django3 for development, because the project front-end page uses the if…

Django One App Corresponds To Multiple Databases (One App Multiple Databases) Connect Multiple Databases Settings

## background Due to project requirements, development is carried out in an embedded environment…

Django Error:Ipaddressfield Has Been Removed Except For Support In Historical Migrations

## background When using django to create a model, use `model.IPAddressField` to create a field.…

How To Check Sql Statement Generated For Model And Reverse Generation Model Of Existing Table In Django

## from model to sql statement ### Django 1.9 and below versions: ``` python manage.py sqlal…

How To Use Uuid Instead Of Id As The Primary Key Primary In Django

Whenever we create any new model, an ID field is appended. By default, the data type of the ID fiel…

How To Get Equivalent Sql Statement Corresponding To Django Orm

Sometimes you want to know how Django ORM makes our queries execute, or what the SQL corresponds to…

Django Orm Between And Usage

Django ORM between and usage ## sql statement ``` SELECT * FROM target WHERE ctime BETWEEN '…

Django Orm Uses Sql Statement To Perform Multi-Table Joint Query (Join On, Left Join)

## background Because the use of `Manager.raw ()` can not meet the needs of executing SQL statem…

Fielddoesnotexist: Raw Query Must Include The Primary Key

## environment * python3.7 * django 3.1 Use `model.object.raw(sql)` in django  triggered…