Commits

Gregory Petukhov committed c5c2c94

Update documentation

  • Participants
  • Parent commits 4e73f3f

Comments (0)

Files changed (3)

File docs/index.rst

    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
+=======================
 django-urlauth overview
 =======================
 
-This django application allows you to build special link. When somebody goes via such link to your site he will be automatically authenticated. This is acheaved with special GET arguments which is appended to the link. Such link are usually used in the emails.
+This django application allows you to build special link. When somebody goes via this link to your site he will be automatically authenticated. This is acheaved with special GET arguments which is appended to the link. Such links are usually used in the emails.
 
 Example of such link: http://domain.com/profile/edit/?authkey=SOME_HASH
 
 Simplest example of using django-urlauth::
 
-    >>> from urlauth.util import wrap_url
-    >>> wrap_url('http://domain.com/path/', uid=10)
+    >>> from urlauth.models import AuthKey
+    >>> AuthKey.objects.wrap_url('http://domain.com/path/', uid=10)
     http://domain.com/path/?authkey=404787ca65ea256e120af7e5e3c217170b1755ad'
 
 
-Project setup
-=============
+Installation and Configuration
+==============================
 
-After install django-urlauth package you have to setup your django project.
+Few easy steps:
 
-* Add ``urlauth`` to ``settings.INSTALLED_APPS``
-* Add ``urlauth.middleware.AuthKeyMiddleware`` to ``settings.MIDDLEWARE_CLASSES``
-* Add ``from urlauth.settings import *`` line to settings.py
+* Add ``urlauth`` to ``INSTALLED_APPS``
+* Add ``urlauth.middleware.AuthKeyMiddleware`` to ``MIDDLEWARE_CLASSES``
+* Add to settings.py the::
+  
+    from urlauth.settings import *
+
 * Do syncdb
 
 
 
 Example of using extra data::
 
-    >>> from urlauth.util import wrap_url, load_key
-    >>> url = wrap_url('http://google.com', uid=13, foo='bar', baz=100)
+    >>> from urlauth.models import AuthKey
+    >>> from urlauth.util import load_key
+    >>> url = AuthKey.objects.wrap_url('http://google.com', uid=13, foo='bar', baz=100)
     >>> url
     'http://google.com?authkey=b68b4e38c0356c3eeb7a7ec6849a2dfc86902a10'
     >>> hash = url.split('=')[1]
     {u'foo': u'bar', u'baz': 100}
 
 
-Middleware
-==========
+AutKey processing
+=================
 
-Main function of ``urlauth.middleware.AuthKeyMiddleware`` is to authenticate user. If ``onetime`` property of loaded key is ``True`` then that key is not deleted and stored in the ``request.authkey`` attribute. Keys with false``onetime`` property are deleted immediatelly after processing.
+Main purpose of ``urlauth.middleware.AuthKeyMiddleware`` is to authenticate users. If ``onetime`` property of the AuthKey instance is ``True`` then that key is not deleted from database and also placed in the ``request.authkey`` attribute. Keys with false `onetime`` property are deleted immediatelly after processing.
 
 
 Signals
 .. module:: urlauth.signals
 
 
-``urlauth.middleware.AuthKeyMiddleware`` generates signals.  Each signal provides ``key`` and ``request`` arguments.
+``urlauth.middleware.AuthKeyMiddleware`` generates ``authkey_processed`` signal.  It provides ``key``, ``request`` and ``user`` arguments to his listeners.
 
-.. data:: key_loaded
+.. data:: authkey_processed
 
-    Sent when ``AuthKey`` instance was found for hash in url
-
-.. data:: key_processed
-    
-    Sent when ``User`` was found for the user ID stored in the key
+    Sent when valid ``AuthKey`` instance is loaded in AuthKeyMiddleware.
 
 
 Settings
 
     Name of the argument used in the urls to store the hash of generated ``AuthKey`` instance.
 
+Feedback
+========
+
+Bitbucket issues page: https://bitbucket.org/lorien/django-urlauth/issues
+
+Email: lorien@lorien.name
+
 
 Indices and tables
 ==================
 #!/bin/sh
 hg push
-python setup.py register sdist upload #build_sphinx upload_sphinx
+python setup.py register sdist upload build_sphinx upload_sphinx
+[build_sphinx]
+source-dir = docs/
+build-dir  = docs/_build
+all_files  = 1
+
+[upload_sphinx]
+upload-dir = docs/_build/html