Saravanan666/pypi-org huggingface dataset:
Package: django-nagios-cache
# django-nagios-cache## OverviewThis Django package provide Models for syncing data fom a Icinga/Nagios instance.This may useful if you want to make queries to you monitoring system withoutdirectly connect to it for each lookup.It is currently tested with Icinga 1.10.3.The package consist of 2 main parts### Django ModelsThis is the datastruructure. I directly correlates with the Nagios/Icinga Services,Servicegroups, Hosts and Hostgroups.### Management CommandThe package provides a Management Command to sync the Data from the Nagios/Icinga Server.You may also sync only parts of monitoring data e.g. only specific Hostgroups or Servicegroups## InstallationTo install simply fetch it from pypi.```pythonpip install django-nagios-cache```After that you have to add ```nagios_cache``` to your ```INSTALLED_APPS``` andrun```python manage.py migrate nagios_cache```This will add the 4 Models to your database.## Configurationdjango-nagios-cache reads 4 configuration variables from your settings.py:```pythonNAGIOS_CACHE_URL = "https://monitoring.example.org/cgi-bin/icinga/status.cgi"NAGIOS_CACHE_USER' = "nagios_user",NAGIOS_CACHE_PASSWORD' = "password_4_nagios_123",NAGIOS_CACHE_AUTOCLEAN = FalseNAGIOS_CACHE_AUTOCLEAN_DAYS = 5```You MUST specify ```NAGIOS_CACHE_URLNAGIOS_CACHE_URL```, while the other 2 are optional.If there are no authentication details, ```django-nagios-cache``` will fetch thedata without authentication.If you set ```NAGIOS_CACHE_AUTOCLEAN = True``` every query will automaticallyclean up the last ```NAGIOS_CACHE_AUTOCLEAN_DAYS``` unsynced entries.## UsageAt the first run you may want to execute```python manage.py nagios_sync```This will sync everything. Note this could take some time. On my machine 20000 checks, 1500 hosts, 200 hostgroups and 10 servicegroups this take about 4 minutes.Later you may chose only to sync specific parts. Have a look at```./manage.py nagios_sync --help...--hostgroups [HOSTGROUPS [HOSTGROUPS ...]]Only sync the given hostgroups--servicegroups [SERVICEGROUPS [SERVICEGROUPS ...]]Only sync the given servicegroups--sync-hosts          Sync hosts--sync-services       Sync services--sync-hostgroups     Sync hostgroups--sync-servicegroups  Sync servicegroups--clean               Cleanup database entries that are old than 1 day```You can add this script to a crontab or use the API for a celery task. Have alook at ```nagios_cache/management/commands/nagios_sync```. There are the calls forthe commandline options above.```pythonfrom django.utils import timezonet = timezone.now()NagiosHostStatus.clean_old(t)NagiosServiceStatus.import_all(t)NagiosHostgroup.import_all(t)NagiosServicegroup.import_single(t, 'dns')```
Package: django-naguine
Naguine=======[![Build Status](https://travis-ci.org/colexyz/django-naguine.svg?branch=master)](https://travis-ci.org/colexyz/django-naguine)[![codecov](https://codecov.io/gh/colexyz/django-naguine/branch/master/graph/badge.svg)](https://codecov.io/gh/colexyz/django-naguine)Django Web Framework's sidekick, Sophie "Naguine" Ziegler.Requirements============- Python: 3.6- Django: 2.0, 2.1Install=======`pip install django-naguine`and add `naguine` to your project's `INSTALLED_APPS`:```INSTALLED_APPS = [...'naguine',]```
Package: django-naivedatetimefield
# django-naivedatetimefield
![build status](https://api.travis-ci.org/camflan/django-naivedatetimefield.svg?branch=master)
[![PyPI version](https://badge.fury.io/py/django-naivedatetimefield.svg)](https://pypi.org/project/django-naivedatetimefield/2.0.0)NaiveDateTimeField offers the ability to store a naive timestamp, useful for baking in a local timestamp.## Installationpip install django-naivedatetimefield## Contributors
- [Camron Flanders](https://github.com/camflan)
- [Alex Hill](https://github.com/AlexHill)
- [Lincoln Puzey](https://github.com/LincolnPuzey)
Package: django-namek
Django Namek is a Django app for forms chaining with some features :Manage Django forms in Django sessionReuse genericviews: IndexView, ValidationView and ResultsViewPerform an action with the results of the formsTests written with SeleniumSetup1 - Install with pip :pip install django_namek2 - Create your formsfrom django import forms
from django_namek import abstract


class LocationForm(abstract.Form):
    display_name = "Location"
    slug = "location"

    address_line = forms.CharField(
        label='Adresse',
        max_length=100
    )
    zip_code = forms.CharField(
        label='Postal Code',
        max_length=5
    )
    city = forms.CharField(
        label='City',
        max_length=100
    )3 - Create your workflowsfrom django_namek import abstract
from . import forms


class PersonWorkflow(abstract.WorkflowView):
    display_name = 'Person'
    slug = 'person'
    forms = [
        forms.LocationForm,
        forms.ActivityForm,
    ]


class CompanyWorkflow(abstract.WorkflowView):
    display_name = 'Company'
    slug = 'company'
    forms = [
        forms.LocationForm,
        forms.ActivityForm,
    ]4 - Create an action :import hashlib
from django_namek.actions import Action


class Md5(Action):

    def run(self):
        address_line = self.session.get_field('address_line', '')
        zip_code = self.session.get_field('zip_code', '')
        city = self.session.get_field('city', '')
        activity = self.session.get_field('activity', ['empty'])

        md5 = hashlib.md5()

        md5.update(address_line.encode())
        md5.update(zip_code.encode())
        md5.update(city.encode())
        md5.update(activity[0].encode())

        self.res['md5'] = md55 - Change your Django settings.py. For more customization, take a look atconstants.py:INSTALLED_APPS = [
    ...
    'django_namek',
]
...
SESSION_ENGINE = "django_namek.session"
DN_WORKFLOWS = [
    'tests.views.PersonWorkflow',
    'tests.views.CompanyWorkflow',
]
DN_BASE_URL = "http://localhost:4243"
DN_ACTION_CLASS = "tests.actions.Md5"6 - Add Django Namek urls :from django.urls import include, path

urlpatterns = [
    ...
    path('', include('django_namek.urls', namespace='django_namek'))
]Optional : configure an email backend with django for validation view (example withanymail[sendgrid]) :ANYMAIL = {
    "SENDGRID_API_KEY": xxxxxx,
}
EMAIL_BACKEND = "anymail.backends.sendgrid.EmailBackend"
DEFAULT_FROM_EMAIL = "mail@example.com"
SERVER_EMAIL = "mail@example.com"Development envgit clone git@github.com:Aleksi44/django-namek.git
pip install -r requirements.txtRun Django Serverpython manage.py migrate
python manage.py init
python manage.py runserver 0.0.0.0:4243TestsThis test allows you to test all workflows with selenium :python manage.py test django_namek.tests
Package: django-nameko
django-namekoTravis-CIBranchBuild statusmasterdevelopDjango wrapper forNamekomicroservice framework.supporttested withpython 2.7, 3.5, 3.6, 3.7django 1.11, 2.0, 2.1, 2.2nameko 2.11, 2.12How to usefromdjango_namekoimportget_pool# Within some view or model:withget_pool().next()asrpc:rpc.mailer.send_mail(foo='bar')Installationpipinstalldjango-namekoConfiguration# Config to be passed to ClusterRpcProxyNAMEKO_CONFIG={'AMQP_URI':'amqp://127.0.0.1:5672/'}# Number of proxies to create# Each proxy is a single threaded standalone ClusterRpcProxyNAMEKO_POOL_SIZE=4# Set timeout for RPCNAMEKO_TIMEOUT=15# timeout 15 seconds# Add this dictionary to context_data of every RPCNAMEKO_CONTEXT_DATA={'hostname':"my.example.com"}# Create multiple ClusterRpcProxy pool each one assoiate with a name# Every pool with pool name different than 'default' will use 'default' pool config as default configurationNAMEKO_CONFIG={'default':{'AMQP_URI':'amqp://','POOL_SIZE':4,'POOL_CONTEXT_DATA':{"common":"multi"},'POOL_TIMEOUT':None},'pool1':{'AMQP_URI':'amqp://pool2','POOL_CONTEXT_DATA':{"name":"pool1","data":123},},'pool2':{'AMQP_URI':'amqp://pool3','POOL_CONTEXT_DATA':{"name":"pool2","data":321},'POOL_TIMEOUT':60},'pool3':{'POOL_SIZE':8,'POOL_TIMEOUT':60}}# Use multi pool by putting pool name in get_pool(..)fromdjango_namekoimportget_poolwithget_pool('pool1').next()asrpc:rpc.mailer.send_mail(foo='bar')# call get_pool() without argument will return the 'default' pool# but you can override the rpc context data before call, example below.# it will auto revert back to POOL_CONTEXT_DATA when exit the with blockwithget_pool().next()asrpc:rpc._worker_ctx.data['SMTP_SECRET']='SECRETXXX'rpc.mailer.send_mail(foo='bar')# try to call rpc outside of with statement block will raise an AttributeError exceptionrpc.mailer.send_mail(bar='foo')#   File "/usr/local/lib/python2.7/site-packages/django_nameko/rpc.py", line 69, in __getattr__#     raise AttributeError(item)# AttributeError: mailer# New feature (from 0.7.0):# To dispatch event to any service event listener, for example you have this nameko service:fromnameko.eventsimportevent_handlerclassEchoService(object):name='echo'@event_handler("echo","ping")defhandle_event(self,payload):print("service echo received:%s",payload)# You can sent an event signal to all service listener like thisfromdjango_namekoimportdispatchdispatch("echo","ping",{"payload":{"data":0}})contributeto run the tests:run a local rabbitmqexecute toxdockerrun--rm-p15672:15672-p5672:5672-p5671:5671--namenameko-rabbitmqnameko/nameko-rabbitmq:3.6.6# open another shell then runpythonsetup.pytest# to run full test with coverage usetoxCreditsThanks to guys who made an awesomeNamekoframework.Maintainers:Andrew Dunai (@and3rson)Vincent Anh Tran (@tranvietanh1991)
Package: django-nameko-standalone
This package setup the django framework to take advantage of the ORM features and some other django features.You need to specify the DJANGO_SETTINGS_MODULE environment variable, if not, ‘settings’ is used by default.Inject the dependency into the nameko service with the DjangoModels dependency.Supposing you injected the DjangoModels dependency into themodelsvariable, you can use from your procedures likeself.models.MyModel.objects.all().
Package: django-namespaced
Django supports namespaces that help applications find out their current
namespace and refer to themselves in a stable way even if there are more
than one instance of the same module in the url patterns.However, Django does not automatically set thecurrent_appcontext
which means that the app will actually resolve the namespaced urls to
the last announced instance of itself.This context processor digs the detail up and voilá.UsageThe context processor needs to be added to the template configuration. The
rude way to do it is as follows:TEMPLATES[0]['OPTIONS']['context_processors'].append(
    'namespaced.context_processors.namespaced')Using a context processor for this use is a bit questionable and generally
a middleware would be the correct place to edit requests. However middlewares
are executed at a stage where the URL resolution has not been matched and will
traverse all URLs even if they are not going to be used. This code is mostly
relevant in views anyway.This enables you to have two separate instances of the same app in two
different urls. Normally Django would always refer to the last instance by the
app name which will mess up all internal linkage within any of the previous
instances. Let’s assume we have this inside an app:{% url 'myapp:index' %}To make this work for both instances, theurls.pyshould look something
like this:urlpatterns = [
    url(r'^first/', include('myapp.urls', namespace='first', app_name='myapp')),
    url(r'^last/', include('myapp.urls', namespace='last', app_name='myapp)),
]The apps can refer to themselves withmyapp:, each other withfirst:andlast:. It will most likely make sense to use the explicit names in the rest
of the project.For now, the use without namespaces has not been tested.
Package: django-namespaces
django-namespacesUse namespaces in requests using Django.MotivationGoogle Cloud has an interest feature for namespacing projects. Namespacing can enable assets to be isolated from each other without needing to leverage subdomains and/or multiple databases (although you can use those too).InstallationUse a virtual environment whenever using Python packages. The built-invenvmodule is great.python3 -m venv venv
source venv/bin/activate
$(venv) python -m pip install django-namespaces --upgradeConfigure your Django ProjectCreate a Django Project$(venv) mkdir -p src && cd src
$(venv) django-admin startproject cfehome .Installed AppsAdddjango_namespacesto yourINSTALLED_APPSinsettings.py:INSTALLED_APPS=[...'django_namespaces',]Update MiddelwareUpdateMIDDLEWAREinsettings.pyto includeNamespaceMiddleware:MIDDLEWARE=[...'django_namespaces.middleware.NamespaceMiddleware',]This gives us access to therequest.namespaceobject in our views.Basic Usageimportdjango_namespacesdjango_namespaces.activate("hello-world")This will add a namespace to the request object.defmy_hello_world_view(request):print(request.namespace)# <Namespace: hello-world>print(request.namespace.value)# hello-worldreturnHttpResponse("Hello World")Optional ViewsUsing views are optional. You can also use theactivatefunction to activate a namespace.Update URLconfUpdateurls.pyto includenamespaces.urls:urlpatterns=[...path('namespaces/',include('django_namespaces.urls')),]Create a NamespaceCreate a namespace by visitinghttp://localhost:8000/namespaces/create/and filling out the form.Activate a NamespaceActivate a namespace by visitinghttp://localhost:8000/namespaces/and hittingactivateon your newly created namespace.You can also use:Update URLconf
Package: django-nandy-login
Login is a Django app with customized user needs.
Detailed documentation is in the “docs” directory.Quick startAdd “Login” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'Login',
]Include the Login URLconf in your project urls.py like this:path('', include('Login.urls')),Runpython manage.py migrateto create the Login User models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a user (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/login/to login in.
Package: django-nani
Warningdjango-nani is still in early alpha status, please use it with
caution.About this projectThis project is yet another attempt at making model translations suck less in
Django.FeaturesTested (on Django 1.2 through Django trunk and Python 2.5, 2.6 and 2.7 as well
as PyPy 1.5, checkhttp://ci.django-cms.org/job/django-nani/)Documented (check outhttp://django-nani.readthedocs.org)Simple APIPredictableReliableFast (few and simple queries)High level (no custom SQL Compiler or other scary things)Please refer to the documentation athttp://django-nani.readthedocs.orgfor more
information.
Package: django-nanoid
django-nanoidA tiny, secure, URL-friendly, unique string ID generator for Python.support inDjango.StatusThis project is actively maintained.InstallationTo install django-nanoid frompip:$pipinstalldjango-nanoidTo install nanoid from source:$gitclonegit@github.com:yosephbernandus/django-nanoid.git$cddjango-nanoid&&pythonsetup.pyinstallUsageAdding a NANOID field to your Django models is straightforward, default length is 21. Can adjust the length using max_lengthfromdjango.dbimportmodelsfromdjango_nanoid.modelsimportNANOIDFieldclassPost(models.Model):id=NANOIDField(secure_generated=True,editable=False)Passing this will automatically generate a unique identifier, with secure generatedfromdjango.dbimportmodelsfromdjango_nanoid.modelsimportNANOIDFieldclassPost(models.Model):post_identifier=NANOIDField(size=10,alphabetically='mnhjksloiwnhA..!@$$$!#',secure_generated=False)Passing this will automatically generate a unique identifier, with non_secure_generated with custom alphabetically and lengthContributingIf you would like to contribute, simply fork the repository, push your changes and send a pull request.
Pull requests will be brought into themasterbranch via a rebase and fast-forward merge with the goal of having a linear branch history with no merge commits.LicenseApache 2.0DependenciesDjangopy-nanoidChangelogVersion 0.0.2 (2023-10-19)Support nanoid prefix. Thanks lodye509!
Package: django-nanoid-field
Django NanoID FieldNanoID is an alternative to UUID, CUID for generating random IDs. This package
provides a field to use in models.InstallationInstall it from PyPI:pipinstalldjango-nanoid-fieldUsageFirst, add it to your applications (Not Required)INSTALLED_APPS=[# ...'nanoid_field',# ...]You can now use it in your models like:fromdjango.dbimportmodelsfromnanoid_fieldimportNanoidFieldclassProfile(models.Model):hash=NanoidField(max_length=10,alphabet='0123456789abcdefghijklmnopqrstuvwxyz)NanoidFieldThis model field is based onCharField. All of it's parameters can be used.Additionally following fields affects outcome of NanoID:max_lengthParameter (Optional)Determines size of the generated ID as well as length of the field in Database.DEFAULT:21alphabetParameter (Optional)This optional parameter helps you to determine which characters will be used to
build up.DEFAULT:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-Using NanoidField asprimary_keyCurrently Django Auto Field feature does not allow using fields other than
Integer based fields. Until this ability changes you cannot use this as AutoField.To use NanoID as defaultprimary_keyyou need to explicitly define it in your
model:fromdjango.dbimportmodelsclassSomeModel(models.Model):id=NanoidField()# ...Changing defaultsdjango-nanoid-fieldalso provides two settings to change defaults ofalphabetandmax_length. You can change those by adding them to yoursettings.pyfile# settings.py fileNANOID_ALPHABET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"NANOID_SIZE=21
Package: django-nanolog
Nanolog is a simple Django app to store simple logs, basically for statistical purposes.Detailed documentation is in the “docs” directory.Quick startAdd “nanolog” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'nanolog',
)Runpython manage.py migrateto create the nanolog models.UsageImport nanolog and log everything like this:from nanolog.utils import nanolog
nanolog('access', 'webinar_detail', 'Webinar Title', request=request)
nanolog('changed_password', 'from:x|to:y', 'as we sugested', self.user, '127.0.0.1', log_object)
nanolog('changed_password', 'from:x|to:y')TestJust run:./manage.py test nanolog
Package: django-naomi
Django-naomi is a email backend for Django that let you preview email from your web browser instead of sending it using SMTP server. This is perfect for development environment that lack of SMTP server or you want to debug the email message. Attachment will be shown as link. This library is inspired fromLetter Opener.Django SetupFirst, install django-naomi by using pip. You can adddjango-naomito your requirements file or run this command.pip install django-naomiThen, addnaomito yourINSTALLED_APPSon your django settings file.INSTALLED_APPS += ('naomi',)Lastly, change the Django email backend and set the temporary directory.EMAIL_BACKEND = "naomi.mail.backends.naomi.NaomiBackend"
EMAIL_FILE_PATH = "/home/test/tmp"Please make sure that theEMAIL_FILE_PATHdirectory is writeable. That’s all you need to do. Now, every time you send email it will shown on your web browser.Development and FeedbackQuestions or problems? Please use the issue tracker. If you would like to contribute to this project, fork this repository and send me a pull request.
Package: django-nap
django-napRead The Docs:https://django-nap.readthedocs.io/en/latest/Change log:https://django-nap.readthedocs.io/en/latest/changelog.htmlAn API library for DjangoA minimalist approach to object de/serialisers, RESTful views, and RPC views.BenefitsModularUnlike some tools, the Serialiser definition is separate from the API.This not only makes it easier to have different ‘shapes’ of data for
different endpoints, but also allows using them in more places, not just
your API.SimpleIf you want an API that provides every feature ever, go look at Django REST
Framework.  But if you want something simple and fast, this is your tool.OverviewInstallingIt is NOT necessary to add nap to your INSTALLED_APPS.  It does not provide
models, templates, template tags, or static files.Tests are currently run for Python 3.4-3.7 and pypy3, and against Django
versions 2.0 and up.
Package: django-nativeshortuuidfield
django-nativeshortuuidfieldProvides a NativeShortUUIDField for your Django models which uses the base-57 "Short UUID" package athttps://github.com/stochastic-technologies/shortuuid/to be used in Python
and store it as full UUID in database.InstallationInstall it with pip (or easy_install):$pipinstalldjango-nativeshortuuidfieldUsageFirst you'll need to add a NativeShortUUIDField to your class:fromnative_shortuuidimportNativeShortUUIDFieldclassMyModel(models.Model):uuid=NativeShortUUIDField(unique=True,default=uuid.uuid4)If you want to add the ability to search by shortuuid inModelAdminyou need to inheritNativeUUIDSearchMixinfromnative_shortuuid.adminimportNativeUUIDSearchMixin@admin.register(models.MyModel)classMyModelAdmin(NativeUUIDSearchMixin,admin.ModelAdmin):search_fields=('uuid',)If you want to have to ability to write your own uuid search fields listfromnative_shortuuid.adminimportNativeUUIDSearchMixin@admin.register(models.MyModel)classMyModelAdmin(NativeUUIDSearchMixin,admin.ModelAdmin):admin_auto_extract_uuid_search_fields=Falsesearch_fields=('name',)search_uuid_fields=['uuid','foreign_model__uuid']Enjoy!SettingsADMIN_AUTO_EXTRACT_UUID_SEARCH_FIELDS: defaultTrueThis setting is to autofillsearch_uuid_fieldsin the ModelAdmins that inheritsNativeUUIDSearchMixinwith all shortuuid fields that are in thesearch_fieldsarray.
if you turned it off, you'll need to definesearch_uuid_fieldson you ModelAdmin in order to search on shortuuid fieldsNotesNativeShortUUIDField is a subclass of django.db.models.UUIDFieldYou can pass usual Django UUIDField parameters on init, although some of them are added/overwritten:blank=True, editable=False (set auto=False to remove these fields enforcement)Contribution NotesPull RequestIncrease the version number in thesetup.pyto the new version that the new pull request represents.Publishing the PackageAfter the pull request gets merged into the master branch a new release should be createdCreate a new tag with the same version number you updated thesetup.pywith:$gitcheckoutmaster
$gittag-a2.1.0-m'fix importing order'$gitpushorigin2.1.0Go to GitHub's releases section and create a new release:Chose the tag version that you just createdFill the release title with the same version numberAdd a description of the release and publish it
Package: django-native-tags
Native Tags Documentation=========================:Authors:Justin Quick <justquick@gmail.com>:Version: 0.5::pip install django-native-tags==0.5.3Django Native Tags is a way of making the creation of template tags stupidly simple.Tags are "native" because there is a much closer relationship between the tag in the template and a Python function behind the scenes.The app abstracts the work needed to parse out the templatetag syntax into a useable form for a Python function.For example:Define an arbitrary function in your templatetags::def add(x, y):return x + yadd.function = TrueUse the function in your template::{% add 1000 100 as num %}{{ num|intcomma }}Which outputs::1,100Other features of Native Tags:* Keyword argument parsing* Quoted strings parsed correctly* Add templatetags to Django's builtins (no ``{% load %}`` required)* Auto resolve of template variables* Universal and per-tag caching* Straightforward template tag unittesting* Error tolerant by letting you specify a fallback return valueThe real power of the module comes in the contrib add ons which has tons of tags for various uses includingcomparisons, regex operations, math operations, and much more. By default it is a functional replacement to `James Bennett`_'s `django-template-utils`_ right out of the box.. _django-template-utils: http://bitbucket.org/ubernostrum/django-template-utils/.. _James Bennett: http://www.b-list.org/For full documentation, checkout the `Sphinx doc`_.. _fancy Sphinx doc: http://justquick.github.com/django-native-tags/Email me with any questions/concerns/issues/hate mail:justquick [@] the gmails .com