config package

The app that handles configuration.

config.default_app_config = 'config.apps.SiteConfig'

The config class of the app.

Submodules

config.admin module

The admin models of the config app.

class config.admin.InfoPageForm(*args, **kwargs)[source]

Bases: django.contrib.flatpages.forms.FlatpageForm

Admin form for InfoPage.

class Meta[source]

Bases: object

fields = '__all__'
model

alias of django.contrib.flatpages.models.FlatPage

widgets = {'content': <MangAdventure.widgets.TinyMCE object>}
base_fields = {'content': <django.forms.fields.CharField object>, 'enable_comments': <django.forms.fields.BooleanField object>, 'registration_required': <django.forms.fields.BooleanField object>, 'sites': <django.forms.models.ModelMultipleChoiceField object>, 'template_name': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'url': <django.forms.fields.RegexField object>}
declared_fields = {'url': <django.forms.fields.RegexField object>}
class config.admin.InfoPageAdmin(model, admin_site)[source]

Bases: django.contrib.flatpages.admin.FlatPageAdmin

Admin model for InfoPage.

change_list_template = 'admin/change_list.html'
change_list_form

alias of django.forms.models.ModelForm

form

alias of InfoPageForm

fieldsets = ((None, {'fields': ('url', 'title', 'content')}),)
readonly_fields = ('url',)
list_filter = ()
has_add_permission(request)[source]

Return whether adding an InfoPage object is permitted.

Parameters

request (HttpRequest) – The original request.

Return type

bool

Returns

Always returns False.

has_delete_permission(request, obj=None)[source]

Return whether deleting an InfoPage object is permitted.

Parameters
  • request (HttpRequest) – The original request.

  • obj (Optional[InfoPage]) – The object to be deleted.

Return type

bool

Returns

Always returns False.

class config.admin.InfoPage(*args, **kwargs)[source]

Bases: django.contrib.flatpages.models.FlatPage

django.contrib.flatpages.admin.FlatPage proxy model.

exception DoesNotExist

Bases: django.contrib.flatpages.models.FlatPage.DoesNotExist

exception MultipleObjectsReturned

Bases: django.contrib.flatpages.models.FlatPage.MultipleObjectsReturned

class config.admin.Site(*args, **kwargs)[source]

Bases: django.contrib.sites.models.Site

django.contrib.sites.models.Site proxy model.

exception DoesNotExist

Bases: django.contrib.sites.models.Site.DoesNotExist

exception MultipleObjectsReturned

Bases: django.contrib.sites.models.Site.MultipleObjectsReturned

class config.admin.SiteAdmin(model, admin_site)[source]

Bases: django.contrib.sites.admin.SiteAdmin

Admin model for Site.

change_list_template = 'admin/change_list.html'
change_list_form

alias of django.forms.models.ModelForm

has_delete_permission(request, obj=None)[source]

Return whether deleting an Site object is permitted.

Parameters
  • request (HttpRequest) – The original request.

  • obj (Optional[Site]) – The object to be deleted.

Return type

bool

Returns

Returns False for the first site, otherwise calls django.contrib.admin.ModelAdmin.has_delete_permission().

class config.admin.Redirect(*args, **kwargs)[source]

Bases: django.contrib.redirects.models.Redirect

django.contrib.redirects.models.Redirect proxy model.

exception DoesNotExist

Bases: django.contrib.redirects.models.Redirect.DoesNotExist

exception MultipleObjectsReturned

Bases: django.contrib.redirects.models.Redirect.MultipleObjectsReturned

class config.admin.RedirectAdmin(model, admin_site)[source]

Bases: django.contrib.redirects.admin.RedirectAdmin

Admin model for Redirect.

change_list_template = 'admin/change_list.html'
change_list_form

alias of django.forms.models.ModelForm

config.apps module

App configuration.

config.apps.SCSS_VARS = '$main-bg: %(MAIN_BG_COLOR)s;\n$alter-bg: %(ALTER_BG_COLOR)s;\n$main-fg: %(MAIN_TEXT_COLOR)s;\n$alter-fg: %(ALTER_TEXT_COLOR)s;\n$shadow-color: %(SHADOW_COLOR)s;\n$font-family: %(FONT_NAME)s;\n'

Variables used to generate static/styles/_variables.scss.

class config.apps.SiteConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Configuration for the config app.

name = 'config'
verbose_name = 'Configuration'
verbose_name_plural = 'Configuration'
ready()[source]

Configure the site when the app is ready.

config.context_processors module

Custom context processors.

config.context_processors.extra_settings(request)[source]

Context processor which defines some settings variables.

  • MANGADV_VERSION: The current version of MangAdventure.

  • PAGE_URL: The complete absolute URI of the request.

  • CANON_URL: The absolute URI of the request minus the query string.

  • config: A reference to MangAdventure.settings.CONFIG.

Parameters

request (HttpRequest) – The current HTTP request.

Return type

Dict

Returns

A dictionary containing the variables.

config.urls module

The URLconf of the config app.

config.urls.info_page(request, url)
Alias for django.contrib.flatpages.views.flatpage().
If django-csp is installed, this is configured to allow custom styles & images in the page.
config.urls.urlpatterns = [<URLPattern 'info/' [name='info']>, <URLPattern 'privacy/' [name='privacy']>]

The URL patterns of the config app.