django-shared-0.0.1
توضیحات
Additional Django functionality
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | django-shared-0.0.1 |
| نام | django-shared |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Alexander Herrmann |
| ایمیل نویسنده | darignac@gmail.com |
| آدرس صفحه اصلی | https://github.com/dArignac/shared |
| آدرس اینترنتی | https://pypi.org/project/django-shared/ |
| مجوز | MIT |
django-shared
=============
|Downloads| |Version| |Wheel| |Egg| |Format| |License|
.. |Downloads| image:: https://pypip.in/download/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: Downloads
.. |Version| image:: https://pypip.in/version/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: Latest Version
.. |Wheel| image:: https://pypip.in/wheel/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: Wheel Status
.. |Egg| image:: https://pypip.in/egg/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: Egg Status
.. |Format| image:: https://pypip.in/format/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: Download format
.. |License| image:: https://pypip.in/license/django-shared/badge.png
:target: https://pypi.python.org/pypi/django-shared/
:alt: License
.. contents:: Table of Contents
This reusable app contains functionality I use across my projects. Feel free to use and expand.
The package is also on PyPI: `https://pypi.python.org/pypi/django-shared/ <https://pypi.python.org/pypi/django-shared/>`_
Changelog
---------
* 0.0.1
* initial release
Usage
-----
Add to your ``INSTALLED_APPS`` setting:
.. code-block:: python
INSTALLED_APPS = [
...
'shared',
]
Contents
--------
Utils for django-configurations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``shared.configurations.ExternalCredentials``
Mixin for a Configuration class of django-configurations. Enables one to load specific variables from <myproject>/configs/<DJANGO_CONFIGURATION>.py.
Good to separate critical information from the settings itself. *Usually you do not check the configs into your code versioning system!*
Usage example:
.. code-block:: python
# in settings.py (following the default django-configurations setup)
class Common(Configurations):
DATABASES = {
'default': ExternalCredentials.get_credentials_module().DATABASE,
}
# in <myproject>/configs/<DJANGO_CONFIGURATION>.py; e.g. sampleproject/configs/Dev.py
DATABASE = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db_name',
'USER': 'db_user',
'PASSWORD': 'db_password',
}
Module utils
~~~~~~~~~~~~
``function list_remove_duplicates(seq, idfun=None)``
Removes duplicates from a list. To preserve the list order, specify a function for the list ids as ``idfun``.
Management Commands
~~~~~~~~~~~~~~~~~~~
``python manage.py settings <SOMESETTING>``
Print the given setting value using ``pprint``.
Template Tags
~~~~~~~~~~~~~
**copyrights**
contains
- ``copyright_years``
- displays are year span from ``settings.COPYRIGHT_YEAR_START`` (default: 2012) until now, e.g. ``2012 - 2014``
نحوه نصب
نصب پکیج whl django-shared-0.0.1:
pip install django-shared-0.0.1.whl
نصب پکیج tar.gz django-shared-0.0.1:
pip install django-shared-0.0.1.tar.gz