package for rest api
pip install djangorestframework
register admin url
py manage.py createsuperuser
py .\manage.py runserver
py .\manage.py makemigrations sr5_project_app
py .\manage.py migrate
py .\manage.py sqlmigrate sr5_project_app 0001
pip install mysqlclient
pip install psycopg2
pip install cx_Oracle
py .\manage.py shell
from sr5_project_app.models import Article
Article.objects.all() Article.objects.all().values()
x = Article() x.title = 'Welcome to lulu' x.content = 'Nice content' x.save()
x = Article.objects.all()[0] x.title = 'Love oun' x.save() x.delete()
y = Article(title='new title', content='Welcome to lulu') y.save()
quit()
=> should be migrate first
see documentation How is python manage.py createsuperuser useful? py manage.py createsuperuser
pip install Pillow