Skip to main content

A collection of things that we re-use in every Django project, such as custom middlewares, templates, templatetags, test mixins etc...

Project description

This project aims to provide commonly used building blocks for Django projects and applications.

Current features:

  • TestCase mixins to ease the process of testing views via self.client.get

  • A JSONResponseMixin

  • New generic class based view DetailViewWithPostAction which is able to handle custom post actions.

  • Template filter to provide field’s verbose names

  • Template tag for displaying the currently selected main navigation item

  • Custom test_email_backend that sends emails to your own address no matter who the recepient is

  • Functions to test callable or non-callable views

  • Dummy views to test your 404 and 500 templates

  • RapidPrototypingView to render any template even when it has no view hooked up in urls.py.

  • AjaxRedirectMiddleware for jQuery AJAX calls that return 301 redirects

  • AjaxResponseMixin for views that can return their normal template or a partial template when it is an ajax call

  • AccessMixin which allows to use views with the login_required decorator based on a setting.

  • A context processor to add your analytics tracking code to your template context.

  • A decorator lockfile for wrapping handle methods of admin commands so that they never run twice at the same time.

  • A getCookie js function that can be used to retrieve the csrf token for AJAX POST requests.

  • A templatetag call which allows to call any method with params.

  • Utilities for loading classes from a string like myproject.models.Foobar.

  • Form, which add field labels as placeholder attributes.

  • Function to convert html code into formatted plain text.

  • Amazon S3 storage + django-compressor support files.

  • An AJAX View to display paginated comments for every possible object.

  • Tools to improve django-hvad

Installation

To get the latest stable release from PyPi:

$ pip install django-libs

To get the latest commit from GitHub:

$ pip install -e git://github.com/bitmazk/django-libs.git#egg=django_libs

Usage

See the docs folder for descriptions of the different tools this project provides.

Or read the docs here: http://django-libs.readthedocs.org/en/latest/

Contribute

If you want to contribute to this project, please perform the following steps:

# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-libs
$ pip install -r requirements.txt

$ git co -b feature_branch master
# Implement your feature and tests
$ git add . && git commit
$ git push -u origin feature_branch
# Send us a pull request for your feature branch

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

django-libs-2.0.3.tar.gz (126.8 kB view details)

Uploaded Source

File details

Details for the file django-libs-2.0.3.tar.gz.

File metadata

  • Download URL: django-libs-2.0.3.tar.gz
  • Upload date:
  • Size: 126.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for django-libs-2.0.3.tar.gz
Algorithm Hash digest
SHA256 e8dd873abaa07152d690310ab62cf941c1d7d752abfdf4a4bbc3d973bcf2c858
MD5 1b24bd66702694197eb036b484518a83
BLAKE2b-256 0b971e193831953a6e61baf7a8b283765882a98d6723cfced18852384e2f26de

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