Django-CMS plugin for Google Plus Activities
Project description
Django-cms plugin for fetching Google+ activities. You can find a preview at the bottom of this README.
Status
Still in Beta.
Continuous Integration
Install
Install these packages and their requirements:
Install cmsplugin-googleplus in your environment.
Configure
Add cmsplugin_googleplus and 'django.contrib.humanize' to the INSTALLED_APPS list in your project’s settings.py.
Go to the google apis console and create a new project (a google account is required)
Select Services and activate Google+ API
Select API Access and get the API key
Add the API key to your settings.py:
GOOGLEPLUS_PLUGIN_DEVELOPER_KEY = '<your_api_key>'
Run
Fresh install
python manage.py syncdb --all python manage.py migrate --fake
The first command will prompt you to create a super user. Choose ‘yes’ and enter appropriate values.
Upgrade
python manage.py syncdb python manage.py migrate
How to use it
An activity is a note that a user posts to their stream. You can list a collection of activities from one user or you can list a collection of activities as result of a search.
Example Template
This plugin has an example template that uses Twitter Bootstrap 3. You can use it as example skeleton for you templates.
As quickstart you can use a CDN for the related css:
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
and the related javascript:
<script src="http://code.jquery.com/jquery.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
Custom Template
Create your template and inside settings.py add:
GOOGLEPLUS_PLUGIN_TEMPLATES = ( ('cmsplugin_googleplus/twitter_bootstrap.html', _('Example Template using Twitter Bootstrap')), ('path/to/my/template', _('My beautiful template')) )
Cache
The activities are cached so you need to:
(Optional) Decide the activities cache duration. Default is 5 minutes. Inside settings.py add:
GOOGLEPLUS_PLUGIN_CACHE_DURATION = <custom_cache_duration>
The actual ‘Courtesy Limit’ for the Google+ API is 10,000 requests/day
Translation
For translators I’ve set up a Transifex account where you can add languages and translate the .po
Tests
Requirements
Run the test with coverage
$ coverage run runtests.py && coverage report -m
Preview
This is how the plugin looks with the example template.
Have Fun!
Marco
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
Built Distribution
Hashes for cmsplugin-googleplus-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca31a8e161ec828bff811f1f7a5824919b7d10a468d25c9792070c4368fe04c0 |
|
MD5 | cef6885c505f52930884ce3cd74b77fc |
|
BLAKE2b-256 | 6e955e68a025a8dee2810c152a9405e5d6452e0ab2d09a623e47db7487f3dd69 |
Hashes for cmsplugin_googleplus-0.4.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11351aff022746be099b59255715c0d5972d62da418b83157b24d098fb8cd908 |
|
MD5 | 7eb0f0e7d6134cdce49cfed65040d106 |
|
BLAKE2b-256 | 96163cee8c0804992683758b64672b3aa6106df38c2158ab07b16b36ea82df02 |