Django
A Python framework for creating websites and web apps.
# Notes
Use timezone.now()
instead of datetime
stuff.
python manage.py shell
to open a shell and interact with Django API. Can write stuff to databases!
|
|
When sending POST request, use {% csrf_token %}
. Whatever that means.
forloop.counter
indicates how many times the for
tag has gone through its loop.
Should do .save()
to commit changes to DB.
To create a custom 404
page, just add 404.html
to templates folder. Don’t know why this works.
# Stuff to read later
- Django Views — The Right Way
- Tutorials | LearnDjango.com
- Making queries
- Passing variable from django template to view
- How to redirect to previous page in Django after POST request - Stack Overflow