django-bigbuild¶
API¶
Context processors¶
bigbuild.context_processors.bigbuild |
Adds env-related context variables to the context. |
-
bigbuild.context_processors.
bigbuild
(request)¶ Adds env-related context variables to the context.
Exceptions¶
Custom exceptions and warnings
bigbuild.exceptions.BadMetadata |
A custom exception to raise when the page configuration file has malformed metadata. |
bigbuild.exceptions.MissingMetadataWarning |
|
bigbuild.exceptions.MissingRecommendedMetadataWarning |
A custom warning that will be raised when a published page is missing recommended metadata values. |
-
class
bigbuild.exceptions.
BadMetadata
(*args, **kwargs)¶ Bases:
exceptions.Exception
A custom exception to raise when the page configuration file has malformed metadata.
-
class
bigbuild.exceptions.
MissingRecommendedMetadataWarning
(page)¶ Bases:
bigbuild.exceptions.BaseWarning
A custom warning that will be raised when a published page is missing recommended metadata values.
For instance, things like a headline and description are not required to publish a page, but you’re likely to have bugs with how your page appears on social media if you lack them.
-
get_context_data
()¶ Returns the data to be passed into the message template as context.
-
Management commands¶
TK
Models¶
bigbuild.models.Page |
A custom page published via static.latimes.com |
bigbuild.models.ArchivedPage |
An archived custom page. |
bigbuild.models.PageList |
A list of all the Page and ArchivedPage objects in the application. |
-
class
bigbuild.models.
Page
(*args, **kwargs)¶ Bases:
bigbuild.models.base.BasePage
A custom page published via static.latimes.com
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
create_directory
(force=False, index_template_name=u'bigbuild/pages/default_index.html', index_template_context={})¶ Creates a new directory for the page.
Returns the path to the directory that has been created, which is the same as the self.page_directory_path property.
Throws an error if the directory already exists. You can force it to overwrite a pre-existing directory by submitting the force keyword argument as true.
-
delete
()¶ Delete the page directory.
-
frontmatter_path
¶ Returns the metadata.md path where this page will be configured.
-
get_template
(name)¶ Returns a Django template of the provided name ready to render.
-
write_checklist
()¶ Creates checklist.md in the page directory.
-
write_frontmatter
(path=None)¶ Creates metadata.yaml in the page directory, or a supplied target directory.
-
write_index
(template_name, template_context={})¶ Creates index.html in the page directory.
-
write_static
()¶ Creates a ./static/ subdirectory within the page directory.
-
exception
-
class
bigbuild.models.
ArchivedPage
(*args, **kwargs)¶ Bases:
bigbuild.models.base.BasePage
An archived custom page.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
delete
()¶ Delete the page directory.
-
frontmatter_path
¶ Returns the metadata.md path where this page will be configured.
-
exception
-
class
bigbuild.models.
PageList
¶ Bases:
_abcoll.Sequence
A list of all the Page and ArchivedPage objects in the application.
-
get_archived_pages
()¶ Returns a list of ArchivedPage objects ready to be built in this environment.
-
get_directory_list
(path)¶ Returns the list of slugged page modules in the provided directory.
-
get_dynamic_pages
()¶ Returns a list of Page objects ready to be built in this environment.
-
static
get_page
(slug, pagetype)¶ Returns a list of Page objects from the provided slug directory.
-