This library is deprecated, as Fire Eagle no longer exists
The django_fireeagle
package contains code to handle the Fire Eagle authorisation process within Django. You can use it to manage connections between Django users and their respective Fire Eagle access tokens.
To install, check the code out using this and place django_fireeagle somewhere on your Python path.
The Django Fire Eagle package consists of:
- Views to handle instigation and completion of Fire Eagle authorisation.
- A database model to persist Fire Eagle access tokens.
django_fireeagle
uses the Python OAuth and fireeagle_api libraries, which must be installed somewhere on the Python path.
The package also depends on the availability of Django’s session support.
Having ensured the oauth
, fireeagle_api
, and django_fireeagle
packages are available on your Python path, you can add Fire Eagle interaction to your application by doing the following:
- Put
django_fireeagle
in yourINSTALLED_APPS
setting. - Run the command
manage.py syncdb
to create the necessary tables. - Add the following views to your urlconf:
( r'fire-eagle/$', 'django_fireeagle.views.begin' ), ( r'fire-eagle/finalise/$', 'django_fireeagle.views.finalise' ),
- Set the callback URL in Fire Eagle to point to
yoursite.com/fire-eagle/finalise/
.
You will then be able to browse to yoursite.com/fire-eagle/
to associate your logged-in Django user to a Fire Eagle account
To interact with Fire Eagle on behalf of the current user:
// Retrieve the current user's Fire Eagle OAuth token
fe_user = FireEagleUser.objects.get( user=request.user )
request_token = fe_user.get_fire_eagle_token()
// Instantiate a Fire Eagle instance using our app's token
fe = FireEagle(
getattr( settings, 'FIREEAGLE_CONSUMER_KEY' ),
getattr( settings, 'FIREEAGLE_CONSUMER_SECRET' )
)
// Make calls to the Fire Eagle API!
fe_user = fe.user( request_token )
To use the included example:
- Create a test application on Fire Eagle, with the callback URL pointing to
http://127.0.0.1:8000/fire-eagle/finalise/
. - Fill the
FIREEAGLE_CONSUMER_KEY
andFIREEAGLE_CONSUMER_SECRET
insettings.py
with the values for your Fire Eagle application. - Run
python manage.py syncdb
in the project’s directory, and create a user. - Run
python manage.py runserver
to start the app. - Navigate to
http://127.0.0.1:8000/
, and follow the steps.