Generic utilities for django
Project description
Installation
Install with pip install djgeneric" or add "djgeneric" directory to your Python path.
Add "djgeneric" to the INSTALLED_APPS tuple found in your settings file.
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
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
djgeneric-0.1.12.tar.gz
(5.0 kB
view details)
File details
Details for the file djgeneric-0.1.12.tar.gz.
File metadata
- Download URL: djgeneric-0.1.12.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.9.0-11-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
882ce5f104ede8b7f581ba55aa74224389d0b3189353cda45ec2fb2caa50bec5
|
|
| MD5 |
3e3c4d81eac21df779e76d50dcbcd6c0
|
|
| BLAKE2b-256 |
c100a7ee7380aceb349bee6b7aa584ec0b8f562d688c435de9e6d2f9595df1e6
|