Skip to content

Django Quick Start

mgale456 edited this page Nov 23, 2019 · 5 revisions

Overview of where we're at:

Hopefully this will help you jump in and understand the code and what's going on.

Django organizes stuff as a "project" and "app" Our project is "composeexample" and our app is "team_management" I don't foresee us needing another app, since most of our stuff is intertwined, but we might in the future.

We currently have 3 active urls (This structure will change soon, I think): /teams/ /teams/game (/teams/game1/) /teams/game/

the websocket is currently served to /ws/game/ (we can have multiple connected here, and use this url to have different handlers for websockets on different pages)

The most important documents to edit are:

  • html templates inside team_management/templates/team_management/
  • team_management/consumers.py - receives websocket communication
  • team_management/urls.py - routes urls and calls a function in views.py
  • team_management/views.py - queries the database and then renders the html templates

Other important files (that shouldn't change much):

  • team_management/models.py - Defines the database schema

Jargon Overview:

Models: Django's name for database tables. They are a class in Python. A single object of this class is equivalent to one row in the DB

Clone this wiki locally