Skip to main content

pypi build coverage

Aldryn Snake adds tail and head context processors for addons similar to django-sekizai.

This addon still uses the legacy “Aldryn” naming. You can read more about this in our support section.

Contributing

This is a an open-source project. We’ll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your pull request, please review our contribution guidelines.

We’re grateful to all contributors who have helped create and maintain this package. Contributors are listed at the contributors section.

Documentation

See REQUIREMENTS in the setup.py file for additional dependencies:

python django

Installation

  • add aldryn_snake.template_api.template_processor to your TEMPLATE_CONTEXT_PROCESSORS settings

  • somewhere in your app (that will be imported on startup (models, admin etc) add something to the api:

        from aldryn_snake.template_api import registry
    from django.conf import settings
    
    OPTIMIZELY_SCRIPT = """<script src="//cdn.optimizely.com/js/%(account_number)s.js"></script>"""
    
    
    def get_crazyegg_script():
      optimizely_number = getattr(settings, 'OPTIMIZELY_ACCOUNT_NUMBER', None)
      if optimizely_number:
          return OPTIMIZELY_SCRIPT % {'account_number': optimizely_number}
       else:
          return ''
    
    registry.add_to_tail(get_crazyegg_script())

If add_to_tail or add_to_head receive a callable, it will be called with the request keyword argument.

  • add the following in your base template to the HEAD:

    {{ ALDRYN_SNAKE.render_head }}
  • add the following in your base template right above </BODY>:

    {{ ALDRYN_SNAKE.render_tail }}

Running Tests

You can run tests by executing:

virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test

Release files for aldryn-snake 2.0.0

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

Source distribution (sdist)

Source distribution for aldryn-snake 2.0.0
File Size Uploaded
aldryn-snake-2.0.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aldryn-snake 2.0.0
File Interpreter ABI Platform
aldryn_snake-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / aldryn-snake-2.0.0.tar.gz

Download URL aldryn-snake-2.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1264c7ef2b601a81e3882333d2a62093c581168c5dc0f01caedbbe3db898bf38
BLAKE2b-256 checksum
How to use checksums
ec30ccb773b1c9d376bcb9f0afe2247cd32adfd14b5735a75d10ee1d63bed962
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / aldryn_snake-2.0.0-py3-none-any.whl

Download URL aldryn_snake-2.0.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad9fd858d63ad4a417d92e49e974137ac29a31b87d30579dba29597f4eac0f27
BLAKE2b-256 checksum
How to use checksums
580a655a6fedd1ab8a5c6809c6165f15a3a030712742ff4f79e9d18633ce19c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.1

1 release file

1.0.0

1 release file

0.0.2

1 release file

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