Python Django Crash Course 2019 – Download

In this Django 2.x crash course we will build a polling app based off the one from the docs. We will look at apps, views, models, urls, the shell and more.


Gist With Commands:

Django Crash Course Commands

# Install pipenv
pip install pipenv
# Create Venv
pipenv shell
# Install Django
pipenv install django
# Create project
django-admin startproject pollster
cd pollster
# Run server on http: (ctrl+c to stop)
python runserver
# Run initial migrations
python migrate
# Create polls app
python startapp polls
# Create polls migrations
python makemigrations polls
# Run migrations
python migrate
# Using the shell
python shell

>>>  from polls.models import Question, Choice
>>>  from django.utils import timezone
>>>  Question.objects.all()
>>>  q = Question(question_text="What is your favorite Python Framework?",
>>>  q.question_text
>>>  Question.objects.all()
>>>  Question.objects.filter(id=1)
>>>  Question.objects.get(pk=1)
>>>  q = Question.objects.get(pk=1)
>>>  q.choice_set.all()
>>>  q.choice_set.create(choice_text='Django', votes=0)
>>>  q.choice_set.create(choice_text='Flask', votes=0)
>>>  q.choice_set.create(choice_text='Flask', votes=0)
>>>  q.choice_set.all()
>>>  quit()
# Create admin user
python createsuperuser
# Create pages app
python startapp pages

Continuation of this app by adding charts – by Dennis Ivy

Udemy Course Promo:

Sponsor: DevMountain Bootcamp

Become a Patron: Show support & get perks!

Udemy Courses:

Follow Traversy Media:


Do you love us?, Please donate to us ,thank you. BTC 38WPVc3xMYmoMp1GcnpDXd1fEzbfgujsCB Etherum 0x6c11844FD079b2490CDd44039e1C2f0940d098dc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.