Skip to content

Commit

Permalink
Work on docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
yesimon committed Jan 22, 2013
1 parent 32ad56d commit 6e59cfe
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -41,16 +41,16 @@

# General information about the project.
project = u'django-hunger'
copyright = u'2012, Joshua Karjala, Simon Ye'
copyright = u'2013, Joshua Karjala, Simon Ye'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
version = '2.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.5'
release = '2.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
25 changes: 18 additions & 7 deletions docs/index.rst
@@ -1,16 +1,28 @@
.. django-hunger documentation master file, created by
sphinx-quickstart on Fri Mar 30 18:57:24 2012.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to django-hunger's documentation!
django-hunger Documentation
=========================================

Contents:

.. toctree::
:maxdepth: 2

quickstart
userflow
internals
settings
example_app


Overview
========

Django-hunger is a middleware that implements a flexible beta for a
Django project. The primary design restriction is that this is a
post-registration beta that relies on email. After users create an
account, an admin user may invite them to join the beta.





Indices and tables
Expand All @@ -19,4 +31,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

20 changes: 20 additions & 0 deletions docs/quickstart.rst
@@ -0,0 +1,20 @@
.. _ref-quickstart:

==========
Quickstart
==========


Installation
------------

- Install ``django-hunger`` using ``pip`` or ``easy_install``.
- Add ``hunger`` to ``INSTALLED_APPS`` in settings.py.
- Add ``hunger.middleware.BetaMiddleware`` to ``MIDDLEWARE_CLASSES``.
- Create templates ``hunger/request_invite.html``,
``hunger/confirmation.html``, and ``hunger/used.html``. The
``request_invite.html`` template receives a Context instance with a
Django form for the email signup form. The ``confirmation.html`` and
``used.html`` templates are flatpages for confirming signup and used
invites.
- By default Hunger redirects to ``/beta/`` if a users is not logged in. So your "request_invite" templates should be located here.
46 changes: 46 additions & 0 deletions docs/userflow.rst
@@ -0,0 +1,46 @@
.. _ref-userflow:

=========
User Flow
=========


Cases
-----

#. User is unregistered

* Can only visit views listed in ``HUNGER_ALWAYS_ALLOW_VIEWS`` or
views in modules listed in ``HUNGER_ALWAYS_ALLOW_MODULES``. The
views list may refer to the view by the view's function name or
urlpattern name.
* All other urls redirect to ``HUNGER_REDIRECT``.
* If registration view is listed above, then the user can register
for an account that doesn't yet have beta access.
* If invited by a friend by receiving an email with a beta invite
link, then the code is stored in a cookie. When the user
registers, then they are automatically placed into the beta.
* If registering via a public beta code, the code is similarly
placed in a cookie, where later registration will place the user
automatically in the beta and the invitation code count
decrements by 1.

#. User is registered but not in beta

* An admin can invite that specific user to the beta through the
Django admin interface.
* The user can be invited by another beta who has beta access,
provided that the inviter has enough invitations to send the
invitation. The user clicks a link.
* The user can join the beta themselves by using a public beta code
as long as the code has enough uses left.
* Upon being verified as in-beta, the user is redirected to
``HUNGER_VERIFIED_REDIRECT``.

#. User is registered and in beta

* An admin can dispense invitations so that users can invite their
friends.
* Invitations in hand, the user invites friends via either email or
their username if applicable.
* Otherwise, allow user to invite friends at-will.
2 changes: 1 addition & 1 deletion hunger/views.py
Expand Up @@ -11,7 +11,7 @@ class InviteView(FormView):
"""
Allow a user to send invites.
"""
template_name = 'beta/request_invite.html'
template_name = 'hunger/request_invite.html'
form_class = InviteSendForm
success_url = reverse_lazy('hunger_confirmation')

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -33,7 +33,7 @@
setup(
name='django-hunger',
version=version_str,
packages=find_packages(exclude=['tests']),
packages=find_packages(exclude=['tests', 'example']),
author='Joshua Karjala-Svenden',
author_email='joshua@fluxuries.com',
url='https://github.com/joshuakarjala/django-hunger/',
Expand All @@ -47,4 +47,4 @@
extras_require={'test': tests_require},
test_suite='runtests.runtests',
include_package_data=True,
)
)

0 comments on commit 6e59cfe

Please sign in to comment.