🔗 Eduonix online course
-
Create Django project
django-admin.py startproject learnpython
python manage.py runserver
-
Create Django application in the project
python manage.py startapp msg
-
Configure settings.py and add the new app
-
Sync the database
python manage.py makemigrations python manage.py migrate
-
Use shell to insert data
python manage.py shell from msg.models import Message Message.objects.all() testmessage = Message(message="test message", username="testuser") Message.objects.all() msgobj = Message.objects.all() msgobj[0].message msgobj[0].username exit()