Django app that comes with a simple template tag to place a Facebook log-in button in your template
Project description
fbauth
======
Requirements
============
* Django 1.6+
Installation
============
pip install django-fbauth
Testing
=======
You can try out fbauth using the installed demo included in the project. Just
run the `runserver` command to look at the demo.
Instructions
============
Load the `fbauth` template-tag library into your template, then call
`fbauth_css` inside your `head` tag and call the `fbauth_button` wherever you
want the Facebook button to be rendered.
E.g.
```django
{% load fbauth %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My App</title>
{% fbauth_css %}
</head>
<body>
{% fbauth_button %}
</body>
</html>
```
Configure the `FBAUTH_FACEBOOK_APP_ID` variable in you `settings` module with
you Facebook app ID.
Configure the `FBAUTH_REDIRECT_URL` variable in your `settings` module with the
url that should be receiving the access token from facebook. Sometimes it's more
convinient to put it inside the `__init__` module of your app so that you can
take advantage of Django's `reverse` function.
There's also a `FBAUTH_FACEBOOK_LOCALEL` variable which you can use to specify
an ISO-15897 (also know as POSIX locale) locale for the Facebook API. Users of
your project will see the Facebook UI translated in the locale you specify. The
default locale is `en_US`.
E.g.
```python
# demo/__init__.py
from django.core.urlresolvers import reverse
from django.conf import settings
setattr(settings, 'FBAUTH_REDIRECT_URL',
reverse('demo:redirect') + '?access_token={0}')
```
Remember that your redirection URL should include the format token `{0}` to
indicate where Facebook's access token should be written.
======
Requirements
============
* Django 1.6+
Installation
============
pip install django-fbauth
Testing
=======
You can try out fbauth using the installed demo included in the project. Just
run the `runserver` command to look at the demo.
Instructions
============
Load the `fbauth` template-tag library into your template, then call
`fbauth_css` inside your `head` tag and call the `fbauth_button` wherever you
want the Facebook button to be rendered.
E.g.
```django
{% load fbauth %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My App</title>
{% fbauth_css %}
</head>
<body>
{% fbauth_button %}
</body>
</html>
```
Configure the `FBAUTH_FACEBOOK_APP_ID` variable in you `settings` module with
you Facebook app ID.
Configure the `FBAUTH_REDIRECT_URL` variable in your `settings` module with the
url that should be receiving the access token from facebook. Sometimes it's more
convinient to put it inside the `__init__` module of your app so that you can
take advantage of Django's `reverse` function.
There's also a `FBAUTH_FACEBOOK_LOCALEL` variable which you can use to specify
an ISO-15897 (also know as POSIX locale) locale for the Facebook API. Users of
your project will see the Facebook UI translated in the locale you specify. The
default locale is `en_US`.
E.g.
```python
# demo/__init__.py
from django.core.urlresolvers import reverse
from django.conf import settings
setattr(settings, 'FBAUTH_REDIRECT_URL',
reverse('demo:redirect') + '?access_token={0}')
```
Remember that your redirection URL should include the format token `{0}` to
indicate where Facebook's access token should be written.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-fbauth-templatetag-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6435f54c99f800b5468c7b1b2c24715231fe89c2d7e1dc1074fd4263200af2ee |
|
MD5 | 99f33fb026a2ebfb4b8a89c99f480839 |
|
BLAKE2b-256 | f244a0ae148cf57232a7990e02decaa0ffaa8f38651049feaf80e1b1eae9c6e6 |