Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
django-site-navigation
Advanced tools
.. code:: bash
pip install django-site-navigation
.. code:: python
INSTALLED_APPS = (
...
'site_navigation'
)
.. code:: python
TEMPLATE_CONTEXT_PROCESSORS = (
...
'site_navigation.context_processors.getNavigationProperties'
)
.. code:: python
MIDDLEWARE_CLASSES = (
...
'site_navigation.middleware.RedirectMiddleware'
)
.. code:: python
from navigation.utils import addUrl
urlpatterns += addUrl('default_page.html')
.. code:: bash
python ./manage.py migrate
.. code:: html
{% load site-navigation %}
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="description" content="{{ NAVIGATION_SUBDIVISION.description|default_if_none:'' }}">
<meta name="keywords" content="{{ NAVIGATION_SUBDIVISION.keywords|default_if_none:'' }}">
<title>
<title>
{% if NAVIGATION_SUBDIVISION.title %}{{ NAVIGATION_SUBDIVISION.title }}
{% elif NAVIGATION_SUBDIVISION.pageTitle %} {{ NAVIGATION_SUBDIVISION.pageTitle }}
{% elif NAVIGATION_SUBDIVISION.name %}{{ NAVIGATION_SUBDIVISION.name }}
{% else %}{{ SITE_OPTIONS.title }}{% endif %}
</title>
</title>
</head>
<body>
{% breadcrumbs %}
<h1>
{% if NAVIGATION_SUBDIVISION.pageTitle %}
{{ NAVIGATION_SUBDIVISION.pageTitle }}
{% else %}
{{ NAVIGATION_SUBDIVISION.name }}
{% endif %}
</h1>
{% block beforecontent %}
{{ NAVIGATION_SUBDIVISION.before|default_if_none:''|safe }}
{% endblock %}
{% block content %}{% endblock %}
{% block aftercontent %}
{{ NAVIGATION_SUBDIVISION.after|default_if_none:''|safe }}
{% endblock %}
</body>
</html>
menu.html
.. code:: html
{% for sub in subdivisions|dictsortreversed:"priority" %}
<li {% if sub == NAVIGATION_SUBDIVISION %} class="active" {% endif %}>
<a href="{{ sub.getUrl }}" >
{{ sub }}
</a>
</li>
{% endfor %}
breadcrumbs.html
.. code:: html
<ul>
<li><a href="/">Home</a></li>
{% for s in NAVIGATION_BRANCH %}
<li>{% if not forloop.last %}
<a href="{{ s.getUrl }}">{{ s.name }}</a>
{% else %}
{{ s.name }}
{% endif %}
</li>
{% endfor %}
</ul>
FAQs
Navigation on the site using flat pages, URL patterns and Views
We found that django-site-navigation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.