Skip to main content

===== dnoticias_backoffice

This package contains all the utilities/components/templates used in the dnoticias.pt backoffices. Our objective is to have in one place the most used HTML components/layouts, this will standardize all the sites and will allow more easy theme/components updates.

Settings

  1. Add the following variables to the project settings
# Base full URL (like https://subdomain.example.com)
BASE_URL = ""
# Verbose site name (like Edição, Assinaturas, etc)
SITE_NAME = ""
  1. Add the context processor in your settings and the slippers builtin (to avoid writing {% load slippers %} in every template where we use components).
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, "templates")],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'dnoticias_backoffice.context_processors.backoffice',  # <-
            ],
            "builtins": ["slippers.templatetags.slippers"],  # <-
        },
    },
]
  1. Add 'slippers' and 'dnoticias_backoffice' into your installed apps
INSTALLED_APPS = [
    ...
    'dnoticias_backoffice',
    'slippers',
    ...
]

How to load custom components

This project already has his own components, to load custom components without crashing the project you just need to create a py file (e.g: components.py) in the project folder (where the settings.py file is located at), create a function called e.g: load_custom_components(), inside this function you will call the register_components function (https://mitchel.me/slippers/docs/registering-components/) and finally, go to your apps.py file, locate or create the def ready() function and then import and add the load_custom_components() function call.

How to add/update/remove menu items

Create a menu.py file inside the project folder (where the settings.py file is located at), create a function called e.g: load_menu(), inside this function you need to call register_menu_item function imported from dnoticias_backoffice.menu. When you finally defined all the menu items you need to import and call the load_menu() function into the def ready() function on the apps.py file (just like we call the custom components)

Project templates structure

templates/components includes all the slipper components used along the backoffice. templates/backoffice includes the masters templates and includes.

Metadata

Release files for dnoticias-backoffice 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dnoticias-backoffice 2.0.1
File Size Uploaded Provenance Actions
dnoticias_backoffice-2.0.1.tar.gz 47.7 MB Without provenance Details for dnoticias_backoffice-2.0.1.tar.gz

Release files / dnoticias_backoffice-2.0.1.tar.gz

Download URL dnoticias_backoffice-2.0.1.tar.gz
Size 47.7 MB
Tags Source
SHA-256 checksum
How to use checksums
bc1863527df5b677d00dc4680261ff37f4a24d052e1282ed80fb9f1f9360d3ab
BLAKE2b-256 checksum
How to use checksums
845d9725baac1d2f6e433cfccc162dec5da3c289ae46e3f10c427e220a7f8829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Security for dnoticias-backoffice 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page