Permalink
Browse files

Add: Very basic documentation.

  • Loading branch information...
1 parent 0793eff commit 9f988ea5d7b90ccc75c91312013f7d8910a1bc0e @matagus committed Sep 19, 2010
Showing with 78 additions and 0 deletions.
  1. +9 −0 docs/index.rst
  2. +69 −0 docs/usage.rst
View
@@ -0,0 +1,9 @@
+==================
+django-lastfm-auth
+==================
+
+Contents:
+
+.. toctree::
+
+ usage
View
@@ -0,0 +1,69 @@
+=====
+Usage
+=====
+
+Last.fm 2.0 API provides an authentication webservice. It works the same way Facebook Connect does,
+but with Last.fm user credentials. With django-lastfmauth it is easy to redirect a user to Last.Fm:
+Last.fm will do the login and ask them permission to your application to do it. Then, it will
+redirect the user to your website (you can set the callback url, please see bellow).
+
+So far, this app does all this job, but it needs some more work.
+
+Requirements
+------------
+
+Tested with django 1.2 and python 2.6.
+
+Instalation
+-----------
+
+Register your app and get a key in `LastFM API page`_. Set the callback url to
+http://your-domain/login_complete/
+
+.. _lastfm_api_page: http://www.last.fm/api/
+
+Then download and install lastfmauth app::
+
+ pip install -E path/to/your/env/ django-lastfmauth
+
+or::
+
+ easy_install django-lastfmauth
+
+Add to your settings.py::
+
+ INSTALLED_APPS = (
+ ...
+ 'lastfmauth',
+ ...
+ )
+
+ AUTHENTICATION_BACKENDS = (
+ "lastfmauth.backends.LastfmAuthBackend",
+ ...
+ )
+
+ LASTFM_API_KEY = "YOUR API KEY"
+ LASTFM_SECRET = "YOUR SECRET KEY"
+ LASTFM_WS_BASE_URL = "http://ws.audioscrobbler.com/2.0/"
+
+Add to your urls.py::
+ ...
+ (r'^lastfmauth/', include('lastfmauth.urls')),
+ ...
+
+Create app tables in your database::
+
+ python manage.py syncdb
+
+Usage
+-----
+
+Put somewhere in your templates a link to let visitors login using LastFM::
+
+ <a href="{% url lastfmauth_login %}">{% trans 'Login using your LastFm account' %}</a>
+
+License
+-------
+
+This work is under MIT License.

0 comments on commit 9f988ea

Please sign in to comment.