thaliawebsite package

The main module for the Thalia website.

This module defines settings and the URI layout. We also handle some site-wide API stuff here.

Submodules

thaliawebsite.admin module

Settings for the admin site

thaliawebsite.context_processors module

These context processors can be used to expand the context provided tos views.

thaliawebsite.context_processors.source_commit(_)[source]

Get the SOURCE_COMMIT environment variable

thaliawebsite.context_processors.thumbnail_sizes(_)[source]

Get the defined sizes for thumbnails

thaliawebsite.forms module

Special forms

class thaliawebsite.forms.AuthenticationForm(request=None, *args, **kwargs)[source]

Bases: django.contrib.auth.forms.AuthenticationForm

Override the authentication form provided by Django

base_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
clean()[source]

Lowercase the username

declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
property media

Return all media required to render the widgets on this form.

thaliawebsite.menus module

This file defines the menu layout.

We set the variable :py:main to form the menu tree.

thaliawebsite.sitemaps module

Defines site maps.

class thaliawebsite.sitemaps.StaticViewSitemap[source]

Bases: django.contrib.sitemaps.Sitemap

Sitemap items for static pages

items()[source]

The items of the site map.

>>> sitemap = StaticViewSitemap()
>>> sitemap.items()[0]
'index'
Returns

the items in the site map

Return type

[str]

location(obj)[source]

Get the location for a site map item.

Example:

>>> sitemap = StaticViewSitemap()
>>> sitemap.location('index')
'/'
Parameters

obj (str) – the item to reverse.

Returns

the URI to the item.

thaliawebsite.urls module

Thalia’s root URL Configuration

The urlpatterns list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/dev/topics/http/urls/

Examples:

  • Function views

    1. Add an import: from my_app import views

    2. Add a URL to urlpatterns: path('', views.home, name='home')

  • Class-based views

    1. Add an import: from other_app.views import Home

    2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')

  • Including another URLconf

    1. Import the include() function:

      from django.conf.urls import url, include
      
    2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))

thaliawebsite.views module

General views for the website

class thaliawebsite.views.IndexView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

template_name = 'index.html'
class thaliawebsite.views.TestCrashView(**kwargs)[source]

Bases: django.views.generic.base.View

Test view to intentionally crash to test the error handling.

dispatch(request, *args, **kwargs) → django.http.response.HttpResponse[source]

thaliawebsite.wsgi module

WSGI config for thaliawebsite project.

It exposes the WSGI callable as a module-level variable named application.

For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/