0
点赞
收藏
分享

微信扫一扫

django学习笔记

扶摇_hyber 2022-02-04 阅读 65
djangopython

Djangomemo

Ctrl+c to break

Python manage.py runserver

python manage.py make migrations

python manage.py migrate

django-admin

(startapp, startproject, createsuperuser etc

python manage.py

null = True/False means whether the value can be null

if blank = False , you can leave the field blank without getting an error.

def home_view():

return HttpResponse“

hello world

{{ request.user }} output username

also you can apply title filter to username like{{ request.user|title }}

request.user.is_authenticated

{% block content %)

this does’t have to be always content, you can name it with other things like content_area or whatever. Name blocks differently to distinguish them

{% endblock %}

include, or say, copy, html template documents in current html file {% include “xxx.html” %}

举报

相关推荐

0 条评论