Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1001 Bytes

File metadata and controls

53 lines (35 loc) · 1001 Bytes

🎓 🐍 Learn Python programming From Scratch

🔗 Eduonix online course

Python Web Frameworks

Django Steps

  1. Create Django project

    django-admin.py startproject learnpython
    python manage.py runserver
  2. Create Django application in the project

    python manage.py startapp msg
  3. Configure settings.py and add the new app

  4. Sync the database

    python manage.py makemigrations
    python manage.py migrate
  5. 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()