Skip to content

Instantly share code, notes, and snippets.

@odigity
Last active July 27, 2022 16:06
Show Gist options
  • Save odigity/ecf91cc8331a16847d0ab8a4d426f6ac to your computer and use it in GitHub Desktop.
Save odigity/ecf91cc8331a16847d0ab8a4d426f6ac to your computer and use it in GitHub Desktop.
Django 3.2.14 Defaults

Project & App Templates

The django-admin startproject <name> command renders the project template. The ./manage.py startapp <name> command renders the app template.

The Python files there are named with a -TPL extension to prevent *.pyc (bytecode) files from being generated. The template loading logic strips it off.

The template renderer will populate the following tags:

  • {{ django_version }}
  • {{ docs_version }}
  • {{ project_name }}
  • {{ secret_key }}
auth_group
id
name varchar(150) NOT NULL UNIQUE
auth_group_permissions
id
group_id integer NOT NULL REFERENCES "auth_group"("id") DEFERRABLE INITIALLY DEFERRED
permission_id integer NOT NULL REFERENCES "auth_permission"("id") DEFERRABLE INITIALLY DEFERRED
auth_permission
id
content_type_id integer NOT NULL REFERENCES "django_content_type"("id") DEFERRABLE INITIALLY DEFERRED
codename varchar(100) NOT NULL
name varchar(255) NOT NULL
auth_user
id
password varchar(128) NOT NULL
last_login datetime NULL
is_superuser bool NOT NULL
username varchar(150) NOT NULL UNIQUE
last_name varchar(150) NOT NULL
email varchar(254) NOT NULL
is_staff bool NOT NULL
is_active bool NOT NULL
date_joined datetime NOT NULL
first_name varchar(150) NOT NULL
auth_user_groups
id
user_id integer NOT NULL REFERENCES "auth_user"("id") DEFERRABLE INITIALLY DEFERRED
group_id integer NOT NULL REFERENCES "auth_group"("id") DEFERRABLE INITIALLY DEFERRED
auth_user_user_permissions
id
user_id integer NOT NULL REFERENCES "auth_user"("id") DEFERRABLE INITIALLY DEFERRED
permission_id integer NOT NULL REFERENCES "auth_permission"("id") DEFERRABLE INITIALLY DEFERRED
django_admin_log
id
action_time datetime NOT NULL
object_id text NULL
object_repr varchar(200) NOT NULL
change_message text NOT NULL
content_type_id integer NULL REFERENCES "django_content_type"("id") DEFERRABLE INITIALLY DEFERRED
user_id integer NOT NULL REFERENCES "auth_user"("id") DEFERRABLE INITIALLY DEFERRED
action_flag smallint unsigned NOT NULL CHECK("action_flag" >= 0)
django_content_type
id
app_label varchar(100) NOT NULL
model varchar(100) NOT NULL
django_migrations
id
app varchar(255) NOT NULL
name varchar(255) NOT NULL
applied datetime NOT NULL
django_session
session_key varchar(40) NOT NULL PRIMARY KEY
session_data text NOT NULL
expire_date datetime NOT NULL
/admin/ django.contrib.admin.sites.index admin:index
/admin/<app_label>/ django.contrib.admin.sites.app_index admin:app_list
/admin/<url> django.contrib.admin.sites.catch_all_view
/admin/auth/group/ django.contrib.admin.options.changelist_view admin:auth_group_changelist
/admin/auth/group/<path:object_id>/ django.views.generic.base.RedirectView
/admin/auth/group/<path:object_id>/change/ django.contrib.admin.options.change_view admin:auth_group_change
/admin/auth/group/<path:object_id>/delete/ django.contrib.admin.options.delete_view admin:auth_group_delete
/admin/auth/group/<path:object_id>/history/ django.contrib.admin.options.history_view admin:auth_group_history
/admin/auth/group/add/ django.contrib.admin.options.add_view admin:auth_group_add
/admin/auth/user/ django.contrib.admin.options.changelist_view admin:auth_user_changelist
/admin/auth/user/<id>/password/ django.contrib.auth.admin.user_change_password admin:auth_user_password_change
/admin/auth/user/<path:object_id>/ django.views.generic.base.RedirectView
/admin/auth/user/<path:object_id>/change/ django.contrib.admin.options.change_view admin:auth_user_change
/admin/auth/user/<path:object_id>/delete/ django.contrib.admin.options.delete_view admin:auth_user_delete
/admin/auth/user/<path:object_id>/history/ django.contrib.admin.options.history_view admin:auth_user_history
/admin/auth/user/add/ django.contrib.auth.admin.add_view admin:auth_user_add
/admin/autocomplete/ django.contrib.admin.sites.autocomplete_view admin:autocomplete
/admin/jsi18n/ django.contrib.admin.sites.i18n_javascript admin:jsi18n
/admin/login/ django.contrib.admin.sites.login admin:login
/admin/logout/ django.contrib.admin.sites.logout admin:logout
/admin/password_change/ django.contrib.admin.sites.password_change admin:password_change
/admin/password_change/done/ django.contrib.admin.sites.password_change_done admin:password_change_done
/admin/r/<int:content_type_id>/<path:object_id>/ django.contrib.contenttypes.views.shortcut admin:view_on_site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment