Skip to main content

Facebook-like timeline for Django admin

Project description

A Facebook-like timeline app for Django admin. It’s very similar to built-in feature Daily progress, but then has a nicer templates and infinite scroll implemented. Actions are broken up by day, then by action. Filtering by user (multiple select) and content type (multiple select) is implemented.

PyPI Version Build Status GPL-2.0-only OR LGPL-2.1-or-later

Prerequisites

Future

Starting from django-admin-timeline 1.7:

  • Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.1 and 2.2

  • Python 2.7, 3.5, 3.6 and 3.7

Present

Current version of django-admin-timeline (1.6.x) has the following prerequisites:

  • Django 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 2.0

  • Python 2.7, 3.3, 3.4, 3.5, 3.6

Dropping support of Django 1.4, 1.5, 1.6 and 1.7 has been announced in version 1.6. As of 1.6 everything is still backwards compatible with versions 1.4, 1.5, 1.6 and 1.7, but in future versions compatibility with these versions will be wiped out.

Dropping support of Python 2.6 and 3.3 has been announced in version 1.6. As of 1.6 everything is still backwards compatible with Python 2.6 and 3.3, but in future versions compatibility with these versions will be wiped out.

Installation

  1. Install in your virtual environment

    Latest stable version from PyPI:

    pip install django-admin-timeline

    Latest stable version from BitBucket:

    pip install https://bitbucket.org/barseghyanartur/django-admin-timeline/get/stable.tar.gz

    Latest stable version from GitHub:

    pip install https://github.com/barseghyanartur/django-admin-timeline/archive/stable.tar.gz
  2. Add admin_timeline to your INSTALLED_APPS in the global settings.py.

    INSTALLED_APPS = (
        # ...
        'admin_timeline',
       # ...
    )
  3. Collect the static files by running (see the Troubleshooting section in case of problems):

    ./manage.py collectstatic
  4. Override app settings in your global settings module (see the apps.admin_timeline.defaults for the list of settings). As for now, most important of those is NUMBER_OF_ENTRIES_PER_PAGE - number of entries displayed per page (for both non-AJAX and AJAX requests).

  5. Add the following lines to the global urls module:

    # Admin timeline URLs. Should be placed BEFORE the Django admin URLs.
    url(r'^admin/timeline/', include('admin_timeline.urls')),
    url(r'^admin/', include(admin.site.urls)),

Demo

Live demo

See the live demo app on Heroku.

Credentials:

  • username: admin

  • password: test

Run demo locally

In order to be able to quickly evaluate the django-admin-timeline, a demo app (with a quick installer) has been created (works on Ubuntu/Debian, may work on other Linux systems as well, although not guaranteed). Follow the instructions below for having the demo running within a minute.

Grab and run the latest django_admin_timeline_example_app_installer.sh:

wget -O - https://raw.github.com/barseghyanartur/django-admin-timeline/stable/examples/django_admin_timeline_example_app_installer.sh | bash

Open your browser and test the app.

If quick installer doesn’t work for you, see the manual steps on running the example project.

Troubleshooting

If somehow static files are not collected properly (missing admin_timeline.js and admin_timeline.css files), install the latest stable version from source.

pip install https://github.com/barseghyanartur/django-admin-timeline/archive/stable.tar.gz

Usage

After following all installation steps, you should be able to access the django-admin-timeline by:

http://127.0.0.1:8000/admin/timeline/

An example application is available. See the example directory.

Testing

Project is covered by test (functional- and browser-tests). To test with all supported Python/Django versions type:

tox

To test against specific environment, type:

tox -e py36-django111

To test just your working environment type:

./runtests.py

It’s assumed that you have all the requirements installed. If not, first install the test requirements:

pip install -r examples/requirements/testing.txt

Browser tests

For browser tests you may choose between Firefox, headless Firefox and PhantomJS. PhantomJS is faster, headless Firefox is fast as well, but normal Firefox tests tell you more (as you see what exactly happens on the screen). Both cases require some effort and both have disadvantages regarding the installation (although once you have them installed they work perfect).

Latest versions of Firefox are often not supported by Selenium. Current version of the Selenium for Python (2.53.6) works fine with Firefox 47. Thus, instead of using system Firefox you could better use a custom one.

For PhantomJS you need to have NodeJS installed.

Set up Firefox 47

  1. Download Firefox 47 from this location and unzip it into /usr/lib/firefox47/

  2. Specify the full path to your Firefox in FIREFOX_BIN_PATH setting. Example:

    FIREFOX_BIN_PATH = '/usr/lib/firefox47/firefox'

    If you set to use system Firefox, remove or comment-out the FIREFOX_BIN_PATH setting.

After that your Selenium tests would work.

Set up headless Firefox

  1. Install xvfb package which is used to start Firefox in headless mode.

    sudo apt-get install xvfb
  2. Run the tests using headless Firefox.

    ./scripts/runtests.sh

    Or run tox tests using headless Firefox.

    ./scripts/tox.sh

Setup PhantomJS

You could also run tests in headless mode (faster). For that you will need PhantomJS.

  1. Install PhantomJS and dependencies.

    curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
    sudo bash nodesource_setup.sh
    sudo apt-get install nodejs
    sudo apt-get install build-essential libssl-dev
    sudo npm -g install phantomjs-prebuilt
  2. Specify the PHANTOM_JS_EXECUTABLE_PATH setting. Example:

    PHANTOM_JS_EXECUTABLE_PATH = ""

    If you want to use Firefox for testing, remove or comment-out the PHANTOM_JS_EXECUTABLE_PATH setting.

License

GPL-2.0-only OR LGPL-2.1-or-later

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Screenshots

https://github.com/barseghyanartur/django-admin-timeline/raw/master/docs/_static/admin_timeline.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-admin-timeline-1.7.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

django_admin_timeline-1.7-py2.py3-none-any.whl (107.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-admin-timeline-1.7.tar.gz.

File metadata

  • Download URL: django-admin-timeline-1.7.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for django-admin-timeline-1.7.tar.gz
Algorithm Hash digest
SHA256 e9681482091b44fd6ca30d8322053419d65828a789ad50f48c81138f0f7a389a
MD5 44e60a6df97c73936b49b32055b6887a
BLAKE2b-256 17bde4b9cfe284635679c423623bd417edabd587b61626ad3f11d5504d57c3fa

See more details on using hashes here.

File details

Details for the file django_admin_timeline-1.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_timeline-1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a65cf873dba9aa596396b5422b9a2bfd1d937f3fba0ca6e99fdbb3e7a494178f
MD5 0fa033931879ed90df2ef94f7c79109c
BLAKE2b-256 65bf68f5b5606dc058b9ae4f71f2a499054cf90a4ccde4c08087518edfc11066

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page