Skip to main content

Generic utilities for django

Project description

Installation

  1. Install with pip install djgeneric" or add "djgeneric" directory to your Python path.

  2. Add "djgeneric" to the INSTALLED_APPS tuple found in your settings file.

  3. Run manage.py syncdb to create the new tables

Username and email login

To allow login with username or email, add to settings:

AUTHENTICATION_BACKENDS += ('djgeneric.auth.EmailAuthBackend',)

Optionally you can use the form in djgeneric.auth.CustomAuthenticationForm.

Google Analitics

To use the google analitics code, add to settings:

GOOGLE_ANALYTICS_PROPERTY_ID = 'UA-14845987-3'
GOOGLE_ANALYTICS_DOMAIN = 'mydomain.com'

TEMPLATE_CONTEXT_PROCESSORS += ('djgeneric.contect_processors.google_analitics',)

And then in your base template add:

{% include 'djgeneric/ga.html' %}

Login required middleware

To use the login required middleware, add to settings:

LOGIN_REQUIRED_URLS = (
    r'/topsecret/(.*)$',
)
LOGIN_REQUIRED_URLS_EXCEPTIONS = (
    r'/topsecret/login(.*)$',
    r'/topsecret/logout(.*)$',
)

MIDDLEWARE_CLASSES += ('djgeneric.middleware.RequireLoginMiddleware',)

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

djgeneric-0.1.15.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file djgeneric-0.1.15.tar.gz.

File metadata

  • Download URL: djgeneric-0.1.15.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for djgeneric-0.1.15.tar.gz
Algorithm Hash digest
SHA256 dd6dcc173fbbc19a6a67048f33470de753feab7722fac27dd56cd75c42d80bd1
MD5 fbaf3d6996edeb5522b4fa2543f434e6
BLAKE2b-256 78cec4adca47840c6c51e0ff4d5012e5fe46932ef3c8b0d786172e767c9064cc

See more details on using hashes here.

Supported by

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