Siteimprove – the hack!
Installation
- Append this to settings.py (or, preferably, in your custom settings file (cf. https://docs.djangoproject.com/en/2.0/topics/settings/#designating-the-settings)):
if config.has_option('siteimprove', 'code'): SITEIMPROVE_CODE = config.get('siteimprove', 'code') MIDDLEWARE[MIDDLEWARE.index('pretix.base.middleware.SecurityMiddleware')] = 'pretix_siteimprove.middleware.SecurityMiddleware'
- Define your siteimprove code in pretix.cfg:
[siteimprove] code = xxxxxxx
- Copy pretix/src/pretix/presale/templates/pretixpresale/base_footer.html to %pretix.datadir%/templates/pretixpresale/base_footer.html (defined in pretix.cfg) and append this line:
<script type="text/javascript" src="{% url 'plugins:pretix_siteimprove:siteimprove' %}"></script>
- Copy pretix/src/pretix/presale/templates/pretixpresale/base.html to %pretix.datadir%/templates/pretixpresale/base.html (defined in pretix.cfg) and insert this line at the start of the head element:
- Restart Pretix
This is a plugin for pretix.
Development setup
- Make sure that you have a working pretix development setup.
- Clone this repository, eg to
local/pretix-siteimprove
. - Activate the virtual environment you use for pretix development.
- Execute
python setup.py develop
within this directory to register this application with pretix's plugin registry. - Execute
make
within this directory to compile translations.
License
Copyright 2018 Mikkel Ricky
Released under the terms of the Apache License 2.0