Giter Club home page Giter Club logo

tj-django / django-view-breadcrumbs Goto Github PK

View Code? Open in Web Editor NEW
74.0 3.0 8.0 976 KB

Breadcrumb mixins for django views. Create breadcrumbs in seconds.

Home Page: https://tj-django.github.io/django-view-breadcrumbs/#/

License: BSD 3-Clause "New" or "Revised" License

Python 84.46% Makefile 10.73% HTML 4.81%
breadcrumbs django-bootstrap-breadcrumbs listview detailview breadcrumb-mixins django-breadcrumbs django django-views breadcrumb-mixin urlpatterns

django-view-breadcrumbs's Introduction

django-view-breadcrumbs

Test Codacy Badge pre-commit.ci status Codacy Badge PyPI version

PyPI - Django Version PyPI - Python Version Downloads

All Contributors

Table of Contents

Background

This package provides a set of breadcrumb mixin classes that can be added to any django class based view and requires adding just {% render_breadcrumbs %} to the base template.

breadcrumbs

In the base.html template add the render_breadcrumbs tag and any template that inherits the base should have breadcrumbs included.

Example:

my_app
   |--templates
            |--base.html
            |--create.html

base.html

{% load view_breadcrumbs %}

{% block breadcrumbs %}
    {% render_breadcrumbs %} {# Optionally provide a custom template e.g {% render_breadcrumbs "view_breadcrumbs/bootstrap5.html" %} #}
{% endblock %}

And your create.html.

{% extends "base.html" %}

Installation

$ pip install django-view-breadcrumbs

Add view_breadcrumbs to your INSTALLED_APPS

INSTALLED_APPS = [
    ...,
    "view_breadcrumbs",
    ...,
]

Breadcrumb mixin classes provided.

  • BaseBreadcrumbMixin - Subclasses requires a crumbs class property.
  • CreateBreadcrumbMixin - For create views Home / Posts / Add Post
  • DetailBreadcrumbMixin - For detail views Home / Posts / Post 1
  • ListBreadcrumbMixin - For list views Home / Posts
  • UpdateBreadcrumbMixin - For Update views Home / Posts / Post 1 / Update Post 1
  • DeleteBreadcrumbMixin - For Delete views this has a link to the list view to be used as the success URL.

Settings

NOTE ⚠️

  • Make sure that "django.template.context_processors.request" is added to your TEMPLATE OPTIONS setting.
TEMPLATES  = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request", # <- This context processor is required
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

Modify the defaults using the following:

Name Default Description Options
BREADCRUMBS_TEMPLATE "view_breadcrumbs/bootstrap5.html" Template used to render breadcrumbs. Predefined Templates
BREADCRUMBS_HOME_LABEL Home Default label for the root path

Customization

BREADCRUMBS_TEMPLATE

Site wide
BREADCRUMBS_TEMPLATE = "my_app/breadcrumbs.html"
Overriding the breadcrumb template for a single view

Update the base.html

{% render_breadcrumbs "my_app/breadcrumbs.html" %}

BREADCRUMBS_HOME_LABEL

Site wide
BREADCRUMBS_HOME_LABEL = "My new home"
Overriding the Home label for a specific view
from django.utils.translation import gettext_lazy as _
from view_breadcrumbs import DetailBreadcrumbMixin
from django.views.generic import DetailView
from demo.models import TestModel


class TestDetailView(DetailBreadcrumbMixin, DetailView):
     model = TestModel
     home_label = _("My new home")
     template_name = "demo/test-detail.html"

Renders

custom-root-breadcrumb

Example

translated-crumbs

Usage

django-view-breadcrumbs includes generic mixins that can be added to a class based view.

Using the generic breadcrumb mixin each breadcrumb will be added to the view dynamically and can be overridden by providing a crumbs property.

View Configuration

NOTE: ⚠️

  • Model based views should use a pattern view_name=model_verbose_name_{action}
Actions View Class View name Sample Breadcrumb Example
list ListView {model.verbose_name}_list Home / Posts Posts Example
create CreateView {model.verbose_name}_create Home / Posts / Add Post
detail DetailView {model.verbose_name}_detail Home / Posts / Test - Post
change UpdateView {model.verbose_name}_update Home / Posts / Test - Post / Update Test - Post
delete DeleteView {model.verbose_name}_delete N/A
N/A TemplateView N/A N/A See: Custom View
N/A FormView N/A N/A See: Custom View
N/A AboutView N/A N/A See: Custom View
N/A View N/A N/A See: Custom View
Actions View Class View name Sample Breadcrumb Example
N/A SingleTableMixin N/A N/A See: demo table view
N/A MultiTableMixin N/A N/A See: demo table view
N/A SingleTableView N/A N/A Same implementation as SingleTableMixin

For more examples see: demo app

URL Configuration

Based on the table of actions listed above there's a strict view_name requirement that needs to be adhered to in order for breadcrumbs to work.

This can be manually entered in your urls.py or you can optionally use the following class properties instead of hardcoding the view_name.

...
    path("tests/", TestListsView.as_view(), name=TestListsView.list_view_name),
    path(
        "tests/<slug:slug>/",
        TestDetailView.as_view(),
        name=TestDetailView.detail_view_name,
    ),
    path(
        "tests/<slug:slug>/update/",
        TestUpdateView.as_view(),
        name=TestUpdateView.update_view_name,
    ),
    path(
        "tests/<slug:slug>/delete/",
        TestDeleteView.as_view(),
        name=TestDeleteView.delete_view_name,
    ),
...

Examples

Sample crumbs: Posts

In your urls.py

  urlpatterns = [
      ...
      path("posts/", views.PostList.as_view(), name="post_list"),
      ...
      # OR
      ...
      path("posts/", views.PostList.as_view(), name=views.PostList.list_view_name),
      ...
  ]

All crumbs use the home root path / as the base this can be excluded by specifying add_home = False

from django.views.generic import ListView
from view_breadcrumbs import ListBreadcrumbMixin


class PostList(ListBreadcrumbMixin, ListView):
    model = Post
    template_name = "app/post/list.html"
    add_home = False

Sample crumbs: Home / Posts / Test - Post

In your urls.py

  urlpatterns = [
      ...
      path("posts/<slug:slug>/", views.PostDetail.as_view(), name="post_detail"),
      ...
      # OR
      ...
      path("posts/<slug:slug>/", views.PostDetail.as_view(), name=views.PostDetail.detail_view_name),
      ...
  ]

views.py

from django.views.generic import DetailView
from view_breadcrumbs import DetailBreadcrumbMixin


class PostDetail(DetailBreadcrumbMixin, DetailView):
    model = Post
    template_name = "app/post/detail.html"
    breadcrumb_use_pk = False

Custom crumbs: Home / My Test Breadcrumb

URL configuration.

    urlpatterns = [
       path("my-custom-view/", views.CustomView.as_view(), name="custom_view"),
    ]

views.py

from django.urls import reverse
from django.views.generic import View
from view_breadcrumbs import BaseBreadcrumbMixin
from demo.models import TestModel


class CustomView(BaseBreadcrumbMixin, View):
    model = TestModel
    template_name = "app/test/custom.html"
    crumbs = [("My Test Breadcrumb", reverse("custom_view"))]  # OR reverse_lazy

OR

from django.urls import reverse
from django.views.generic import View
from view_breadcrumbs import BaseBreadcrumbMixin
from demo.models import TestModel
from django.utils.functional import cached_property


class CustomView(BaseBreadcrumbMixin, View):
    template_name = "app/test/custom.html"

    @cached_property
    def crumbs(self):
        return [("My Test Breadcrumb", reverse("custom_view"))]

Refer to the demo app for more examples.

Using multiple apps

To reference models from a different application you need to override the app_name class attribute.

Example: Using a Library model that is imported from a custom application that you want to render in a demo app view.

INSTALLED_APPS =  [
    ...
    "demo",
    "custom",
    ...
]

demo/views.py

class LibraryDetailView(DetailBreadcrumbMixin, DetailView):
    model = Library
    app_name = "demo"
    ...

Running locally

$ git clone [email protected]:tj-django/django-view-breadcrumbs.git
$ make install-dev
$ make migrate
$ make run

Spins up a django server running the demo app.

Visit http://127.0.0.1:8090

Credits

To file a bug or submit a patch, please head over to django-view-breadcrumbs on github.

If you feel generous and want to show some extra appreciation:

Support me with a ⭐

Buy me a coffee

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Derek

📖

David THENON

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

django-view-breadcrumbs's People

Contributors

allcontributors[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar jackton1 avatar krunchmuffin avatar lgtm-com[bot] avatar pre-commit-ci[bot] avatar pyup-bot avatar renovate-bot avatar renovate[bot] avatar repo-ranger[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-view-breadcrumbs's Issues

Need custom home label

Currently home label is static, but it's no good for projects that have locales other than just English. Needs to be configurable as well.

CVE-2022-41323 (Medium) detected in Django-3.2.15-py3-none-any.whl - autoclosed

CVE-2022-41323 - Medium Severity Vulnerability

Vulnerable Library - Django-3.2.15-py3-none-any.whl

A high-level Python web framework that encourages rapid development and clean, pragmatic design.

Library home page: https://files.pythonhosted.org/packages/db/f9/9ddc8444397ed7e72c52f63b48ecc2849ae1ca4d621776399a81e501ee3c/Django-3.2.15-py3-none-any.whl

Path to dependency file: /tmp/ws-scm/django-view-breadcrumbs

Path to vulnerable library: /tmp/ws-scm/django-view-breadcrumbs

Dependency Hierarchy:

  • Django-3.2.15-py3-none-any.whl (Vulnerable Library)

Found in base branch: main

Vulnerability Details

In Django 3.2 before 3.2.16, 4.0 before 4.0.8, and 4.1 before 4.1.2, internationalized URLs were subject to a potential denial of service attack via the locale parameter, which is treated as a regular expression.

Publish Date: 2022-10-16

URL: CVE-2022-41323

CVSS 3 Score Details (5.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Local
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-41323

Release Date: 2022-10-16

Fix Resolution: Django - 3.2.16,4.0.8,4.1.2


Step up your Open Source Security Game with Mend here

[BUG] ListView - 'main' is not a registered namespace

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Django 4, bootstrap5

settings.py file:
ROOT_URLCONF = 'main.urls'

in main/urls.py:
app_name="main"
urlpatterns = [
...
path('conferences/', main_views.ConferenceListView.as_view(), name='conferences_list'),
...]

in my view.py:
class ConferenceListView(LoginRequiredMixin, PermissionRequiredMixin, ListBreadcrumbMixin, ListView):
model = Conference
template_name = 'conference/conference_list.html'
permission_required = ('main.do_student_things',)
app_name = "main"
...

everything works fine and as expected until I added the "ListBreadCrumbMixin" to this view.
If I remove it, all works fine again.

I am unclear as to where I am supposed to define the app_name to make it work, but it is not doing so even though I have defined it in they urls.py and the view

Any guidance would be welcome.
Thanks

To Reproduce

  1. Run server
  2. home page crashes with the error 'main' is not a registered namespace

What OS are you seeing the problem on?

macOS

Expected behavior?

Simply to have a breadcrumb for my listView class

Relevant log output

NoReverseMatch at /conferences/
'main' is not a registered namespace
Request Method:	GET
Request URL:	http://127.0.0.1:8000/conferences/
Django Version:	4.0.6
Exception Type:	NoReverseMatch
Exception Value:	
'main' is not a registered namespace
Exception Location:	/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/urls/base.py, line 82, in reverse
Python Executable:	/Users/paul/Src/tsa_mgmt/bin/python
Python Version:	3.9.2
Python Path:	
['/Users/paul/Src/tsa_mgmt',
 '/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev',
 '/Applications/PyCharm.app/Contents/plugins/python/helpers/third_party/thriftpy',
 '/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev',
 '/Users/paul/Src/tsa_mgmt',
 '/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_display',
 '/Users/paul/Library/Caches/JetBrains/PyCharm2022.3/cythonExtensions',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python39.zip',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload',
 '/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages',
 '/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend']
Server time:	Mon, 16 Jan 2023 01:22:24 -0500
Traceback Switch to copy-and-paste view
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/urls/base.py, line 71, in reverse
                extra, resolver = resolver.namespace_dict[ns] …
Local vars
During handling of the above exception ('main'), another exception occurred:
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/core/handlers/exception.py, line 55, in inner
                response = get_response(request) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/core/handlers/base.py, line 197, in _get_response
                response = wrapped_callback(request, *callback_args, **callback_kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/views/generic/base.py, line 84, in view
            return self.dispatch(request, *args, **kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/contrib/auth/mixins.py, line 73, in dispatch
        return super().dispatch(request, *args, **kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/contrib/auth/mixins.py, line 109, in dispatch
        return super().dispatch(request, *args, **kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/views/generic/base.py, line 119, in dispatch
        return handler(request, *args, **kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/views/generic/list.py, line 174, in get
        context = self.get_context_data() …
Local vars
/Users/paul/Src/tsa_mgmt/main/views.py, line 163, in get_context_data
        context = super().get_context_data(**kwargs) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/view_breadcrumbs/generic/base.py, line 69, in get_context_data
        self.update_breadcrumbs(ctx) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/view_breadcrumbs/generic/base.py, line 44, in update_breadcrumbs
        crumbs = self.crumbs …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/view_breadcrumbs/generic/list.py, line 31, in crumbs
        return [(self.model_name_title_plural, self.list_view_url)] …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/view_breadcrumbs/generic/list.py, line 27, in list_view_url
        return reverse(self.__list_view_name) …
Local vars
/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages/django/urls/base.py, line 82, in reverse
                    raise NoReverseMatch("%s is not a registered namespace" % key) …
Local vars
Request information
USER
[email protected]

GET
No GET data

POST
No POST data

FILES
No FILES data

COOKIES
Variable	Value
csrftoken	
'w6FzoBWMbslD5EBf0s1oFHEQvh13som9ZwJHI01bUrJ0dA0W45gAiSZhxPORWMmd'
sessionid	
'wob2kxf9c30vijugk9w0nn60jsaokd9o'
META
Variable	Value
CONTENT_LENGTH	
''
CONTENT_TYPE	
'text/plain'
CSRF_COOKIE	
'w6FzoBWMbslD5EBf0s1oFHEQvh13som9ZwJHI01bUrJ0dA0W45gAiSZhxPORWMmd'
DJANGO_ENVIRONMENT	
'pbh_dev'
DJANGO_SETTINGS_MODULE	
'main.settings'
GATEWAY_INTERFACE	
'CGI/1.1'
HOME	
'/Users/paul'
HTTP_ACCEPT	
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
HTTP_ACCEPT_ENCODING	
'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE	
'en-US,en;q=0.9'
HTTP_CONNECTION	
'keep-alive'
HTTP_COOKIE	
('csrftoken=w6FzoBWMbslD5EBf0s1oFHEQvh13som9ZwJHI01bUrJ0dA0W45gAiSZhxPORWMmd; '
 'sessionid=wob2kxf9c30vijugk9w0nn60jsaokd9o')
HTTP_HOST	
'127.0.0.1:8000'
HTTP_SEC_CH_UA	
'"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"'
HTTP_SEC_CH_UA_MOBILE	
'?0'
HTTP_SEC_CH_UA_PLATFORM	
'"macOS"'
HTTP_SEC_FETCH_DEST	
'document'
HTTP_SEC_FETCH_MODE	
'navigate'
HTTP_SEC_FETCH_SITE	
'none'
HTTP_SEC_FETCH_USER	
'?1'
HTTP_UPGRADE_INSECURE_REQUESTS	
'1'
HTTP_USER_AGENT	
('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, '
 'like Gecko) Chrome/108.0.0.0 Safari/537.36')
IDE_PROJECT_ROOTS	
'/Users/paul/Src/tsa_mgmt'
IPYTHONENABLE	
'True'
LC_CTYPE	
'en_US.UTF-8'
LIBRARY_ROOTS	
'/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9:/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload:/Users/paul/Src/tsa_mgmt/lib/python3.9/site-packages:/Users/paul/Library/Caches/JetBrains/PyCharm2022.3/python_stubs/-1389234663:/Applications/PyCharm.app/Contents/plugins/python/helpers/python-skeletons:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stdlib:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/six:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/boto:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/mock:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pytz:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/toml:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/annoy:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/babel:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/emoji:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/first:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/fpdf2:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/ldap3:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/polib:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/redis:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/regex:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/retry:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/ujson:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/bleach:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/caldav:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/docopt:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/hdbcli:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/invoke:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/passpy:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Pillow:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/psutil:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pycurl:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pynput:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pysftp:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/PyYAML:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/stripe:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/xxhash:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/appdirs:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/certifi:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/chardet:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/chevron:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/passlib:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyaudio:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/PyMySQL:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyvmomi:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/slumber:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/tzlocal:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/urllib3:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/vobject:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/aiofiles:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/colorama:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/croniter:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/docutils:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/filelock:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/html5lib:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/httplib2:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/jmespath:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Markdown:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/oauthlib:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/openpyxl:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/paramiko:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/psycopg2:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyflakes:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Pygments:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/requests:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/selenium:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/tabulate:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/toposort:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/waitress:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/braintree:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/decorator:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/freezegun:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/playsound:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyOpenSSL:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyRFC3339:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/termcolor:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/ttkthemes:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/typed-ast:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/xmltodict:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/cachetools:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/commonmark:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/dateparser:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Deprecated:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Flask-Cors:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/frozendict:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/jsonschema:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pyfarmhash:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Send2Trash:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/setuptools:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/simplejson:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/SQLAlchemy:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/contextvars:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/dataclasses:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/entrypoints:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-2020:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/JACK-Client:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/mysqlclient:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/opentracing:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pep8-naming:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/prettytable:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/python-jose:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/python-nmap:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/stdlib-list:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/atomicwrites:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/aws-xray-sdk:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/cryptography:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/editdistance:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/parsimonious:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/whatthepatch:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/click-spinner:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/DateTimeRange:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/humanfriendly:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/python-gflags:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/beautifulsoup4:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/characteristic:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-bugbear:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/python-slugify:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/singledispatch:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-builtins:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-simplify:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/mypy-extensions:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/python-dateutil:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/Flask-SQLAlchemy:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-docstrings:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-plugin-utils:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/pytest-lazy-fixture:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-rst-docstrings:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/flake8-typing-imports:/Applications/PyCharm.app/Contents/plugins/python/helpers/typeshed/stubs/backports.ssl_match_hostname'
LOGNAME	
'paul'
PATH	
'/Users/paul/Src/tsa_mgmt/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin'
PATH_INFO	
'/conferences/'
PS1	
'(tsa_mgmt) '
PWD	
'/Users/paul/Src/tsa_mgmt'
PYCHARM_DISPLAY_PORT	
'63342'
PYCHARM_HOSTED	
'1'
PYDEVD_LOAD_VALUES_ASYNC	
'True'
PYTHONIOENCODING	
'UTF-8'
PYTHONPATH	
'/Applications/PyCharm.app/Contents/plugins/python/helpers/third_party/thriftpy:/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev:/Users/paul/Src/tsa_mgmt:/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend:/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_display:/Users/paul/Library/Caches/JetBrains/PyCharm2022.3/cythonExtensions:/Users/paul/Src/tsa_mgmt'
PYTHONUNBUFFERED	
'1'
QUERY_STRING	
''
REMOTE_ADDR	
'127.0.0.1'
REMOTE_HOST	
''
REQUEST_METHOD	
'GET'
RUN_MAIN	
'true'
SCRIPT_NAME	
''
SERVER_NAME	
'1.0.0.127.in-addr.arpa'
SERVER_PORT	
'8000'
SERVER_PROTOCOL	
'HTTP/1.1'
SERVER_SOFTWARE	
'WSGIServer/0.2'
SHELL	
'/bin/bash'
SSH_AUTH_SOCK	
'/private/tmp/com.apple.launchd.iu5xaLDnD4/Listeners'
TMPDIR	
'/var/folders/yf/vz8ggk094sd34spzgb5cbygw0000gn/T/'
TZ	
'America/New_York'
USER	
'paul'
VIRTUAL_ENV	
'/Users/paul/Src/tsa_mgmt'
XPC_FLAGS	
'0x0'
XPC_SERVICE_NAME	
'0'
__CF_USER_TEXT_ENCODING	
'0x1F5:0x0:0x0'
wsgi.errors	
<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>
wsgi.file_wrapper	
<class 'wsgiref.util.FileWrapper'>
wsgi.input	
<django.core.handlers.wsgi.LimitedStream object at 0x7fbcf9e73a30>
wsgi.multiprocess	
False
wsgi.multithread	
True
wsgi.run_once	
False
wsgi.url_scheme	
'http'
wsgi.version	
(1, 0)
Settings
Using settings module main.settings
Setting	Value
ABSOLUTE_URL_OVERRIDES	
{}
ADMINS	
[]
ALLOWED_HOSTS	
['*']
APPEND_SLASH	
True
AUTHENTICATION_BACKENDS	
['django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS	
'********************'
AUTH_USER_MODEL	
'accounts.User'
BASE_DIR	
PosixPath('/Users/paul/Src/tsa_mgmt')
BREADCRUMBS_HOME_LABEL	
'Conferences'
BREADCRUMBS_TEMPLATE	
'view_breadcrumbs/bootstrap5.html'
BROWSER_TAB_TITLE	
'TSA Club Management'
CACHES	
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS	
'default'
CACHE_MIDDLEWARE_KEY_PREFIX	
'********************'
CACHE_MIDDLEWARE_SECONDS	
600
CKEDITOR_UPLOAD_PATH	
'ckeditor_uploads/'
CRISPY_ALLOWED_TEMPLATE_PACKS	
'bootstrap5'
CRISPY_TEMPLATE_PACK	
'bootstrap5'
CSRF_COOKIE_AGE	
31449600
CSRF_COOKIE_DOMAIN	
None
CSRF_COOKIE_HTTPONLY	
False
CSRF_COOKIE_NAME	
'csrftoken'
CSRF_COOKIE_PATH	
'/'
CSRF_COOKIE_SAMESITE	
'Lax'
CSRF_COOKIE_SECURE	
False
CSRF_FAILURE_VIEW	
'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME	
'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS	
[]
CSRF_USE_SESSIONS	
False
DATABASES	
{'default': {'ATOMIC_REQUESTS': False,
             'AUTOCOMMIT': True,
             'CONN_MAX_AGE': 0,
             'ENGINE': 'django.db.backends.sqlite3',
             'HOST': '',
             'NAME': PosixPath('/Users/paul/Src/tsa_mgmt/db.sqlite3'),
             'OPTIONS': {},
             'PASSWORD': '********************',
             'PORT': '',
             'TEST': {'CHARSET': None,
                      'COLLATION': None,
                      'MIGRATE': True,
                      'MIRROR': None,
                      'NAME': None},
             'TIME_ZONE': None,
             'USER': ''}}
DATABASE_OPTION	
'local_sqlite'
DATABASE_OPTIONS	
{'local_sqlite': {'ATOMIC_REQUESTS': False,
                  'AUTOCOMMIT': True,
                  'CONN_MAX_AGE': 0,
                  'ENGINE': 'django.db.backends.sqlite3',
                  'HOST': '',
                  'NAME': PosixPath('/Users/paul/Src/tsa_mgmt/db.sqlite3'),
                  'OPTIONS': {},
                  'PASSWORD': '********************',
                  'PORT': '',
                  'TEST': {'CHARSET': None,
                           'COLLATION': None,
                           'MIGRATE': True,
                           'MIRROR': None,
                           'NAME': None},
                  'TIME_ZONE': None,
                  'USER': ''},
 'python_anywhere_MySQL': {'ENGINE': 'django.db.backends.mysql',
                           'HOST': 'PaulHermans.mysql.pythonanywhere-services.com',
                           'NAME': 'PaulHermans$default',
                           'PASSWORD': '********************',
                           'USER': 'PaulHermans'}}
DATABASE_ROUTERS	
[]
DATA_UPLOAD_MAX_MEMORY_SIZE	
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS	
1000
DATETIME_FORMAT	
'm/d/y g:i:s u'
DATETIME_INPUT_FORMATS	
['%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M']
DATE_FORMAT	
'm/d/y'
DATE_INPUT_FORMATS	
['%m/%d/%Y',
 '%m/%d/%y',
 '%Y-%m-%d',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y']
DEBUG	
True
DEBUG_PROPAGATE_EXCEPTIONS	
False
DEBUG_TOOLBAR	
True
DECIMAL_SEPARATOR	
'.'
DEFAULT_AUTO_FIELD	
'django.db.models.BigAutoField'
DEFAULT_CHARSET	
'utf-8'
DEFAULT_EXCEPTION_REPORTER	
'django.views.debug.ExceptionReporter'
DEFAULT_EXCEPTION_REPORTER_FILTER	
'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE	
'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL	
'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE	
''
DEFAULT_TABLESPACE	
''
DISALLOWED_USER_AGENTS	
[]
EMAIL_BACKEND	
'django.core.mail.backends.console.EmailBackend'
EMAIL_DEVELOPERS	
['[email protected]']
EMAIL_HOST	
'smtp.gmail.com'
EMAIL_HOST_PASSWORD	
'********************'
EMAIL_HOST_USER	
None
EMAIL_PORT	
587
EMAIL_SSL_CERTFILE	
None
EMAIL_SSL_KEYFILE	
'********************'
EMAIL_SUBJECT_PREFIX	
'[Django] '
EMAIL_TIMEOUT	
None
EMAIL_TO_RECIPIENTS	
False
EMAIL_USE_LOCALTIME	
False
EMAIL_USE_SSL	
False
EMAIL_USE_TLS	
True
FILE_UPLOAD_DIRECTORY_PERMISSIONS	
None
FILE_UPLOAD_HANDLERS	
['django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE	
2621440
FILE_UPLOAD_PERMISSIONS	
420
FILE_UPLOAD_TEMP_DIR	
None
FIRST_DAY_OF_WEEK	
0
FIXTURE_DIRS	
[]
FORCE_SCRIPT_NAME	
None
FORMAT_MODULE_PATH	
None
FORM_RENDERER	
'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS	
[]
INSTALLED_APPS	
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_extensions',
 'adminsortable2',
 'colorfield',
 'ckeditor',
 'crispy_forms',
 'crispy_bootstrap5',
 'sort_order_field',
 'view_breadcrumbs',
 'accounts',
 'main',
 'django_cleanup.apps.CleanupConfig',
 'debug_toolbar']
INTERNAL_IPS	
['127.0.0.1']
LANGUAGES	
[('af', 'Afrikaans'),
 ('ar', 'Arabic'),
 ('ar-dz', 'Algerian Arabic'),
 ('ast', 'Asturian'),
 ('az', 'Azerbaijani'),
 ('bg', 'Bulgarian'),
 ('be', 'Belarusian'),
 ('bn', 'Bengali'),
 ('br', 'Breton'),
 ('bs', 'Bosnian'),
 ('ca', 'Catalan'),
 ('cs', 'Czech'),
 ('cy', 'Welsh'),
 ('da', 'Danish'),
 ('de', 'German'),
 ('dsb', 'Lower Sorbian'),
 ('el', 'Greek'),
 ('en', 'English'),
 ('en-au', 'Australian English'),
 ('en-gb', 'British English'),
 ('eo', 'Esperanto'),
 ('es', 'Spanish'),
 ('es-ar', 'Argentinian Spanish'),
 ('es-co', 'Colombian Spanish'),
 ('es-mx', 'Mexican Spanish'),
 ('es-ni', 'Nicaraguan Spanish'),
 ('es-ve', 'Venezuelan Spanish'),
 ('et', 'Estonian'),
 ('eu', 'Basque'),
 ('fa', 'Persian'),
 ('fi', 'Finnish'),
 ('fr', 'French'),
 ('fy', 'Frisian'),
 ('ga', 'Irish'),
 ('gd', 'Scottish Gaelic'),
 ('gl', 'Galician'),
 ('he', 'Hebrew'),
 ('hi', 'Hindi'),
 ('hr', 'Croatian'),
 ('hsb', 'Upper Sorbian'),
 ('hu', 'Hungarian'),
 ('hy', 'Armenian'),
 ('ia', 'Interlingua'),
 ('id', 'Indonesian'),
 ('ig', 'Igbo'),
 ('io', 'Ido'),
 ('is', 'Icelandic'),
 ('it', 'Italian'),
 ('ja', 'Japanese'),
 ('ka', 'Georgian'),
 ('kab', 'Kabyle'),
 ('kk', 'Kazakh'),
 ('km', 'Khmer'),
 ('kn', 'Kannada'),
 ('ko', 'Korean'),
 ('ky', 'Kyrgyz'),
 ('lb', 'Luxembourgish'),
 ('lt', 'Lithuanian'),
 ('lv', 'Latvian'),
 ('mk', 'Macedonian'),
 ('ml', 'Malayalam'),
 ('mn', 'Mongolian'),
 ('mr', 'Marathi'),
 ('ms', 'Malay'),
 ('my', 'Burmese'),
 ('nb', 'Norwegian Bokmål'),
 ('ne', 'Nepali'),
 ('nl', 'Dutch'),
 ('nn', 'Norwegian Nynorsk'),
 ('os', 'Ossetic'),
 ('pa', 'Punjabi'),
 ('pl', 'Polish'),
 ('pt', 'Portuguese'),
 ('pt-br', 'Brazilian Portuguese'),
 ('ro', 'Romanian'),
 ('ru', 'Russian'),
 ('sk', 'Slovak'),
 ('sl', 'Slovenian'),
 ('sq', 'Albanian'),
 ('sr', 'Serbian'),
 ('sr-latn', 'Serbian Latin'),
 ('sv', 'Swedish'),
 ('sw', 'Swahili'),
 ('ta', 'Tamil'),
 ('te', 'Telugu'),
 ('tg', 'Tajik'),
 ('th', 'Thai'),
 ('tk', 'Turkmen'),
 ('tr', 'Turkish'),
 ('tt', 'Tatar'),
 ('udm', 'Udmurt'),
 ('uk', 'Ukrainian'),
 ('ur', 'Urdu'),
 ('uz', 'Uzbek'),
 ('vi', 'Vietnamese'),
 ('zh-hans', 'Simplified Chinese'),
 ('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI	
['he', 'ar', 'ar-dz', 'fa', 'ur']
LANGUAGE_CODE	
'en-us'
LANGUAGE_COOKIE_AGE	
None
LANGUAGE_COOKIE_DOMAIN	
None
LANGUAGE_COOKIE_HTTPONLY	
False
LANGUAGE_COOKIE_NAME	
'django_language'
LANGUAGE_COOKIE_PATH	
'/'
LANGUAGE_COOKIE_SAMESITE	
None
LANGUAGE_COOKIE_SECURE	
False
LOCALE_PATHS	
[]
LOGGING	
{}
LOGGING_CONFIG	
'logging.config.dictConfig'
LOGIN_REDIRECT_URL	
'home'
LOGIN_URL	
'login'
LOGOUT_REDIRECT_URL	
'home'
MANAGERS	
[]
MEDIA_ROOT	
PurePosixPath('/Users/paul/Src/tsa_mgmt/media')
MEDIA_URL	
'/media/'
MESSAGE_STORAGE	
'django.contrib.messages.storage.fallback.FallbackStorage'
MESSAGE_TAGS	
{10: 'alert-secondary',
 20: 'alert-info',
 25: 'alert-success',
 30: 'alert-warning',
 40: 'alert-danger'}
MIDDLEWARE	
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']
MIGRATION_MODULES	
{}
MONTH_DAY_FORMAT	
'F j'
NUMBER_GROUPING	
0
PASSWORD_HASHERS	
'********************'
PASSWORD_RESET_TIMEOUT	
'********************'
PREPEND_WWW	
False
ROOT_URLCONF	
'main.urls'
SECRET_KEY	
'********************'
SECURE_CONTENT_TYPE_NOSNIFF	
True
SECURE_CROSS_ORIGIN_OPENER_POLICY	
'same-origin'
SECURE_HSTS_INCLUDE_SUBDOMAINS	
False
SECURE_HSTS_PRELOAD	
False
SECURE_HSTS_SECONDS	
0
SECURE_PROXY_SSL_HEADER	
None
SECURE_REDIRECT_EXEMPT	
[]
SECURE_REFERRER_POLICY	
'same-origin'
SECURE_SSL_HOST	
None
SECURE_SSL_REDIRECT	
False
SERVER_EMAIL	
'root@localhost'
SESSION_CACHE_ALIAS	
'default'
SESSION_COOKIE_AGE	
1209600
SESSION_COOKIE_DOMAIN	
None
SESSION_COOKIE_HTTPONLY	
True
SESSION_COOKIE_NAME	
'sessionid'
SESSION_COOKIE_PATH	
'/'
SESSION_COOKIE_SAMESITE	
'Lax'
SESSION_COOKIE_SECURE	
False
SESSION_ENGINE	
'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE	
False
SESSION_FILE_PATH	
None
SESSION_SAVE_EVERY_REQUEST	
False
SESSION_SERIALIZER	
'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE	
'main.settings'
SHORT_DATETIME_FORMAT	
'm/d/Y P'
SHORT_DATE_FORMAT	
'm/d/Y'
SIGNING_BACKEND	
'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS	
[]
STATICFILES_DIRS	
[PosixPath('/Users/paul/Src/tsa_mgmt/main/static')]
STATICFILES_FINDERS	
['django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder']
STATICFILES_STORAGE	
'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT	
PurePosixPath('/Users/paul/Src/tsa_mgmt/static')
STATIC_URL	
'/static/'
SYSTEM_EMAIL_SENDER	
'[email protected]'
TEMPLATES	
[{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': [],
  'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
                                     'django.template.context_processors.request',
                                     'django.contrib.auth.context_processors.auth',
                                     'django.contrib.messages.context_processors.messages',
                                     'main.custom_context_processor.get_current_path',
                                     'main.custom_context_processor.get_global_settings']}}]
TEST_NON_SERIALIZED_APPS	
[]
TEST_RUNNER	
'django.test.runner.DiscoverRunner'
THIS_DIR	
'/Users/paul/Src/tsa_mgmt/main/settings'
THOUSAND_SEPARATOR	
','
TIME_FORMAT	
'P'
TIME_INPUT_FORMATS	
['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE	
'America/New_York'
USE_DEPRECATED_PYTZ	
False
USE_I18N	
False
USE_L10N	
False
USE_THOUSAND_SEPARATOR	
True
USE_TZ	
True
USE_X_FORWARDED_HOST	
False
USE_X_FORWARDED_PORT	
False
WSGI_APPLICATION	
'main.wsgi.application'
X_FRAME_OPTIONS	
'DENY'
YEAR_MONTH_FORMAT	
'F Y'

Anything else?

I am happy to send entire files, but don't see how I do that here.

Code of Conduct

  • I agree to follow this project's Code of Conduct

CVE-2024-4340 (High) detected in sqlparse-0.4.4-py3-none-any.whl

CVE-2024-4340 - High Severity Vulnerability

Vulnerable Library - sqlparse-0.4.4-py3-none-any.whl

A non-validating SQL parser.

Library home page: https://files.pythonhosted.org/packages/98/5a/66d7c9305baa9f11857f247d4ba761402cea75db6058ff850ed7128957b7/sqlparse-0.4.4-py3-none-any.whl

Path to dependency file: /tmp/ws-scm/django-view-breadcrumbs

Path to vulnerable library: /tmp/ws-scm/django-view-breadcrumbs

Dependency Hierarchy:

  • sqlparse-0.4.4-py3-none-any.whl (Vulnerable Library)

Found in base branch: main

Vulnerability Details

Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.

Publish Date: 2024-04-30

URL: CVE-2024-4340

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.cve.org/CVERecord?id=CVE-2024-4340

Release Date: 2024-04-30

Fix Resolution: sqlparse - 0.5.0


Step up your Open Source Security Game with Mend here

CVE-2016-10735 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2016-10735 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap 3.x before 3.4.0 and 4.x-beta before 4.0.0-beta.2, XSS is possible in the data-target attribute, a different vulnerability than CVE-2018-14041.

Publish Date: 2019-01-09

URL: CVE-2016-10735

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: twbs/bootstrap#20184

Release Date: 2019-01-09

Fix Resolution: 3.4.0


Step up your Open Source Security Game with WhiteSource here

CVE-2018-20676 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2018-20676 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap before 3.4.0, XSS is possible in the tooltip data-viewport attribute.

Publish Date: 2019-01-09

URL: CVE-2018-20676

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20676

Release Date: 2019-01-09

Fix Resolution: bootstrap - 3.4.0


Step up your Open Source Security Game with WhiteSource here

Drop support for python3.5

Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will 
remove support for this functionality.

CVE-2021-44420 (High) detected in Django-3.2.9-py3-none-any.whl

CVE-2021-44420 - High Severity Vulnerability

Vulnerable Library - Django-3.2.9-py3-none-any.whl

A high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Library home page: https://files.pythonhosted.org/packages/a8/ca/e88eb097959c48cd313dfc4bc394699a48fe5c158ed3a64c13e4fa46c1fd/Django-3.2.9-py3-none-any.whl

Path to dependency file: django-view-breadcrumbs

Path to vulnerable library: django-view-breadcrumbs

Dependency Hierarchy:

  • Django-3.2.9-py3-none-any.whl (Vulnerable Library)

Found in HEAD commit: cfffe328fab8d89f2a4528716a4c53cc22b63e78

Found in base branch: main

Vulnerability Details

In Django 2.2 before 2.2.25, 3.1 before 3.1.14, and 3.2 before 3.2.10, HTTP requests for URLs with trailing newlines could bypass upstream access control based on URL paths.

Publish Date: 2021-12-08

URL: CVE-2021-44420

CVSS 3 Score Details (7.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://docs.djangoproject.com/en/3.2/releases/security/

Release Date: 2021-12-08

Fix Resolution: Django - 2.2.25,3.1.14,3.2.10


Step up your Open Source Security Game with WhiteSource here

CVE-2022-36359 (High) detected in Django-3.2.14-py3-none-any.whl - autoclosed

CVE-2022-36359 - High Severity Vulnerability

Vulnerable Library - Django-3.2.14-py3-none-any.whl

A high-level Python web framework that encourages rapid development and clean, pragmatic design.

Library home page: https://files.pythonhosted.org/packages/c0/a8/4afc7742ad1e506909ce8c5056761f22c8a2db0a8b4a46cfa290b1cd6685/Django-3.2.14-py3-none-any.whl

Path to dependency file: /tmp/ws-scm/django-view-breadcrumbs

Path to vulnerable library: /tmp/ws-scm/django-view-breadcrumbs

Dependency Hierarchy:

  • Django-3.2.14-py3-none-any.whl (Vulnerable Library)

Found in base branch: main

Vulnerability Details

An issue was discovered in the HTTP FileResponse class in Django 3.2 before 3.2.15 and 4.0 before 4.0.7. An application is vulnerable to a reflected file download (RFD) attack that sets the Content-Disposition header of a FileResponse when the filename is derived from user-supplied input.

Publish Date: 2022-08-03

URL: CVE-2022-36359

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: High
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.djangoproject.com/weblog/2022/aug/03/security-releases/

Release Date: 2022-08-03

Fix Resolution: Django -3.2.15,4.0.7,4.1


Step up your Open Source Security Game with Mend here

i18n/l10n support

When I add verbose_name and verbose_name_plural to a model's Meta, the breadcrumbs are as expected. However, even though I use gettext_lazy, the breadcrumbs are never translated and instead show the (english) untranslated string. Everything else in my application is translating correctly.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Custom app_label for view using another app's model

I have some views using model from another app, when the view is executed raise an exception NoReverseMatch because django-view-bradcrumbs asume the app of the view is in the model app.

I think it can be fixed by adding a new attribute in the class BaseBreadcrumbMixin.

class BaseBreadcrumbMixin(object):
    ...
    app_name = None #custom app name

Also modify the function action_view_name to adding a new parameter called app_name.

def action_view_name(model, action, full=True, app_name=None):
    if app_name:
        app_label = app_name
        model_name = get_model_name(model)
    else:
        app_label, model_name = get_app_name(model)

And then modify the mixins:

class ListBreadcrumbMixin(BaseModelBreadcrumbMixin):
    # Home / object List

    @classproperty
    def list_view_name(self):
        return action_view_name(self.model, self.list_view_suffix, full=False, app_name=self.app_name)

...

With all that I could use with my view that uses a foreign model

class TestListsView(ListBreadcrumbMixin, ListView):
    app_name = 'foreignapp'
    model = ForeignModel
    template_name = "demo/test-list.html"

If there is another way to achieve this I would like to know. Thanks for the project.

CVE-2023-46695 (High) detected in Django-3.2.21-py3-none-any.whl - autoclosed

CVE-2023-46695 - High Severity Vulnerability

Vulnerable Library - Django-3.2.21-py3-none-any.whl

A high-level Python web framework that encourages rapid development and clean, pragmatic design.

Library home page: https://files.pythonhosted.org/packages/97/8d/03ac2f7a3f751f597be12c03a09147f9ca80906264044bb05758bbcc2b32/Django-3.2.21-py3-none-any.whl

Dependency Hierarchy:

  • Django-3.2.21-py3-none-any.whl (Vulnerable Library)

Found in HEAD commit: 4f267b5314b032c9de388aeb1653b03f28f84bf5

Found in base branch: main

Vulnerability Details

An issue was discovered in Django 3.2 before 3.2.23, 4.1 before 4.1.13, and 4.2 before 4.2.7. The NFKC normalization is slow on Windows. As a consequence, django.contrib.auth.forms.UsernameField is subject to a potential DoS (denial of service) attack via certain inputs with a very large number of Unicode characters.

Publish Date: 2023-11-02

URL: CVE-2023-46695

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://www.djangoproject.com/weblog/2023/nov/01/security-releases/

Release Date: 2023-10-25

Fix Resolution: Django - 3.2.23,4.1.13,4.2.7


Step up your Open Source Security Game with Mend here

[Feature] Add support of nested URLs

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

It looks impossible to handle nested URLs like this :
/libraries/1/books/1/

What would work currently is if we separate urls into :
/libraries/1/
and
/books/1/

Describe the solution you'd like?

I tried to play with the function list_view_url inside generic.list.py and found out that reverse(self.__list_view_name,kwargs=self.kwargs) would kind of work but breaks others things.
It would be a good start to continue playing with this but i'm too new to this repo to help anyone.

Maybe someone understands my problem ! I'll be happy to provide more help/infos if needed :)

Kind regards

Describe alternatives you've considered?

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Not working properly for createview

Sorry for opening another issue. Its working fine if I use model for CreateView just like in below screenshot.
Screenshot_20190723_072222
But if use forms, I'm getting errors like below.
Screenshot_20190723_072125

Screenshot_20190723_072329

Here is my Form
Screenshot_20190723_074158

Here is my model
Screenshot_20190723_075337

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

CVE-2019-8331 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2019-8331 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap before 3.4.1 and 4.3.x before 4.3.1, XSS is possible in the tooltip or popover data-template attribute.

Publish Date: 2019-02-20

URL: CVE-2019-8331

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: twbs/bootstrap#28236

Release Date: 2019-02-20

Fix Resolution: bootstrap - 3.4.1,4.3.1;bootstrap-sass - 3.4.1,4.3.1


Step up your Open Source Security Game with WhiteSource here

[BUG] Django 4.0 removed django.utils.encoding.smart_text

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Failure to load in a Django 4.x project due to the deprecated (and now-removed) smart_text alias in django.utils.encoding.

ImportError: cannot import name 'smart_text' from 'django.utils.encoding' (/--redacted--/lib/python3.8/site-packages/django/utils/encoding.py)

To Reproduce

  1. pip install django-views-breadcrumbs
  2. Add views_breadcrumbs to settings.py
  3. python manage.py runserver

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

I would expect the app to not crash

Relevant log output

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/--redacted--/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/--redacted--/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 115, in inner_run
    autoreload.raise_last_exception()
  File "/--redacted--/lib/python3.8/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "/--redacted--/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute
    autoreload.check_errors(django.setup)()
  File "/--redacted--/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/--redacted--/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/--redacted--/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/--redacted--/lib/python3.8/site-packages/django/apps/config.py", line 223, in create
    import_module(entry)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/--redacted--/lib/python3.8/site-packages/view_breadcrumbs/__init__.py", line 7, in <module>
    from .generic import (
  File "/--redacted--/lib/python3.8/site-packages/view_breadcrumbs/generic/__init__.py", line 1, in <module>
    from .base import BaseBreadcrumbMixin  # noqa
  File "/--redacted--/lib/python3.8/site-packages/view_breadcrumbs/generic/base.py", line 14, in <module>
    from ..templatetags.view_breadcrumbs import (
  File "/--redacted--/lib/python3.8/site-packages/view_breadcrumbs/templatetags/view_breadcrumbs.py", line 18, in <module>
    from django.utils.encoding import smart_text
ImportError: cannot import name 'smart_text' from 'django.utils.encoding' (/--redacted--/lib/python3.8/site-packages/django/utils/encoding.py)

Anything else?

Per Django 3.x release notes (https://docs.djangoproject.com/en/4.0/releases/3.0/#deprecated-features-3-0):

Features deprecated in 3.0¶
django.utils.encoding.force_text() and smart_text()¶
The smart_text() and force_text() aliases (since Django 2.0) of smart_str() and force_str() are deprecated. Ignore this deprecation if your code supports Python 2 as the behavior of smart_str() and force_str() is different there.

Per the Django 4.x release notes (https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0):

django.utils.encoding.force_text() and smart_text() are removed.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/auto-approve.yml
  • hmarr/auto-approve-action v3
.github/workflows/auto-merge.yml
  • pascalgn/automerge-action v0.16.3
.github/workflows/codacy-analysis.yml
  • actions/checkout v4
  • codacy/codacy-analysis-cli-action v4.4.0
  • github/codeql-action v3
.github/workflows/codeql.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/deploy.yml
  • actions/checkout v4
  • tj-actions/semver-diff v3.0.1
  • actions/setup-python v5
  • tj-actions/git-cliff v1
  • peter-evans/create-pull-request v6
.github/workflows/gh-pages.yml
  • actions/checkout v4
  • peaceiris/actions-gh-pages v4.0.0
.github/workflows/greetings.yml
  • actions/first-interaction v1
.github/workflows/pre-commit-auto-merge.yml
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4.0.2
  • actions/cache v4.0.2
  • codecov/codecov-action v4
.github/workflows/update-doc-assets.yml
  • actions/checkout v4.1.3
  • tj-actions/remark v3
  • tj-actions/verify-changed-files v19
  • peter-evans/create-pull-request v6
  • peter-evans/create-pull-request v6.0.4
pip_requirements
requirements.txt
  • asgiref ==3.8.1
  • django ==5.0.4
  • pytz ==2024.1
  • sqlparse ==0.5.0
pip_setup
setup.py
  • pluggy >=0.7

  • Check this box to trigger a request for Renovate to run again on this repository

Example for index page

Thanks for your works. But I'm facing problem when I'm trying to implement in index page please help me. I also want to pass custom httml class in template But i can't

Breadcrumbs on complex view.

I am having trouble figuring out how to get breadcrumbs working on a view that includes both a primary key and a foreign key. In this case there is a project content type (model) and projects can have notes associated with them. I have the breadcrumbs working until a user tries to view an individual note - projects/project/notes/note. I can't figure out how to get the select the relevant ids.

The view:

class ProjectNotesDetailView(DetailBreadcrumbMixin, FormMixin, DetailView):
    model = ProjectNotes
    id = ProjectNotes.objects.only('id')
    template_name = 'company_accounts/project_note_detail.html'
    comments = ProjectNotes.comments
    form_class = NoteCommentForm


    @cached_property
    def crumbs(self):
        project = self.get_object()
        return [
            ("Projects", reverse(
                "company_project:" + CompanyProjects.list_view_name, )
             ),
            (f"{project.title}",
             reverse(
                 "company_project:" + CompanyProjectsDetailView.detail_view_name,
                 kwargs={'pk': project.id})
             ),
            ("Notes", reverse(
                "company_project:" + ProjectNotesList.list_view_name,
                kwargs={'pk': project.id})
             ),
            (f"{ProjectNotes.title}",
             reverse(
                 "company_project:" + ProjectNotesDetailView.detail_view_name,
                 kwargs={'pk': project.id, 'note_pk': self.kwargs.get('pk')})
             ),
        ]

    def get_object(self):
        return get_object_or_404(Project, id=self.kwargs.get('pk'))

    def related_project(self, **kwargs):
        project = get_object_or_404(Project, id=self.kwargs.get('pk'))
        notes = ProjectNotes.objects.all()
        return notes

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)

        context['project'] = get_object_or_404(Project, id=self.kwargs.get('pk'))
        return context

    def form_valid(self, form):
        projectnote = get_object_or_404(ProjectNotes, id=self.kwargs.get('pk'))
        comment = form.save(commit=False)
        comment.projectnote = projectnote
        comment.created_by = self.request.user
        comment.save()
        return super().form_valid(form)

    def get_success_url(self):
        return reverse('company_project:project_note_detail', args=[self.kwargs.get('pk'), (self.object.id)])

    def post(self, request, *args, **kwargs):
        if not request.user.is_authenticated:
            return HttpResponseForbidden()
        self.object = self.get_object()
        form = self.get_form()
        if form.is_valid():
            return self.form_valid(form)
        else:
            return self.form_invalid(form)

The URL:

path('project/<int:project_pk>/note/<int:pk>/', ProjectNotesDetailView.as_view(), name='projectnotes_detail'),

The models:

class Project(models.Model):
    title = models.CharField(max_length= 200)
    description = tinymce_models.HTMLField()
    status = models.CharField(max_length=20, choices=PROJECT_CHOICES, default="active")
    date = models.DateTimeField(auto_now_add=True, null=True)
    created_by = models.ForeignKey(CustomUser, editable=False, null=True, blank=True, on_delete=models.RESTRICT)
    tags = tagulous.models.TagField(to=SiteWideTags, blank=True, related_name='projects_tags')

    def __str__(self):
        return self.title

    def get_absolute_url(self):
        return reverse('company_project:project_detail', args=[str(self.id)])
class ProjectNotes(models.Model):
    title = models.CharField(max_length=200)
    body = tinymce_models.HTMLField()
    project = models.ForeignKey(Project, default=0, blank=True, on_delete=models.CASCADE, related_name='notes')
    date = models.DateTimeField(auto_now_add=True, null=True)
    created_by = models.ForeignKey(CustomUser, editable=False, null=True, blank=True, on_delete=models.RESTRICT)

    def __str__(self):
        return self.title

    def get_absolute_url(self):
        return reverse('company_project:project_note_detail', args=[self.project_id, str(self.id)])

Any suggestions for solving this?

Breadcrumbs for custom views

I have the next view:

CompanyHistory(View):
    template_name = "history.html"
...

Url definition

...
path("company/<int:pk>/history/", CompanyHistory.as_view(), name="company_history"),
...

According to the documentation, it only supports the following actions:
image

Is there a way to include a custom action?

CVE-2018-14040 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2018-14040 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap before 4.1.2, XSS is possible in the collapse data-parent attribute.

Publish Date: 2018-07-13

URL: CVE-2018-14040

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: twbs/bootstrap#26630

Release Date: 2018-07-13

Fix Resolution: org.webjars.npm:bootstrap:4.1.2,org.webjars:bootstrap:3.4.0


Step up your Open Source Security Game with WhiteSource here

CVE-2023-43665 (Medium) detected in Django-3.2.21-py3-none-any.whl - autoclosed

CVE-2023-43665 - Medium Severity Vulnerability

Vulnerable Library - Django-3.2.21-py3-none-any.whl

A high-level Python web framework that encourages rapid development and clean, pragmatic design.

Library home page: https://files.pythonhosted.org/packages/97/8d/03ac2f7a3f751f597be12c03a09147f9ca80906264044bb05758bbcc2b32/Django-3.2.21-py3-none-any.whl

Dependency Hierarchy:

  • Django-3.2.21-py3-none-any.whl (Vulnerable Library)

Found in HEAD commit: 4f267b5314b032c9de388aeb1653b03f28f84bf5

Found in base branch: main

Vulnerability Details

Following the fix for CVE-2019-14232, the regular expressions used in the implementation of django.utils.text.Truncator’s chars() and words() methods (with html=True) were revised and improved. However, these regular expressions still exhibited linear backtracking complexity, so when given a very long, potentially malformed HTML input, the evaluation would still be slow, leading to a potential denial of service vulnerability.

Publish Date: 2023-09-22

URL: CVE-2023-43665

CVSS 3 Score Details (5.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://security-tracker.debian.org/tracker/CVE-2023-43665

Release Date: 2023-09-22

Fix Resolution: Django - 3.2.22,4.1.12,4.2.6


Step up your Open Source Security Game with Mend here

CVE-2018-20677 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2018-20677 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap before 3.4.0, XSS is possible in the affix configuration target property.

Publish Date: 2019-01-09

URL: CVE-2018-20677

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20677

Release Date: 2019-01-09

Fix Resolution: Bootstrap - v3.4.0;NorDroN.AngularTemplate - 0.1.6;Dynamic.NET.Express.ProjectTemplates - 0.8.0;dotnetng.template - 1.0.0.4;ZNxtApp.Core.Module.Theme - 1.0.9-Beta;JMeter - 5.0.0


Step up your Open Source Security Game with WhiteSource here

Attempting to add breadcrumbs to listview that is related to a detail view via a foreign key

I have been able to get breadcrumbs to work that displays a trail like:
home/projects/project1. However, I can't figure out how to display breadcrumbs on a notes list page of notes related to project1.

I have a list view "ProjectNotesList" that displays notes on specific projects. Notes are related to projects via a foreign key. When "ListBreadcrumbMixin" is added to the ProjectNotesList view I get the following error:

NoReverseMatch at /projects/project/1/notes/
Reverse for 'projectnotes_list' with no arguments not found. 1 pattern(s) tried: ['projects/project/(?P<pk>[0-9]+)/notes/\\Z']
Request Method: GET
Request URL:    http://co1.localhost:8000/projects/project/1/notes/
Django Version: 3.1.14
Exception Type: NoReverseMatch
Exception Value:    
Reverse for 'projectnotes_list' with no arguments not found. 1 pattern(s) tried: ['projects/project/(?P<pk>[0-9]+)/notes/\\Z']
Exception Location: /Users/user/.local/share/virtualenvs/osite-wGphEfbP/lib/python3.9/site-packages/django/urls/resolvers.py, line 689, in _reverse_with_prefix
Python Executable:  /Users/user/.local/share/virtualenvs/osite-wGphEfbP/bin/python
Python Version: 3.9.6
Python Path:    
['/Users/user/Desktop/otools',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python39.zip',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9',
 '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload',
 '/Users/user/.local/share/virtualenvs/osite-wGphEfbP/lib/python3.9/site-packages']
Server time:    Sun, 20 Feb 2022 15:52:17 +0000

My view:

class ProjectNotesList(ListBreadcrumbMixin,ListView):
    model = ProjectNotes
    template_name = 'company_accounts/project_notes.html'
    comments = ProjectNotes.comments


    def related_project(self, **kwargs):
        project = get_object_or_404(Project, id=self.kwargs.get('pk'))
        notes = ProjectNotes.objects.all
        return notes

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)

        context['project'] = get_object_or_404(Project, id=self.kwargs.get('pk'))
        return context



    commentscount = ProjectNotes.objects.annotate(num_comments=Count('comments'))

My URL:

path('project/<int:pk>/notes/', ProjectNotesList.as_view(), name='projectnotes_list'),

Is it possible to get this to work with this configuration?

Breadcrumbs in non generic class view

Hello,
Is it possible to use this package with other class based views than listview, createview, updateview and deleteview?
I'm using django-tables2 and have had some problems trying to generate breadcrumbs in a SingleTableView.

I see that for each generic class view there is a specific breadcrumbs class.

How can I make it work with a non-generic django class view?

Thank You in advance.

Error on Django 4 project when using deprecated ifequal templatetag in bootstrap3 templates

Hi, I got a templatetag error on a project using bootstrap3 when upgrading to Django 4.0.6. The error was related to the following line:

<li{% ifequal forloop.counter breadcrumbs_total %} class="active"{% endifequal %}>

Seems like in Django 4.0 the ifequal was removed*, so it should be changed to a standard if:

<li{% if forloop.counter == breadcrumbs_total %} class="active"{% endif %}>

What do you think?
Nice project :)

*See Django Deprecation Timeline for 4.0

Namespace Issue

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

I am trying to reproduce the examples given in the description.
With a books/views.py like this,

...
class BookListView(ListBreadcrumbMixin, ListView):
    model = Books
...

a books/urls.py like this,

...
urlpatterns = [
    ...
    path("", BookListView.as_view(), name=BookListView.list_view_name),
    ]
...

and an urls.py:

...
urlpatterns = [
    path('books/', include('books.urls')),
    ]
...

I get an error message:
NoReverseMatch at /books/ 'books' is not a registered namespace

Reversing the inherited classes in books/views.py,

...
class BookListView(ListView, ListBreadcrumbMixin):
    model = Books
...

fixes the error. However, the code doesn't produce any breadcrumbs.

Apologies, but I am not getting any further. I need some help.

To Reproduce

  1. create empty django project
  2. create app 'books'
  3. write "urls.py", "books/urls.py", "books/views.py", "templates/books/base.html", "templates/books/app_list.html" ... according to example code in description.

What OS are you seeing the problem on?

Ubuntu

Expected behavior?

I would like to see breadcrumbs.

Relevant log output

NoReverseMatch at /books/

'books' is not a registered namespace

Request Method: 	GET
Request URL: 	http://localhost:8000/books/
Django Version: 	4.2.3
Exception Type: 	NoReverseMatch
Exception Value: 	

'books' is not a registered namespace

Exception Location: 	/home/stonerocker/repositories/Django-breadcrumbs/.venv/lib/python3.10/site-packages/django/urls/base.py, line 82, in reverse
Raised during: 	books.views.BookListView
Python Executable: 	/home/stonerocker/repositories/Django-breadcrumbs/.venv/bin/python
Python Version: 	3.10.6
Python Path: 	

['/home/stonerocker/repositories/Django-breadcrumbs',
 '/usr/lib/python310.zip',
 '/usr/lib/python3.10',
 '/usr/lib/python3.10/lib-dynload',
 '/home/stonerocker/repositories/Django-breadcrumbs/.venv/lib/python3.10/site-packages']

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

CVE-2018-14042 (Medium) detected in bootstrap-3.3.6.min.js

CVE-2018-14042 - Medium Severity Vulnerability

Vulnerable Library - bootstrap-3.3.6.min.js

The most popular front-end framework for developing responsive, mobile first projects on the web.

Library home page: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js

Path to dependency file: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Path to vulnerable library: django-view-breadcrumbs/demo/templates/demo/test-table-list.html

Dependency Hierarchy:

  • bootstrap-3.3.6.min.js (Vulnerable Library)

Found in HEAD commit: eed8b340372609d9d0487b179caf813701bc4d15

Found in base branch: main

Vulnerability Details

In Bootstrap before 4.1.2, XSS is possible in the data-container property of tooltip.

Publish Date: 2018-07-13

URL: CVE-2018-14042

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: twbs/bootstrap#26630

Release Date: 2018-07-13

Fix Resolution: org.webjars.npm:bootstrap:4.1.2.org.webjars:bootstrap:3.4.0


Step up your Open Source Security Game with WhiteSource here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.