django-sneak-peek ================= A Django template tag that allows you to hide pre-release features but make them available to a select group of users. By adding the "sneak peek" permission to users on your site, you can allow people within your company or trusted individuals to try out and experiment with upcoming features in your application. ## Requirements * Django Requires Django 1.4 or higher. Currently `django-sneak-peek` does not take advantage of the built-in migrations in Django 1.7, but I'll be updating the package to add support for them once 1.7 released. * South [South](https://pypi.python.org/pypi/South/0.8.4) is required for migrations. This package includes a data migration that adds a `ContentType` and an associated `Permission`. The permission is used to determine whether or not a user can view sneak peek content. ## Installation 1. Install via `pip`: $ pip install django-sneak-peek 2. Add `sneak_peek_tag` to `INSTALLED_APPS` in `settings.py`: INSTALLED_APPS = ( ... 'sneak_peek_tag', ... ) 3. Run migrations: $ python manage.py migrate sneak_peek_tag 4. Run `collectstatic` to grab the CSS and image: $ python manage.py collectstatic ## Usage `django-sneak-peek` defines a template tag called `sneak_peek`. Markup that you want to conditionally hide must be wrapped in this template tag. Add the `django-sneak-peek` CSS file to all pages where you plan to use the template tag: Load `sneak_peek` in your template: {% load sneak_peek %} Wrap secret markup in `sneak_peek` tags: {% sneak_peek %}
This entire div will not appear in the HTML output unless the current user has the sneak_peek permission.