Skip to content

Latest commit

 

History

History

learn-python-programming-from-scratch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

🎓 🐍 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()