In the coming 4 days we're going to introduce you to the powerful Django web framework, building a simple quote app. First I will introduce you to Django as a framework and explain how it differs from a micro-framework like Flask.
Then we install Django and create a project and app. We will go over typical configuration options, URL routing, working with a database / Django's ORM and CRUD (Create, Read, Update, Delete) operations with function and class based views. This also touches upon Django's templating engine. Finally we make it look nice using the MUI CSS framework.
This provides all the info to get started with Django. As Django might have a steep learning curve, I think it is best to teach you in two sessions. So after consuming half of the materials ...
After taking in the materials of yesterday's videos set up the quote project/ app yourself. Or feel free to start your own app. Maybe you have an idea for an app, a burning desire to build something. Usually scratching your own itch you can get very far. I learned a lot of Django myself building our coding platform. Refer back to the videos and get Django working, then set up your first model(s) and play with the objects in the Django Shell.
If you already know Django, go straight into one of our Django code challenges:
- Code Challenge 29 - Create a Simple Django App: create a Django app and PR your work.
- Lacking ideas? Code Challenge 33 - Build a Django Tracker, Weather or Review App gives you some ideas. Same here: build it, PR it, (if you want) share it!
Have fun and learn a lot!
Watch the second half of my videos where we build out the app to support adding, updating and deleting quotes. We look at forms, the admin back-end, function vs. class based views, templating, and handling static files to add some nice CSS. We want to make it look nice too right?
Now with some more Django lessons in, try get my example app up and running. You can type along, or use the demo code in this day's directory directly. All playing helps to solidify your learning.
Of course if you started an interesting app during Day 2., you probably should pick up on that and build it out. Either way, all the time you spend actually practicing with Django you learn a lot more than if you would have only watched the videos.
Good luck and again: the learning is in the practice.
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag #100DaysOfWeb.
Here are some examples to inspire you. Consider including @talkpython and @pybites in your tweets.
See a mistake in these instructions? Please submit a new issue or fix it and submit a PR.