Saravanan666/pypi-org huggingface dataset:
Package: django-historicalrecords-unleashed
This is from Marty Alchin’sPro Djangobook.Setup the virtualenv$ virtualenv --no-site-packages ve
$ source ve/bin/activate
(ve)$ pip install -r requirements.pipOr install from PyPI$ pip install django-historicalrecordsImport the HistoricalRecords and attach it to your model like you would a custom Django manager.from django.db import models
from history.models import HistoricalRecords

class TestModel(models.Model):
    """A model for testing"""
    boolean = models.BooleanField(default=True)
    characters = models.CharField(blank=True, max_length=100)

    history = HistoricalRecords()

    class Admin:
        list_display = ('',)
        search_fields = ('',)

    def __unicode__(self):
        return u"TestModel"If you runmanage.py syncdbyou’ll see that it automatically creates aHistoricalversion of whatever model you’ve attached it to.(ve)$ ./manage.py syncdb
Creating table auth_permission
... // snip // ...
Creating table example_app_historicaltestmodel <- HistoricalTestModel!
Creating table example_app_testmodel
... // snip // ...TheHistoricalRecordsclone the model it is attached to and adds some extra fields that allow you to track the type of change made, the timestamp of when the change was saved and it has a descriptor that will return the original object at the time of the change.(ve)$ ./manage.py shell
>>> from example_app.models import TestModel
>>> tm = TestModel.objects.create(boolean=True,characters="abc")
>>> tm.history.count()
1
>>> most_recent = tm.history.most_recent()
>>> most_recent.boolean
True
>>> most_recent.characters
u'abc'
>>> tm.boolean = False
>>> tm.characters = "def"
>>> tm.save()
>>> tm.history.count()
2
>>> tm.history.all()
[<HistoricalTestModel: TestModel as of 2010-09-10 03:29:59.424761>, <HistoricalTestModel: TestModel as of 2010-09-10 03:28:31.358548>]
>>> from datetime import datetime
>>> timestamp = datetime(2010,9,10,3,28,31,358548)
>>> old_version = tm.history.as_of(timestamp)
>>> old_version.boolean
True
>>> tm.boolean
False
>>> old_version.characters
u'abc'
>>> tm.characters
'def'
>>>
Package: django-histories
django_historyDjango_history - a module for tracking changes to model instances.Installpip3 install git+https://github.com/QuantumaStelata/django-history.gitAdd to INSTALLED_APPSINSTALLED_APPS = [
    ...
    'django_history'
    ...
]Do migrationspython3 manage.py migrateCreate a modelclass Task(models.Model):
  ...Add mixin to your modelfrom django_history.mixins import HistoryMixin


class Task(HistoryMixin):
  ...Note:using a HistoryMixindoesn't need to be migratedCongrats, history is being recordedFor flexible use, write in the settings.py# A function that returns the user who made the request.
# NOTE: function must not have arguments.
HISTORY_GET_CURRENT_USER

# If true then the history object will be saved asynchronously using celery_app.
# WARNING: history recording uses pickle serializer.
HISTORY_ALLOW_CELERY

# If you are deleting objects programmatically,
# pass in a list of field names that store information about deleting the object
# to more accurately create a history object.
HISTORY_SOFT_DELETE_FIELDSFor exampleUsing soft delete model# models.py
class Task(HistoryMixin):
  ...
  deleted_at = models.DateTimeField(null=True)
  ...

# settings.py
# Pass soft delete field in HISTORY_SOFT_DELETE_FIELDS
HISTORY_SOFT_DELETE_FIELDS = ['deleted_at']If you usedjango-currentuser, pass get_current_user function to HISTORY_GET_CURRENT_USER# settings.py
from django_currentuser.middleware import get_current_user

HISTORY_GET_CURRENT_USER = get_current_user
Package: django-historylinks
django-historylinksprovides automatic SEO-friendly HTTP 301 redirects if the
URL of a registered model changes.FeaturesTracks old URLs associated with a model and provides 301 redirects to the new URL.Simple one-line registration for each model.DocumentationPlease read the [Getting Started][] guide for more information.[Getting Started]:https://github.com/etianen/django-historylinks/wiki“Getting started with django-historylinks”Download instructions, bug reporting and links to full documentation can be
found at the [main project website][].[main project website]:http://github.com/etianen/django-historylinks“django-historylinks on GitHub”You can keep up to date with the latest announcements by joining the
[django-historylinks discussion group][].[django-historylinks discussion group]:http://groups.google.com/group/django-historylinks“django-historylinks Google Group”More informationThe django-historylinks project was developed by Dave Hall. You can get the code
from the [django-historylinks project site][].[django-historylinks project site]:http://github.com/etianen/django-historylinks“django-historylinks on GitHub”Dave Hall is a freelance web developer, based in Cambridge, UK. You can usually
find him on the Internet in a number of different places:[Website](http://www.etianen.com/“Dave Hall’s homepage”)[Twitter](http://twitter.com/etianen“Dave Hall on Twitter”)[Google Profile](http://www.google.com/profiles/david.etianen“Dave Hall’s Google profile”)
Package: django-hitcount
Basic app that allows you to track the number of hits/views for a particular object.Documentation:http://django-hitcount.rtfd.orgSource Code:https://github.com/thornomad/django-hitcountIssuesUse the GitHubissue trackerfor django-hitcount to submit bugs, issues, and feature requests.Changeloghttp://django-hitcount.readthedocs.org/en/latest/changelog.html
Package: djangohitcounter
AboutPretty simple hit counter for Django ORM objects. It collects hits for any django model objects per date.RequirementsPython 2 & 3Django 1.7+InstallationInstall it using pip (coming soon):pipinstalldjangohitcounteror adddjango_hitcounterto your Python pathAdd thedjango_hitcounterapp to yourINSTALLED_APPS:# settings.pyINSTALLED_APPS=(...,'django_hitcounter',...)UsageUsage is pretty simple too.fromdjango_hitcounter.modelsimportCounterfromdatetimeimportdatetime,timedeltaobj=SomeModel.objects.get(pk=1)# get some django objectCounter.hit(obj)# register hitCounter.hit(obj,amount=2)# register 2 hitsCounter.hit(obj,date=datetime.today().date()-timedelta(days=1))# register hit on yesterday dateCounter.objects.for_model(obj)# get all counter records for our objectCounter.objects.for_model(obj,total=True)# get total hits count for objectLicenseThis software is distributed under the Apache License Version 2.0
Package: django-hitcount-mixed-object
Allow hit count mixed objects represented into relational database, using NoSQL databases.MotivationImagine that you have ordered items, and each one can be customized with diferent toppings.
Example:Round Pizza with toppings (Spinach, Hot Sopresatta)Round Pizza with toppings (Anchovies, Fried Eggplant)So you want to know, the number of items ordered with the same toppings.Application provides the following methodspush_hitobject:model instancerelated_objects:sequence of model instances that compound  the mixed object together the object paramhit_count:number of hits to pushget_hit_countobject:model instancerelated_objects:sequence of model instances that compound  the mixed object together the object paramget_mixed_objectsfilters:dictionary of filter to quering mixed objectslimit:max number of mixed objects to returnoffset:skip to this position before returning the resultsorder_by:order the mixed objects by these keysFeedbackIf you have questions about usage or development you can send an email to rmaceissoft at gmail dot com
Package: djangohmac
Django-HMAC==========|circle| |downloads| |version| |license| |docs|This module provides a middleware for HMAC signature Django views. It's simplydesigned to check that a client is entitled to access routes, based on the factthat it must possess a copy of the secret key.Key features:~~~~~~~~~~~~~- HMAC Middleware- HMAC View decorators- Multiple keys for more services- Service restricted accessSmall example~~~~~~~~~~~~~.. sourcecode:: pythonclass SignedView(View):@decorators.authdef get(self, request):return HttpResponse("for all services")@decorators.auth(only=['userservice'])def post(self, request):return HttpResponse("Only for user service")Dev---To run all tests.. sourcecode::docker run -it -v $PWD:/src -w /src ikalnitsky/pythonista tox.. |circle| image:: https://img.shields.io/circleci/project/thisissoon/djangohmac.svg:target: https://circleci.com/gh/thisissoon/djangohmac.. |downloads| image:: http://img.shields.io/pypi/dm/djangohmac.svg:target: https://pypi.python.org/pypi/djangohmac.. |version| image:: http://img.shields.io/pypi/v/djangohmac.svg:target: https://pypi.python.org/pypi/djangohmac.. |license| image:: http://img.shields.io/pypi/l/djangohmac.svg:target: https://pypi.python.org/pypi/djangohmac.. |docs| image:: https://readthedocs.org/projects/djangohmac/badge/?version=latest:target: http://djangohmac.readthedocs.org/en/latest/?badge=latestChange Log----------1.3.2~~~~~- Fix - unicode key1.3.1~~~~~- Get rid of brackets in decorator- Bugfix: valid signature for resticted view passed validation1.3.0~~~~~- Merge validation of multiple and single signature to single method- Replace middleware classes to one single class HmacMiddleware1.2.0~~~~~- Decorators1.0.5~~~~~- Fix: Django HTTP headers1.0.4~~~~~- Fix: use base64.b64encode instead of base64.urlsafe_b64encode1.0.2~~~~~- Fix: HMAC_SECRET should be optional- `GlobalHmacMiddleware` and `MultipleHmacMiddleware`0.0.1~~~~~- Initial release including the core feature set
Package: djangohmacv3
This module provides a middleware for HMAC signature Django views. It’s simply
designed to check that a client is entitled to access routes, based on the fact
that it must possess a copy of the secret key.Key features:HMAC MiddlewareHMAC View decoratorsMultiple keys for more servicesService restricted accessSmall exampleclassSignedView(View):@decorators.authdefget(self,request):returnHttpResponse("for all services")@decorators.auth(only=['userservice'])defpost(self,request):returnHttpResponse("Only for user service")DevTo run all testsdocker run -it -v $PWD:/src -w /src ikalnitsky/pythonista toxChange Log1.3.2Fix - unicode key1.3.1Get rid of brackets in decoratorBugfix: valid signature for resticted view passed validation1.3.0Merge validation of multiple and single signature to single methodReplace middleware classes to one single class HmacMiddleware1.2.0Decorators1.0.5Fix: Django HTTP headers1.0.4Fix: use base64.b64encode instead of base64.urlsafe_b64encode1.0.2Fix: HMAC_SECRET should be optionalGlobalHmacMiddlewareandMultipleHmacMiddleware0.0.1Initial release including the core feature set
Package: django-hogwarts
Django hogwarts 🧙‍♂️Management commands to generate views, urls and templatesUse CLI commands to generate:basic create, update, list, detail viewsurlpatterns from views with REST like path urlsform, table, detail templates (Bootstrap and django-crispy-forms by default)all commands will respect (will not change) existing codeInstallation# pippipinstalldjango-hogwarts# poetrypoetryadddjango-hogwartsaddhogwartsto yourINSTALLED_APPS:INSTALLED_APPS=[..."hogwarts"]UsageCheckthisto know what urls will be generatedGenerate urls.pyGenerates paths for views from views.pypython manage.py genurls <your-app-name>Arguments:--force-app-name,fanoverride app_name variable in urls.py--override,-ofully overrides existing code in urls.py (previous code will be deleted)--single-import,-sinstead of importing individual view, imports just modulefrom . import viewsGenerate views.pyGenerates create, update, detail, list views for model.
Checkout thedemopython manage.py genviews <your-app-name> <model-name>Arguments--smart-mode,-sadds login required, sets user for CreateView and checks if client is owner of object in UpdateView--model-is-namespace,-mnadds success_url with name model asnamespace--file,-fspecify view file (example: "views/posts_view.py" or "new_views.py") in your appGenerate tests.pyIt generates tests from urls.py for CRUD generic views onlypython manage.py gentests <your-app-name>Generate templatesGenerates templates fromtemplate_names from views from given appdjango-crispy-formsandcrispy-bootstrap5packages are requiredpython manage.py gentemplates <your-app-name>Want to create own scaffolding templates?create folder, copy and customize fromthis templatesadd that folder to settingHOGWARTS_SCAFFOLD_FOLDER = "<your-folder>"ScaffoldingGenerates views, urls and templates for given app (every model in app)python manage.py scaffold <your-app-name>Roadmaptests generatormaybe rest-framework support (let me know in issues)
Package: django-holding-page
Tested versionsPythonPython 2.7.9Python 3.3.5Python 3.4.2Python 3.5.0DjangoDjango 1.8FeaturesUsers can provide their email address and name which is saved in to the database for future exports to systems such as Campaign Monitor.Each user is sent a viral code, which allows them to share your holding page with other people and build up points.Complete use of templates - configure the entire app to your own needs without touching the codeUsageStart up a Django project in the usual way and then ensure you have the requirements installed:pip install django-widget-tweaks==1.4.1To run the tests onPython 2.7install mock too:pip install mock==1.3.0Install django-holding-page pip:pip install django-holding-pageAt the end of settings.py:INSTALLED_APPS += (
    'django.contrib.sites',
    'widget_tweaks',
    'holding_page.subscribers',
)At the end of urls.py:urlpatterns += patterns(
    url(r'', include('holding_page.subscribers.urls', namespace='subscriber',)),
)Remember to migrate:python manage.py migrateFinally, don’t forget to change Django’s default Site at /admin/ so the emails work correctly.TemplatesThe following templates can be overwritten in your templates directory. Seehttps://docs.djangoproject.com/en/1.8/ref/templates/api/#configuring-an-engineWeb pagesbase.htmlsubscriber/subscribe_form.htmlsubscriber/successful_unsubscribe.htmlsubscriber/thank_you.htmlsubscriber/unsubscribe_form.htmlEmailsemail/welcome_body.txtemail/welcome_subject.txtDevelopmentTo develop the holding page package itself:git clone git://github.com/danux/django-holding-page.git
cd django-holding-page
pip install -r requirements.txt
./manage.py test
./manage.py migrateDevelopment Roadmap/IdeasAuto-export to Campaign Monitor, Sales Force, etc“Reserve my username” featureMake it easy to integrate this as a beta holding pen for Django projects (i.e. issue beta invites to your subscribers)Anything else you fancy adding/suggestingPull requests will be reviewed if you choose to share back.History1.0.0First version.
Package: django-homegate
Django Homegate============django-homegate (https://github.com/arteria/django-homegate) provides IDX3.01 API support for your Django project by closing the gap between python-homegate (https://github.com/arteria/python-homegate) and your real estate Django app.Installation------------To get the latest stable release from PyPi.. code-block:: bash$ TODOTo get the latest commit from GitHub.. code-block:: bash$ pip install -e git+git://github.com/arteria/django-homegate.git#egg=django_homegateAdd ``django_homegate`` to your ``INSTALLED_APPS``.. code-block:: pythonINSTALLED_APPS = (...,'django_homegate',)Usage-----django-homegate is a helper app providing a management command to push the new records to Homegate using the API implementation of python-homegate (https://github.com/arteria/python-homegate). If you install from  PyPi, this package will be installed as dependency.To connect you real estate model, register your model in the settings and implement a model manager method that returns all records (real estate objects) to push to Homegate. In addition, a ``get_idx_record()`` and ``published_idx_record()`` method must be implemented on your real estate model to get access to the data to push to Homegate and to update the status of the record. There is an example provided in ``django_homegate/models.py``.To register the model do not forget to set the app label in your real estate model, eg. '<real-estate>', and in your settings.py add ``HOMEGATE_REAL_ESTATE_MODEL = '<your-app>.models.<real-estate-class>'``.The manager method name is ``ready_to_push()``, so.. code-block:: python>>> objs = RealEstate.objects.ready_to_push()will return a QuerySet containing all real estate objects to publish to Homegate. There is an example provided in ``django_homegate/models.py`` as well.In ``settings.py`` add ``HOMEGATE_AGENCY_ID = '<your-agency-id>'``,  ``HOMEGATE_HOST = '<homegate-host>'``, ``HOMEGATE_USERNAME = '<your-username>'`` and  ``HOMEGATE_PASSWORD = '<your-password>'``.For more info about model managers and app labeling see:http://www.djangobook.com/en/2.0/chapter10.htmlhttps://docs.djangoproject.com/en/dev/ref/models/options/#django.db.models.Options.app_labelContribute----------If you want to contribute to this project, please perform the following steps.. code-block:: bash# Fork this repository# Clone your fork$ mkvirtualenv -p python2.7 django-homegate$ python setup.py install$ pip install -r dev_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.. image:: https://d2weczhvl823v0.cloudfront.net/philippeowagner/django-homegate/trend.png:alt: Bitdeli badge:target: https://bitdeli.com/free
Package: django-honeypot-signals
Django Admin Honeypot SignalsIf you are using the admin_honeypot App to log failed login attempts, you may want to be notified via email.Features:If someone tries to login using the wrong admin url, django-admin-honeypot creates a new model instance, which includes all significant information about this attempt. After save() the signal handler sends a notification email to settings.MANAGERS, which includes the basic model information.How to useGet und implement django-admin-honeypot:django-admin-honeypotMake sure it is working perfect.Install this package:pip install -e git://github.com/bitmazk/django-honeypot-signals#egg=honeypot_signalsAddhoneypot_signalsto yourINSTALLED_APPS:INSTALLED_APPS = (
    [...]
    'honeypot_signals',
}AddMANAGERSto yoursettings.py:MANAGERS = (
    ('Foo Bar', 'foobar@example.com'),
)
Package: django-honeywords
=================Django Honeywords=================Django implementation of the `Honeywords Project`_ by Ari Juels and Ronald L. Rivest... _Honeywords Project: http://people.csail.mit.edu/rivest/honeywords/Generates a list of honeywords along with the actual user password on user registration. If the wrong compromised honeyword is used to login, the user account will be automatically deactivated.Written for Django 2.2 on Python 3.6Honeychecker Quick Link-----------------------`Honeychecker`____ honeychecker.py_Quick Start-----------#) Install Django Honeywords::pip install django-honeywords#) Add ``honeywords`` to ``INSTALLED_APPS`` in ``settings.py``::INSTALLED_APPS = [...'honeywords',]#) Add ``honeywords.hashers.HoneywordHasher`` to top of ``PASSWORD_HASHERS`` in ``settings.py`` (or add ``PASSWORD_HASHERS`` if missing)::PASSWORD_HASHERS = ['honeywords.hashers.HoneywordHasher','django.contrib.auth.hashers.PBKDF2PasswordHasher','django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher','django.contrib.auth.hashers.Argon2PasswordHasher','django.contrib.auth.hashers.BCryptSHA256PasswordHasher',]#) Add ``honeywords.backends.HoneywordsBackend`` to the top of ``AUTHENTICATION_BACKENDS`` in ``settings.py`` (or add ``AUTHENTICATION_BACKENDS`` if missing)::AUTHENTICATION_BACKENDS = ['honeywords.backends.HoneywordsBackend','django.contrib.auth.backends.ModelBackend',]#) Add ``HONEYCHECKER_URI = http(s)://<url/ip>:<port>`` into ``settings.py``::HONEYCHECKER_URI = 'http://192.168.56.101:55555'#) Create Honeywords table::./manage.py makemigrations honeywords./manage.py migrate#) Download `honeychecker.py`_ to the Honeychecker server::wget -c https://raw.githubusercontent.com/ooknosi/django_honeywords/master/src/honeywords/honeychecker.py.. _honeychecker.py: https://raw.githubusercontent.com/ooknosi/django_honeywords/master/src/honeywords/honeychecker.py#) Edit the ``IP``, ``PORT`` and ``DATABASE`` settings in ``honeychecker.py``::### SettingsIP = '192.168.56.101'PORT = 55555DATABASE = 'honeychecker_db.sqlite3'####) Run ``honeychecker.py`` on the Honeychecker server::python honeychecker.pyDocumentation-------------TODO
Package: django-hookbox
IMPORTANT NOTEAlthough hookbox is a very quick and easy way to experiment with COMET, it is
not suitable for production use at this time. Unfortunately, at the time of
writing, the hookbox project looks moribund. Hopefully this situation changes
soon, but for the meantime this module should only be used for quick
prototypes and experimentation.RequirementsDjango 1.3+Hookbox 0.3.3testfixtures 1.9.2+ (for unit tests)It should work with Django 1.2 and earlier versions of testfixtures, however it
has not been tested. If you try it please let me know how you get on.Other versions of hookbox (including the latest dev versions) probably willnotwork, as things like command-line option names and URLs seem to change
frequently. On the other hand, any problems should be easy to fix.InstallationInstall the usual way, e.g.:pip install django-hookboxAdd toINSTALLED_APPSinsettings.py:INSTALLED_APPS = (
    ...
    'django_hookbox',
    ...
)Add to yoururls.py:urlpatterns = patterns('',
    ...
    (r'^hookbox/', include('djhookbox.urls')),
    ...CONFIGURATIONAt a minimum you will need a channel handler to allow channel creation. E.g.:@whcallback('create')
def create_good_channels(op, user, channel = '-'):
    assert op == 'create'
    if channel.startswith('/good/'):
        return {
          'history_size': 1,
          'reflective':   False,
          'presenceful':  False,
          'moderated':    True,
        }
    elif channel.startswith('/bad/'):
        return 'no cookie for you!'The first time a user subscribes to a channel it is implicitly created. If no
create callback returns an options dict this will fail.To fail operations (e.g. deny a subscription attempt) provide callbacks that
return a failure message or raise an exception.You will probably also want to configure various hookbox options insettings.py. The available options are:HOOKBOX_INTERFACE: The interface the hookbox server listens on.
HOOKBOX_PORT: The port the hookbox server listens on.
HOOKBOX_CBHOST: The host the Django server listens on.
HOOKBOX_CBPORT: The port the Django server listens on.
HOOKBOX_CBPATH: The path prefix the webhook views are located under.
HOOKBOX_WEBHOOK_SECRET: A secret token passed by hookbox to webhooks.
HOOKBOX_REST_SECRET: A secret token passed by Django to hookbox.
HOOKBOX_ADMIN_PASSWORD: The hookbox administrator password.USAGEA management command is provided to run the hookbox server. See./manage.py help runhookboxfor the available options. By default options
fromsettings.py(see above) will be used.To publish to a channel from with Django call, e.g.:djhookbox.publish('/some-channel/', {'data': 'some-data'})
Package: django-hookup
Django HookupSimple Django Hooks.Install:pipinstalldjango_hookupRegister function:# myapp.hooks.pyimportdjango_hookup@django_hookup.register("register_foobar",order=1)defsay_foo(text):"""Concat foo and given text"""return"foo:%s"%text@django_hookup.register("register_foobar",order=0)defsay_bar(text):"""Concat bar and given text"""return"bar:%s"%textCalling hooks# myapp.somewhere.pyimportdjango_hookuphooks=django_hookup.get_hooks("register_foobar")text=""forfuncinhooks:text+=func(func.__name__)print(text)Hooks Admin (Optional)Add django_hookup in settings.py# settings.pyINSTALLED_APPS=["example.app","django_hookup",#'django.contrib.admin',...]Add django_hookup.url# settings.pyurlpatterns=[path("admin/hooks/",include("django_hookup.urls")),path("admin/",admin.site.urls),]