Django

MVC web framework from 2003

  • comes with ORM, form system, template, caching, middleware support, unit testing, and internationalization

Running

poetry run python manage.py runserver
poetry run python manage.py runserver 4000 #set port
poetry run python manage.py shell #shell with settings.py so DB access

Basics

Default Project Files

  • mysite/ manage.py - same as django-admin but uses settings.py mysite/ _init_.py settings.py urls.py - routes asgi.py - entrypoint for asgi web servers wsgi.py - entrypoint for wsgi web servers

Default App Files

  • polls/ _init_.py admin.py apps.py migrations/ _init_.py models.py tests.py urls.py views.py

Last updated