Skip to main content

A Django app to manage a private beta phase.

Project description

https://secure.travis-ci.org/joshuakarjala/django-hunger.png?branch=master

Django app to manage a private beta phase for a website.

  • This app provides users with the change to sign up for a private beta - by providing their email address.

  • The administrators of the website can manually invite people to join the beta from the Django admin panel.

  • The signup view of the app is only accessible by providing the correct invitation code in the url.

Installation

  • Install django-hunger into your site-packages

  • Add ‘hunger.middleware.BetaMiddleware’ to MIDDLEWARE_CLASSES

Settings

BETA_INVITE_CODE_LENGTH

String length of the invitation_code

BETA_ENABLE_BETA

Enable hunger middleware

BETA_NEVER_ALLOW_VIEWS

Never allow access to these views

BETA_ALWAYS_ALLOW_VIEWS

Always let unregistered user see these view

BETA_ALWAYS_ALLOW_MODULES

Convenience settings - allow all views and a given module

BETA_ALLOW_FLATPAGES

If using flatpages app

BETA_SIGNUP_VIEWS

Which views are used for signing up

BETA_SIGNUP_CONFIRMATION_VIEW

The view which comes directly after a user has signed up

BETA_REDIRECT_URL

If user is not logged in and trying to access a hidden view - where should he/she be redirected

BETA_SIGNUP_URL

What is the url for the signup page

BETA_EMAIL_TEMPLATES_DIR

Directory containing email templates

BETA_EMAIL_MODULE

Module where the email functions are

BETA_EMAIL_CONFIRM_FUNCTION

Function for sending out confirmation that user is on waiting list

BETA_EMAIL_INVITE_FUNCTION

Function for sending out the invitation code

Integration with django_templated_email

If django_templated_email - https://github.com/bradwhittington/django-templated-email is installed, you can use customized *.email templates with an example setting such as:

BETA_EMAIL_TEMPLATES_DIR = 'beta'

And create the following templates:

<project_dir>/templates/beta/beta_confirm.email
<project_dir>/templates/beta/beta_invite.email

Integration with django_social_auth

Modify SOCIAL_AUTH_PIPELINE in settings to replace social_auth.backends.pipeline.user.create_user with create_beta_user (using default pipeline):

SOCIAL_AUTH_PIPELINE = (
    'social_auth.backends.pipeline.social.social_auth_user',
    'social_auth.backends.pipeline.associate.associate_by_email',
    'social_auth.backends.pipeline.user.get_username',
    'hunger.contrib.social_auth_pipeline.create_beta_user',
    'social_auth.backends.pipeline.social.associate_user',
    'social_auth.backends.pipeline.social.load_extra_data',
    'social_auth.backends.pipeline.user.update_user_details'
)

BETA_ALWAYS_ALLOW_VIEWS must at bare minimum include the relevant social_auth views:

BETA_ALWAYS_ALLOW_VIEWS = (
    'social_auth.views.auth',
    'social_auth.views.complete',
)

Credit

Hunger is partially based on: - https://github.com/pragmaticbadger/django-privatebeta

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-hunger-1.0.6.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

django_hunger-1.0.6-py2-none-any.whl (126.1 kB view details)

Uploaded Python 2

File details

Details for the file django-hunger-1.0.6.tar.gz.

File metadata

File hashes

Hashes for django-hunger-1.0.6.tar.gz
Algorithm Hash digest
SHA256 b3f2f5ce1e9bf5e9115abf935e05bfb54de4c46b1be4b6bb8770c68318b34cd3
MD5 43091b45a9a77b3c29eff07045a2e8e5
BLAKE2b-256 b26bf08df8acf10b673f38e4f913cebac864b10a68d7f6245fac12bb521cc358

See more details on using hashes here.

File details

Details for the file django_hunger-1.0.6-py2-none-any.whl.

File metadata

File hashes

Hashes for django_hunger-1.0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 f02b752968b300578d3884dc49a261294d14df823e34f1d927eed2f4664af410
MD5 bfd613cce3a4dbbf73606cd876542a61
BLAKE2b-256 b5c968b45c66374c455321f9d3dbd69fdfc80d2276f356be4ebcec52eef9e2db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page