Skip to main content

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

Project description

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

Current features:

  • A custom testrunner that uses django-nose for discovering tests and django-coverage for automatically generating a coverage report on each test run
  • A factory for creating User objects
  • 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.
  • A SimpleTranslationMixin which adds a get_translaion method to a model that is registered with simple-translation.
  • A SimpleTranslationMixin which makes it easier to write factories for models that are registered with simple-translation.
  • Utilities for loading classes from a string like myproject.models.Foobar.
  • Form, which add field labels as placeholder attributes.

Coming soon:

  • View mixins to make class based views private for authenticated users
  • Extensive fabfile for checking pep8 compliancy, running tests, importing and exporting the database and locale files, dumping and loading fixtures etc.
  • Useful shell scripts to be installed on the server for various maintenance and deployment tasks
  • Smart urlpatterns to serve static and media files when you set DEBUG=False locally, no need to setup Apache on your development machine
  • A set of templates for django-registration and some partials for rendering forms compatible with Twitter Bootstrap.

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

History Node

1.67.13

History Node

1.67.12

History Node

1.67.11

History Node

1.67.10

History Node

1.67.9

History Node

1.67.8

History Node

1.67.7

History Node

1.67.6

History Node

1.67.5

History Node

1.67.4

History Node

1.67.3

History Node

1.67.2

History Node

1.67.1

History Node

1.66.15

History Node

1.66.14

History Node

1.66.13

History Node

1.66.12

History Node

1.66.11

History Node

1.66.10

History Node

1.66.9

History Node

1.66.8

History Node

1.66.7

History Node

1.66.6

History Node

1.66.5

History Node

1.66.4

History Node

1.66.3

History Node

1.66.2

History Node

1.66.1

History Node

1.66.0

History Node

1.65.7

History Node

1.65.6

History Node

1.65.5

History Node

1.65.4

History Node

1.65.3

History Node

1.65.2

History Node

1.65.1

History Node

1.65

History Node

1.64.10

History Node

1.64.9

History Node

1.64.8

History Node

1.64.7

History Node

1.64.6

History Node

1.64.5

History Node

1.64.4

History Node

1.64.3

History Node

1.64.2

History Node

1.64.1

History Node

1.64

History Node

1.63.0

History Node

1.62.3

History Node

1.62.2

History Node

1.62.1

History Node

1.62

History Node

1.61.5

History Node

1.61.4

History Node

1.61.3

History Node

1.61.2

History Node

1.61.1

History Node

1.61.0

History Node

1.60.0

History Node

1.59.6

History Node

1.59.5

History Node

1.59.4

History Node

1.59.3

History Node

1.59.2

History Node

1.59.1

History Node

1.59

History Node

1.58.5

History Node

1.58.4

History Node

1.58.3

History Node

1.58.2

History Node

1.58.1

History Node

1.58

History Node

1.57.1

History Node

1.57

History Node

1.56

History Node

1.55

History Node

1.54

History Node

1.53

History Node

1.52

History Node

1.51

History Node

1.50

History Node

1.49.1

History Node

1.49

History Node

1.48.1

History Node

1.48

History Node

1.47.1

History Node

1.47

History Node

1.46.6

History Node

1.46.5

History Node

1.46.4

History Node

1.46.3

History Node

1.46.2

History Node

1.46.1

History Node

1.46

History Node

1.45

History Node

1.44

History Node

1.43

History Node

1.42.3

History Node

1.42.2

History Node

1.42.1

History Node

1.42

History Node

1.41

History Node

1.40

History Node

1.39

History Node

1.38

History Node

1.37

History Node

1.36.1

History Node

1.36

History Node

1.35.2

History Node

1.35.1

History Node

1.35

History Node

1.34

History Node

1.33

History Node

1.32

History Node

1.31

History Node

1.30

History Node

1.29

History Node

1.28

History Node

1.27.1

History Node

1.27

History Node

1.26

History Node

1.25

History Node

1.24

This version
History Node

1.23

History Node

1.22

History Node

1.21.1

History Node

1.21

History Node

1.20

History Node

1.19

History Node

1.18

History Node

1.17

History Node

1.16

History Node

1.15

History Node

1.14

History Node

1.13

History Node

1.12

History Node

1.11

History Node

1.10

History Node

1.9

History Node

1.8

History Node

1.7

History Node

1.6

History Node

1.5

History Node

1.4.8

History Node

1.4.7

History Node

1.4.6

History Node

1.4.5

History Node

1.4.4

History Node

1.4.3

History Node

1.4.2

History Node

1.4.1

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

History Node

0.17

History Node

0.16

History Node

0.15

History Node

0.14.1

History Node

0.14

History Node

0.13

History Node

0.12

History Node

0.11

History Node

0.10

History Node

0.9

History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-libs-1.23.tar.gz (28.2 kB) Copy SHA256 hash SHA256 Source None Nov 1, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page