Saravanan666/pypi-org huggingface dataset:
Package: django-pyp8s
django-pyp8sDjango application for pyp8s — customisable prometheus exporter for your python application.Installationpython3-mpipinstalldjango-pyp8sUsageExamples:https://github.com/pyp8s/examplesurls.pyfromdjango.urlsimportpath,includeurlpatterns+=[path('',include('django_pyp8s.urls')),]settings.pyINSTALLED_APPS+=[django_pyp8s,]Reporting bugsPlease, use GitHub issues.Requesting new functionalityPlease, use GitHub issues.
Package: django-pypi
PyPi structured in your database accessible through the ORM.InstallationTo get the latest stable release from PyPi$pipinstalldjango-pypiTo get the latest commit from GitHub$pipinstall-egit+git://github.com/Celc/django-pypi.git#egg=pypiTODO: Describe further installation steps (edit / remove the examples below):Addpypito yourINSTALLED_APPSINSTALLED_APPS=(...,'pypi',)Don’t forget to migrate your database./manage.pymigratepypiUsageUse./manage.py pypi_refreshto fetch pypi, this is going to take a while.Then just start querying the ORM:>>>package=Package.objects.get(name='Django')>>>package.versions.values_list('version',flat=True)[u'1.0.1',u'1.0.2',u'1.0.3','...(remaining elements truncated)...']ContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your fork$mkvirtualenv-ppython2.7django-pypi$pythonsetup.pyinstall$gitco-bfeature_branchmaster# Implement your feature and tests$gitadd.&&gitcommit$gitpush-uoriginfeature_branch# Send us a pull request for your feature branch
Package: django_pypuppetdb
django-pypuppetdbdjango-pypuppetdb is a library that handles authentication
by using the PuppetDB’s REST API to get Users that are registrated
in PuppetDB. It is implemented using therequestslibrary.To use this library you will need:Python 2.7+Python 3.3+Django 1.8pypuppetdbInstallationYou can install this package from source or from PyPi.$pipinstalldjango-pypuppetdb$gitclonehttps://github.com/nedap/django-pypuppetdb$pythonsetup.pyinstallDjangoTo let django connect to puppetdb in order to get your user
add the following line to you settings.add “django_pypuppetdb” to INSTALLED_APPS.add “django_pypuppetdb.django_authentication.PuppetDBAuthentication” to AUTHENTICATION_BACKENDSadd the followin settingsPUPPETDB_HOST='localhost',PUPPETDB_PORT=8080,PUPPETDB_NODE='node',PUPPETDB_KEY=None,PUPPETDB_CERT=None,PUPPETDB_SSL_VERIFY=FalsePUPPETDB_ADMIN_GROUP='admins'TastypieIf you are using tastypie as API framework and want to use pypuppetdb to
validate the user you can add the following line to your resource filefromdjango_pypuppetdb.tastypie_authenticationimportPuppetDBAuthenticationinyourclassMetaadd:authentication=PuppetDBAuthentication()if you would like to use multiple authentications you can useauthentication=MultiAuthentication(ApiKeyAuthentication(),PuppetDBAuthentication())Getting HelpThis project is still very new so most likely there will be issues
you’ll run into.For bug reports you can file anissue. If you need help with something
feel free to hit up@eagllusby e-mail.Changelog0.0.1Initial release. Implements most of authorization for django.0.0.2Separating Django and Tastypie dependency.0.0.3Renaming Django authenticaton and updated all tests
Renaming Tastyie authentication and updated all tests0.1.0Django and Tastypie fully tested0.1.1Adding check for puppet group that will check if the user
is in the group defined in PUPPETDB_ADMIN_GROUP. This will give the
user admin rights allowing the user to login django-admin.0.2.0Updating files to make it django 1.8 compatible.0.2.1Updating requirements file to newest versions.
Package: django-pyres
Aboutdjango pyres provides a way to run workers via the django manage.py command.MotivationSeveral people have asked how to interact with the django orm from within pyres jobs. By running the
workers through the manage command, you don’t have to mess around with setting variables in the os.environ object.Changes0.1.2 - cleaned up the decorators so database connections are closed at the end of a job.
Package: django-pyseo
SEO apps for DjangoDocumentationThe full documentation is athttps://django-pyseo.readthedocs.org.QuickstartInstall django-pyseo:pip install django-pyseoThen use it in a project:import pyseoFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-test.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-02-01)First release on PyPI.
Package: django-pytds
Django-pytdsis a port ofDjango-mssqlthat provies a Django database backend for Microsoft SQL Server using pure python TDS implementation.TODO DocumentationRequirementsPython 2.7pytdsSQL Server VersionsSupported Versions:200520082008r2The SQL Server version will be detected upon initial connection.Django VersionThe current version of django-mssql supports Django 1.2 thru 1.4. Django versions
1.0 and 1.1 are no longer actively supported, but working versions may be
found with the tagslegacy-1.0andlegacy-1.1.ReferencesDB-API 2.0 specification:http://www.python.org/dev/peps/pep-0249/
Package: django-pytest
This project allows you to use py.test as a django test runner, instead of the
default test runner.To use it, add it to your python path and adddjango_pytestto your installed
apps. Also set theTEST_RUNNER = ‘django_pytest.test_runner.run_tests’setting.
If you’re using Django 1.3 or newer setTEST_RUNNER = ‘django_pytest.test_runner.TestRunner’or Django will print
deprecation warnings each time you run your tests.Also create aconftest.pyin your project directory and include:from django_pytest.conftest import pytest_funcarg__client, pytest_funcarg__django_clientYou can also use:from django_pytest.auth_funcargs import pytest_funcarg__user, pytest_funcarg__groupsto import a user or some groups with users in themNow anywhere in your project, you can create files calledtest_<something>.py.  These are standard py.test test files. Use the funcargclientin every test to both instantiate a test database that is cleared
after each test and to provide you with a django test client object identical
to the one used in django’s test system. For example:def test_filter(client):
response = client.get(‘/browse/’, {‘filter’: ‘1’})
assert response.status_code == 200Use./manage.py testto run the py.test test runs (ie: it replaces the
standard django test runner). You can pass py.test options to the command
and they will be forwarded to py.test. (Technically, I haven’t got it passing
all options, just the most common ones I use)The management command has been set up so that syncdb will use the django core
syncdb ifSOUTH_TESTS_MIGRATEis set to False, if south is installed. This
prevents migrations from running when running unit tests. This speeds up test
setup significantly, but it means your test db may not be identical to
production, if you have faulty migrations.py.test automatically picks up any subclasses ofunittest.TestCase, provided
they are in a module namedtest_<something>.py. Thus, all your existing django
unittests should work seemlessly with py.test, although you may have to rename
your test files if they do not conform to this convention. You can also write
custom py.test test collection hooks to pick up test modules that are named in
a different directory structure.This project differs from <http://github.com/bfirsh/pytest_django> in that it
provides a django test runner that calls py.test, rather than creating a
py.test plugin to test django projects. I believe there is overlapping
functionality from the two projects, and also that they can be integrated into
a single project, but I have not looked at the feasibility of this yet.
Package: django_pythonic_menu
Django Pythonic Menu--This is a simple library to help with building and working with site menu in your way.It solves one issue: list available menu items and toggle some of them active.Then pass it to template. With menu levels if you wish. In readable way.Usage is following:```python# 1. Define the menuclass AppMenu(Menu):first_menu_item = MenuItem('first_route')another_menu_item = MenuItem('another_route', title="Some title", and_other_value_passed_to_template='Yea!')class SubMenu(Menu):subitem = MenuItem('subitem_route')class Meta:visibility = lambda request, item: request.user.is_authenticatedother_view_data = 'goes here'# 2. Then activate it:@AppMenu.first_menu_item.activatedef my_view(request):pass``````html# 3. Then render it in view as you like it:{% load pythonic_menu %}{% render_menu 'path.to.AppMenu' menu %}{% for item in menu.items %}<a href="{{ item.url }}" {% if item.active %}class="active"{% endif %}>{{ item.title }}{{ item.and_other_value_passed_to_template }}</a>{% endfor %}```Extra abilities:==* Submenus (just define another Menu inside Menu).* Visibility checking (provide `visibility=lambda request, item: request.user.is_staff` argument).* Ability to provide callbacks for urls (just pass `callback(request, item)`).* Ability to cache & validate routes (call `Menu.cache_routes()` in your `App.ready()` method.Goals==Main goals are:* This is static menu written in Python. So no models/DB.* Simple way to be mark active items. Just add decorator to your views. Also it's bound to menu definition so existence of items is checked on app start.* No restrictions on view: you have {url: , title: , active: ) from library. Everything other is yours: add icon=.., className=.. etc as you like.* Rendering menu is project-specific so it's your responsibility to make template for it.Feedback==If you have any ideas/questions post either issue or pull request.If you use it and found useful then write me a message or make a pull request to change alter this page.
Package: django-python-telegram-bot-adapter
django-python-telegram-bot-adapterInstall django-python-telegram-bot-adapterpip install django-python-telegram-bot-adapterAddbot_adapterto your INSTALLED_APPS settingINSTALLED_APPS=[...'bot_adapter.apps.BotConfig',]Include URLconf in your project urls.pypath('/',include('bot_adapter.urls')),Not you can create telegram botsbot=Bot(TOKEN)bot.register(...)BotConfig.registry.add_bot(TOKEN,bot)
Package: django-pyuwsgi
django-pyuwsgiRunpyuwsgi(aka uWSGI) as a Django management command.UsageInstall:pip install django-pyuwsgiAdd toINSTALLED_APPS:INSTALLED_APPS=[# ..."django_pyuwsgi",# ...]Run:manage.py pyuwsgi --socket=:8000 ...ConfigurationPyuwsgi already knows the Python interpreter and virtualenv (if applicable) to use from the Django management command environment. By default, it will run with the following flags (usingsettings.WSGI_APPLICATIONto determine the module):--strict --need-app --module={derived}If you haveSTATIC_URLdefined with a local URL, it will also add--static-map, derived fromSTATIC_URLandSTATIC_ROOT.You can pass any additional arguments uWSGI accepts in from the command line.But uWSGI has a lot of flags, and many of them, you want every time you run the project. For that scenario, you can configure your own defaults using the optional setting,PYUWSGI_ARGS. Here's an example you might find helpful:PYUWSGI_ARGS=["--master","--strict","--need-app","--module".":".join(WSGI_APPLICATION.rsplit(".",1)),"--no-orphans","--vacuum","--auto-procname","--enable-threads","--offload-threads=4","--thunder-lock","--static-map","=".join([STATIC_URL.rstrip("/"),STATIC_ROOT]),"--static-expires","/* 7776000",]Don't forget to also set something like--socket=:8000or--http=:8000so your app listens on a port. Depending on your setup, it may make more sense to pass this in via the command line than hard-coding it in your settings.MotivationIn some scenarios, it is beneficial to distribute a Django project with a single entrypoint for command-line interaction. This can come in handy when building Docker containers or self-contained Python apps with something likeshiv.
Package: django-py-zipkin
Django middleware and tracing utilities for submitting traces to Zipkin.
py2 / py3 compatible.UsageSet the settings, if not set it’ll use defaults:ZIPKIN_SERVICE_NAME:unknownThe name to use when identifying the service being traced.ZIPKIN_TRANSPORT_HANDLER:django_py_zipkin.transport.zipkin_transportTransport to use to submit traces to Zipkin. The default one submits
in the background via Celery.ZIPKIN_ADD_LOGGING_ANNOTATION:TrueWhether to add a ‘logging_end’ annotation when py_zipkin
finishes logging spansZIPKIN_TRACING_ENABLED:FalseWhether or not to enable tracing, requires explicit enabling.ZIPKIN_TRACING_SAMPLING:1.00The sampling thresholdZIPKIN_BLACKLISTED_PATHS:[]List of regular expressions to ignore from tracing.Add the middlewareMIDDLEWARE = [
    ...
    'django_py_zipkin.middleware.ZipkinMiddleware',
    ...
]Or instrument your code with the context manager:with trace('span-name', request.zipkin_tracer) as context
    traced_value = do_something_that_takes_time()
    context.update({
        'some.key': traced_value,
    })
Package: django-pzip-storage
django-pzip-storageA FileSystemStorage subclass for Django that encrypts/compresses withPZip.Installationpip install django-pzip-storageUsageThe simplest way to usePZipStorageis by setting yourDEFAULT_FILE_STORAGEtopzip_storage.PZipStorage. By default,PZipStoragewill use yourSECRET_KEYsetting as the encryption key.IMPORTANT: Encrypting withSECRET_KEYmeans youmustkeepSECRET_KEYa secret, and if you lose or reset it
without first rotating the keys of all stored files, they will be lost forever.PZipStoragemay be used with existing unencrypted files, as a drop-in replacement forFileSystemStorage. If it
determines the requested file is not a PZip file, it will delegate toFileSystemStorageafter emitting aneeds_encryptionsignal (see below).You may also usePZipStorageas a custom storage backend anywhere Django allows it; seeManaging Filesin the Django documentation for more information.SettingsPZIP_STORAGE_EXTENSION- the extension to append to any file saved withPZipStorage. Defaults to.pz.PZIP_STORAGE_NOCOMPRESS- a set of file extensions (with leading period) which should not be compressed when
saving. Defaults to:[".z", ".gz", ".zip", ".tgz", ".jpg", ".jpeg", ".png", ".gif", ".sit", ".sitx", ".7z", ".pz", ".bz2", ".xz"]PZIP_STORAGE_KEYS- an iterable (or callable returning an iterable) of keys to use. The first key on the list will
be used for encrypting files. Defaults toPZipStorage.default_keys, which yieldsSECRET_KEY.These settings may be overridden on a per-storage basis by instantiatingPZipStoragemanually withextensionornocompresskeyword arguments.SignalsPZipStorageemits a number of signals when opening files in various circumstances:pzip_storage.needs_rotation- sent when a file was decrypted using an old key, i.e. not the first key in the
provided list.pzip_storage.needs_encryption- sent when an unencrypted file was opened.pzip_storage.bad_keys- sent when an encrypted file was opened, but no keys in the list could decrypt it.You may listen for these signals to do things like gradual encryption, key rotation, or logging.
Package: django-qa
A Simple Q&A App using Python Djangodjango-qais a fork fromSimple-Q-A-App-using-Python-Djangoaimed to create a pluggable package than allows to implement a StackOverflow-like forum site for your Django web project.
The development of this package is kindly supported bySWAPPSand constantly developed by it’s colaborators. Feel free to use it, add some issues if you find bugs or think of a really cool feature, even clone it and generate a pull requests to incorporate those cool features made by yourself; If you have special requirements,drop us a few linesand perhaps we can help you out too.Please take in considerations than this application is still under active development and we cannot guarantee that nothing will break between versions. Most of the core features are already there, so we expect to release a beta version soon.FeaturesAssumes nothing about the rest of your application.Create questions and answers.Comment on questions and answers.Upvote/Downvote questions and answers.Users have a reputation and a profile.Support for tagging questions with django-taggit.Support for hit counts with django-hitcounts.Questions are categorized by latest, popular and most voted.About the functionalityThe package is integrated with the framework authentication process, right now the package defines an user profile linked to Django’s user model, this models was created to contain information related to the user’s activities inside the package functionalities.It has comments on questions and answers.It has no support for anonymous questions nor answers or comments.It has a basic implementation for score and reputation records.The package has no moderation options on none of the models, and has no REST support.Some considerationsFor better understanding and information, please take a look at thedocumentationand report bugs and issues in the issue panel if you find one.With this setup you will have a functional questions and answers section inside your project. Probably you will need to work on the default templates to integrate the look and feel of your site.If your project has an user profile already, you may want to merge it with the data provided by this app (questions, answers, comments, reputation, etc). That requires some extra work, but can be done without using ugly hacks.The template structure serves as a foundation for your project, but you can (and should) override the defaults to better suit your needs. For example we load bootstrap3 from a CDN, but if your application already has bootstrap in a package you can just extend from your main base template.
Package: django-qanda
Qanda is a simple FAQ app for the Django framework.Questions can be displayed publicly, to logged-in users, or to site staff only.Questions are organised by topic, and those topics are self-hiding depending on
the publication status of the questions inside.Qanda installs with fully styled templates so that you can start playing
straight away, and an example project is supplied.For more information please see the documentation athttp://django-qanda.readthedocs.org/en/latest/.RequirementsDjango 1.4.2 or greater;Python 2.7 or greater.Get ItYou canget Qandaby using pip or easy_install:$ pip install django-qanda
or
$ easy_install django-qandaIf you want to install it from source, grab the Mercurial repository from Bitbucket:$ hg clone https://bitbucket.org/mhurt/django-qanda
$ cd django-qanda
$ python setup.py installInstall ItAdd “qanda” to yourINSTALLED_APPSsetting like this:INSTALLED_APPS = {
  ...
  'qanda'
}Include the qanda URLconf in your project urls.py like this:url(r'^faq/', include('qanda.urls'))For Django 1.7 users, runpython manage.py migrateto create the qanda
models. Otherwise simply runpython manage.py syncdb.ContributeIssue Tracker:https://bitbucket.org/mhurt/django-qanda/issuesSource Code:https://bitbucket.org/mhurt/django-qanda/Documentation:http://django-qanda.readthedocs.org/en/latest/LicenseThe project is licensed under the MIT license.
Package: django-qc
Django query counter - simple query debuggingLets you easily catch and fix database query inefficiencies during development by decorating any function or method.The main potential drawback of seeing query data in your code is that commits can become cluttered. We therefore recommend pairing django-qc with apre-commit hook for removing the commentsbefore they are ever even committed.InstallationInstall using pip:pip install django-qcUsageSimply import the db_helper wrapper and passverbose=Trueif you want more details than in the default setting.fromdjango_qcimportdb_helper@db_helper(verbose=True)defmy_function():...SettingsThere's only one setting to configure, but it is required:DB_HELPER{'DEBUG':DEBUG}Decorator functions will not do anything if debug isFalse, and by design does not allow a debug value ofTrueif the general Django debug value isFalse, as this is intended as a development aid only.
Package: django-q-filter
Django Q Filtercomplex filtering based on Django QOverviewUse the power ofDjango Q Objectsto filter django models with complex queries.
Django Q Filter provides filter forms (based on bootstrap and jQuery) and utils for complex query filters.The filter form selects the possible django model fields dynamically and computes a Q-Query with the given input.the resulting queryset is automatically annotated with the field and values of the given Q-Query. results of a Q-Query are always a "joined" style list and to enhance the experience, a normalized result set can be computed, where the values can be merged.For demo purposes, an example project is provided.RequirementsPython (3.6, 3.7, 3.8, 3.9)Django (2.2, 3.0, 3.1)django-crispy-formsInstallationInstall usingpip...pip install django-q-filterAdd'qfilter'to yourINSTALLED_APPSsetting.INSTALLED_APPS=[...'qfilter',]Use Q-Filter mixin in django views. See example project.# example/food/views.pyclassRecipeListView(QQueryViewMixin,ListView):"""Recipe List View"""model=Recipetemplate_name='food/recipe_list.html'ordering=['name']
Package: django-qingstor-storage
Django Qingstor StorageA Django storage backend withQingstor.RequirementsPython3Django >= 2.0qingstor-sdk >= 2.2.6InstallationUsing venv is highly recommended.Install by PyPI:pipinstalldjango-qingstor-storageInstall by source code, just clone the code, and run following commands to install:cddjango_qingstor_storage
pythonsetup.pyinstallSettingsEdit your settings.py and set default(or other name) storage backend:# set storage backendDEFAULT_FILE_STORAGE='django_qingstor_storage.backends.QinstorStorage'And add Qingstor config in the settings.py:# Qingstor setting starts hereQINGSTOR_ACCESS_KEY_ID='YOUR_ACCESS_KEY_ID'QINGSTOR_SECRET_ACCESS_KEY='YOUR_SECRET_ACCESS_KEY'QINGSTOR_ZONE='YOUR_QINGSTOR_ZONE'QINGSTOR_BUCKET='YOUR_QINGSTOR_BUCKET'Also, you can set the Qingstor config by setting system environment variables with the following commands:exportQINGSTOR_ACCESS_KEY_ID=YOUR_ACCESS_KEY_IDexportQINGSTOR_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEYexportQINGSTOR_ZONE=YOUR_QINGSTOR_ZONEexportQINGSTOR_BUCKET=YOUR_QINGSTOR_BUCKETDemo siteWe also provide a demo site with Django admin. Just clone the code, edit settings.py in demo_site directory. And use the following commands to make it running:pythonmanage.pymigrate
pythonmanage.pycreatesuperuser
pythonmanage.pyrunserverOpen your browser to visithttp://localhost:8000.See AlsoQinstor Python SDK(on github):https://github.com/yunify/qingstor-sdk-pythonQinstor Python SDK docs:https://docs.qingcloud.com/qingstor/sdk/python/qingstor_sdk.htmlQinstor Restful API:https://docs.qingcloud.com/qingstor/api/Django Custom Storage HOW-TO:https://docs.djangoproject.com/en/2.1/howto/custom-file-storage/