文件名称:pg-django-jsonb:在Django中使用Postgres的JSONB字段
文件大小:11KB
文件格式:ZIP
更新时间:2024-04-15 15:16:28
Python
Django + Postgres JSONB 启动容器: docker-compose up -d运行迁移: docker-compose exec web python manage.py migrate输入Python shell: docker-compose exec web python manage.py shell运行模型命令: from pgdjangojsonb . models import Profile # Get all Profiles: Profile . objects . all () # Create a Profile without preferences: p = Profile ( name = "Sam" , preferences = {}) p . save () # Create a Profile with preferences
【文件预览】:
pg-django-jsonb-main
----Dockerfile(146B)
----pgdjangojsonb()
--------models.py(236B)
--------migrations()
--------settings.py(3KB)
--------urls.py(755B)
--------__pycache__()
--------__init__.py(0B)
--------wsgi.py(403B)
----manage.py(633B)
----docker-compose.yml(425B)
----readme.md(769B)
----requirements.txt(36B)