Saravanan666/pypi-org huggingface dataset:
Package: django-basic-stats
django-basic-stats is a simple traffic statistics application. It show latest referrer, google queried terms or overall hits count.It also provides optional logging and statistics for mobile devices (user agent, screen and window width/height, device pixel ratio).InstallationRunpip install django-basic-statsAdd ‘stats’, to INSTALLED_APPSAdd ‘stats.middleware.StatsMiddleware’ to MIDDLEWARE_CLASSESAdd url(r’^stats/’, include(‘stats.urls’)) to your urlpatterns in urls.pyRun “python manage.py migrate” to sync the databaseEnabling mobile device loggingMobile devices are logged via JavaScript code sending AJAX requests if browser USER AGENT matches one of mobile devices.Assuming you have jQuery available you will have to add such JavaScript code to you site:var ismobile = (/iphone|ipod|android|blackberry|mini|palm|smartphone|ipad|xoom|playbook|tablet|mobile|kindle/i.test(navigator.userAgent.toLowerCase()));
if (ismobile) {
    $(document).ready(function(){
        $.ajax({
        url: '/stats/mobile/',
        cache: false,
        type: "GET",
        data: {"window_width": window.innerWidth,
        "window_height": window.innerHeight,
        "screen_width": screen.width,
        "screen_height": screen.height,
        "device_pixel_ratio": window.devicePixelRatio},
        });
    });
}If you are using other JavaScript library you will have to redo the AJAX sending part. Note that /stats/mobile/ is a hardcoded URL.UsageStatistics are visible for site staff. Login to you site as such user and go to /stats/In Django admin panel you will also get “Mobile” model with all logged mobile devices.
Package: django-basin3d
django-basin3dDjango web framework for Broker for Assimilation, Synthesis and Integration of eNvironmental Diverse, Distributed DatasetsUsing django-basin3dKnowledge of Django is required to use django-basin3d.SeeDjango documentationfor details on creating a Django app.InstallTo utilize django-basin3d in a custom app, install the source distribution with pip:$ pip install django-basin3dExample useSeedjango-basin3d Example documentationfor an example of configuring an application to access USGS Daily and Instantaneous Values.Change LogSee thechangelogfor a history of updates and changes to django-basin3d.AuthorsCharuleka Varadharajan-LBLValerie Hendrix-LBLDanielle Svehla Christianson-LBLCopyrightBroker for Assimilation, Synthesis and Integration of eNvironmental Diverse, Distributed Datasets (BASIN-3D) Copyright (c) 2019, The
Regents of the University of California, through Lawrence Berkeley National
Laboratory (subject to receipt of any required approvals from the U.S.
Dept. of Energy).  All rights reserved.If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Intellectual Property Office atIPO@lbl.gov.NOTICE.  This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights.  As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit other to do
so.LicenseSeeLICENSEfile for licensing detailsAcknowledgmentsThis research is supported as part of the Watershed Function Scientific Focus Area funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research under Award no. DE-AC02-05CH11231. This research used resources of the National Energy Research Scientific Computing Center (NERSC), U.S. Department of Energy Office of Science User Facility operated under Contract No. DE-AC02-05CH11231.
Package: django-basket
InstallationAddbaskettoINSTALLED_APPSAddbasket.middleware.BasketMiddlewaretoMIDDLEWARE_CLASSESAdd basket tourlpatternsin yoururls.py:urlpatterns += patterns('', (r'^basket/', include('basket.urls')))Sync your database:./manage.py syncdbCollect static files:./manage.py collectstaticUsageLoad basket tags:{% load basket_tags %}Add panel with summary information to template (probably, you want
to include this panel in every page):{% include 'basket/panel.html' %}In order to basket javascript works, you have to add jQuery and basket.js
to all pages with order buttons:<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}basket/js/basket.js"></script>Finally, at the item page{% add_basket_button object 'button_text' 'added_text' 'already_in_text' 'template_name' %}Whereobjectis avaiable to order,'button_text'is the text printed on the add button,'added_text'is the text that appears near the add button,
and'already_in_text'is the text placed above the add button when page loaded.
Unrequired'template_name'is the path to rendered template.Available settingsPRICE_ATTRDefault:priceAll objects in basket should have this attribute for price calculations.
Otherwise price will be 0.0BASKET_FORMDefault:basket.forms.DefaultOrderFormThis form class used for order confirmation. By default it has required fields:
customer name, customer phone, delivery address, convenient time to call
and optional textarea for comment.
All information stored in order comment in admin interface.BASKET_OPTIONS_USE_KEEPDefault: TrueIf set to True, user will see checkboxes near all items at basket page.
If checkbox is unchecked, item will be deleted from basket.BASKET_OPTIONS_USE_DELETEDefault: FalseIf set to True, user will see delete icons near all items at basket page.
When user click on icon, item will be deleted from basket by AJAX request
and basket page will be automatically updated.ORDER_STATUSESDefault:basket.settings.DEFAULT_ORDER_STATUSESAn iterable (e.g., a list or tuple) of 2-tuples to use as choices for Order’s status field.ORDER_EMAIL_SUBJECTDefault:‘New order from site’Subject for message emailed to managers after an order confirmed.
Package: django-batchform
django-batchformThis project aims to provide a simple yet powerful way to fill
a batch of forms from a single uploaded file (CSV, xlsx, …).It uses Django class-based generic views to that effect, allowing for a very simple configuration:fromdjangoimportformsfrombatchformimportviewsclassLineForm(forms.Form):col1=forms.CharField(max_length=10)col2=forms.CharField(max_length=10)col3=forms.CharField(max_length=10)classBatchFormView(views.BaseUploadView):lines_form_class=LineFormcolumns=('col1','col2','col3')DemoIn order to have a look at the application, simply clone the repository,
ensure you have Django in your repository, and run:./manage.py runserverLinksPackage on PyPI:http://pypi.python.org/pypi/django-batchform/Source code on Github:https://github.com/rbarrois/django-batchform/Doc on ReadTheDocs: (TODO)Continuous integration on Travis-CI (TODO)
Package: django-batch-session-cleanup
This is a Django management command (as inhttps://docs.djangoproject.com/en/dev/howto/custom-management-commands/)
that cleans up expired sessions from the database.Why?Django ships with a built-in command to handle session cleanup, but it
is problematic when dealing with large session tables. Due to its
design, it can block writes to the session table for minutes at a time,
potentially disrupting sites that rely on sessions. This command is
designed to perform the same maintenance tasks as the built-in command
without disrupting a site by locking the table for a really long time.InstallationInstall the distribution from PyPI, e.g.pip installdjango-batch-session-cleanup.Then, addbatch_sesion_cleanupto INSTALLED_APPS in your Django project.That’s it. You can now run django-admin.py and confirm that the command
shows up.Example UsesDelete expired sessions in batches of no more than 50000, and sleep for
2 seconds in between batches::django-admin.py batch-session-cleanup --batch-size=50000 --sleep-time=2Known Issues and BugsThe tool has only been tested thoroughly on a MyISAM MySQL table. I’m not aware of any reason that it wouldn’t work on other SQL session backends, but you should be careful if you’re using it in those environments.AuthorKevan Carstensen <kevan@isnotajoke.com>
Package: django_batch_uploader
# django-batch-uploaderDjango batch uploading#Features1. Users can batch upload files / bulk upload files / uploadmultiple files at one -- however you prefer to phrase it!2. Users can specify default values to apply in bulk. For example, ifyou're a photographer uploading multiple images from a single shoot, you maywant to be able to tag all the images to a single shoot.3. Users can individually edit specific fields. For example, ifyou're a photographer uploading multiple images from a single shoot,you may want to add titles when you first upload them so you don'thave to go back and update them individually.#Compatibility / Requirements1. Django (last tested with 1.8.2)2. django-grappelli (last tested with 2.6.5)3. Chrome, Firefox, Safari, IE10+ (Essentially this list: http://caniuse.com/#feat=input-file-multiple)#Installationpip install django-batch-uploader##settings.pyINSTALLED_APPS = (...'django_batch_uploader',...)##views.pyfrom django_batch_uploader.views import AdminBatchUploadViewclass ImageBatchView(AdminBatchUploadView):model = Image#Media file namemedia_file_name = 'image'#Which fields can be applied in bulk?default_fields = ['credit', 'admin_description', 'creator', 'tags']#Which fields can be applied individually?detail_fields = ['title', 'alt', 'caption']default_values = {}##urls.py....url( r'admin/media/images/batch/$', ImageBatchView.as_view(), name="admin_image_batch_view"),....##admin.pyfrom django_batch_uploader.admin import BaseBatchUploadAdminclass BaseImageAdmin(BaseBatchUploadAdmin):batch_url_name = "admin_image_batch_view"#Screenshots##Bulk upload button in changelist![Changelist View](https://raw.github.com/ninapavlich/django-batch-uploader/master/docs/screenshots/changelist_view.png)##Select files and specify individual values![Individual Fields](https://raw.github.com/ninapavlich/django-batch-uploader/master/docs/screenshots/specify_individual_fields.png)##Specify defaults to bulk-apply![Defaults Form](https://raw.github.com/ninapavlich/django-batch-uploader/master/docs/screenshots/specify_bulk_defaults.png)##Upload in progress![Progress](https://raw.github.com/ninapavlich/django-batch-uploader/master/docs/screenshots/see_progress.png)##Upload successful![Progress](https://raw.github.com/ninapavlich/django-batch-uploader/master/docs/screenshots/results.png)
Package: django-batteries
Django-batteriesThis package contains useful utilities for django/drf projectModelsContains set of abstract models to enforce DRY principle for most common use casesdjango_batteries.models.TimeStampedModelcreatedmodifieddjango_batteries.models.TimeFramedModelstartendFor time bound entitiesdjango_batteries.models.DescriptionModeldescriptiondjango_batteries.models.TitleModeltitledjango_batteries.models.TitleDescriptionModeltitledescriptionFieldsMonitor fieldA DateTimeField that monitors another field on the same model and sets itself to the current date/time whenever the monitored field
changes.
use it like this in your models:
class MyMode(models.Model):title = models.Charfield(max_length=50)
title_changed = MonitorField(_('title changed'), monitor='title')Mixinsdjango_batteries.mixins.ListSerializerMixinAllow you to specifylist_serializer_classthat will be used only in list actionPaginatorsdjango_batteries.paginators.ResultSetPaginationPaginator withpage_sizeas query parameter for setting page sizedjango_batteries.paginators.SingleResultPaginatorCustom paginator class that returns not paginated(detail result) if qs result have only 1 itemUtilsdjango_batteries.utils.qs_admin_or_authorReturn all objects if user is staff, otherwise return objects owned by user
Package: django-bay-polls
==============@@@ Polls @@@==============Polls is a simple Django app to conduct Web-based polls. For eachquestion, visitors can choose between a fixed number of answers tovote on.Detailed documentation is in the "docs" directory.Quick start-----------1. Add "polls" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'polls',]2. Include the polls URLconf in your project's urls.py like this::path('polls/', include('polls.urls')),remember to put the comma(,) at the end3. Run `python manage.py migrate` to create the polls models.4. Start the development server and visit http://127.0.0.1:8000/admin/to create a poll (you'll need the Admin app enabled).5. Visit http://127.0.0.1:8000/polls/ to participate in the poll.
Package: django-bazaar-of-wonders
Bazaar of WondersBazaar of Wonders is a Django-based web application that aggregates card details, price, and purchase information for the trading card game, Magic: The Gathering.PyPi InfoPypi Name:django-bazaar-of-wondersPypi Link:https://pypi.org/project/django-bazaar-of-wonders/Github InfoRepo:https://github.com/Bazaar-Trader/Bazaar_Of_WondersHTTPS Clone Link:https://github.com/Bazaar-Trader/Bazaar_Of_Wonders.gitSSH Clone Link:git@github.com:Bazaar-Trader/Bazaar_Of_Wonders.gitWikihttps://github.com/Bazaar-Trader/Bazaar_Of_Wonders/wikiInstalling with pip$pip3installdjango-bazaar-of-wondersCommand to run the application$bazaar_startView on browser:http://localhost:8000Alternative installation instructionsAlternative installation instructions can be found athttps://github.com/Bazaar-Trader/Bazaar_Of_Wonders/wiki#installation-methodsTeamProject ManagerSCRUM MasterDev TeamDev TeamDev Teamgithub.com/ahillebragithub.com/kdewey13github.com/kerekovskikgithub.com/dorianmeadegithub.com/matthewrabe
Package: django-bcdrt
=====BriteCore Dynamic Risk Types=====This app was built in response to a test requirementQuick start-----------1. Add "main" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'bcdrt',]2. Include the main URLconf in your project urls.py like this::path('', include('bcdrt.urls')),3. Run `python manage.py migrate` to create the risk models.4. Start the development server and visit http://127.0.0.1:8000/admin/to create a risk (you'll need the Admin app enabled).5. Visit http://127.0.0.1:8000/ to subscribe to a risk type.5. Visit http://127.0.0.1:8000/risks/ to get a specific risktype in Json5. Visit http://127.0.0.1:8000/risks/<risktype> to get a specific risktype in Json
Package: django-bcmr
BCMR or Bitcoin Cash Metadata Registry is a Django app for storing, accessing and managing CashToken BCMR.Quick start (development)Add the following to your requirements.txt:Pillow==9.4.0
django-bcmr==x.x.xAdd “bcmr” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'bcmr',
]Include the bcmr URLconf in your project urls.py like this:from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    ...
    path('bcmr/', include('bcmr.urls')),
    ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)Add media and DRF (to restrict public access on root API auth token filter) config on settings.py:MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

REST_FRAMEWORK = {
    ...
    'DEFAULT_RENDERER_CLASSES': [
        'rest_framework.renderers.JSONRenderer'
    ]
}Start the development server and visithttp://localhost:8000/admin/to access the DB (you’ll need the Admin app enabled).Visithttp://localhost:8000/bcmr/to check API endpoints for the BCMR and tokens.Additional steps for deploymentAdd media and API location paths on nginx configuration file:location /media {
    proxy_pass http://127.0.0.1:<YOUR_DESIRED_MEDIA_PORT_HERE>;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $server_name;
}

location /bcmr {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_redirect off;
}Add<YOUR_DESIRED_MEDIA_PORT_HERE>to your yml file:ports:
  ...
  - "<YOUR_DESIRED_MEDIA_PORT_HERE>:<YOUR_DESIRED_MEDIA_PORT_HERE>"Run simple http server hosting for media files using supervisor. Add to supervisord.conf:[program:media_server]
command=python -m http.server <YOUR_DESIRED_MEDIA_PORT_HERE>
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stopasgroup=trueREST APICheck docs onhttp://localhost:8000/api/docs/Tokens created by a user can only be modified/deleted by that user (owner).All endpoints are restricted on its usage for prevention of users tampering other user’s tokens.
An auth token generated upon creation of either a token helps impose this restriction.
This token is used as a header for identification if the user modifying token data is the owner.
Header name isBcmr-Auth.The endpoints are restricted as follows:GET = no header required
POST = if header is supplied, created token/registry will belong to that auth token owner
     = if header is not supplied, a new auth token will be generated (new owner)
PUT/PATCH = header required
DELETE = header requiredMain BCMRFetch athttp://localhost:8000/bcmr/registries/main/Only the admin can add/remove tokens in the BCMR. After adding tokens, ask permission from the admin to include your token to the BCMR.
Package: django-bcp
# Barcode Printer for DjangoThis is a reusable Django application which generates PDF barcodes in various formats with a human and machine (OCR-A) readable textual label.These barcodes are rendered as a PDF with embedded JavaScript which prompts the PDF to be immediately printed.Currently this is used by [Adlibre DMS](http://www.adlibre.com.au/adlibre-dms/) for document barcode generation,
but this application is generic and can be reused in any Django app that requires barcode printing.[ReportLab](http://www.reportlab.com) is used for the barcode generation. And the following formats are supported:Code39 (3 of 9),Code128.However it would be trivial to add support for any format that ReportLab supports.## ExampleBarcode automatically printing from URL:![Barcode Printer for Django - Automatic Printing](https://github.com/adlibre/django-bcp/raw/master/docs/example.png)## InstallationIf you use pip then the dependencies and requirements will be taken care of:Prod:pip install git+git://github.com/adlibre/django-bcp.gitDev:pip install -egit+git@github.com:adlibre/django-bcp.git#egg=bcp## N.B. ReportLab BugReportLab 2.5/2.6 has a typo. “OpenActions” should be “OpenAction” as per ISO 32000-1:2008.<pre>
diff -r broken/lib/python2.7/site-packages/reportlab/pdfbase/pdfdoc.py fixed/lib/python2.7/site-packages/reportlab/pdfbase/pdfdoc.py
1022c1022
&lt;         Dests Outlines Pages Threads AcroForm Names OpenActions PageMode URI
—
&gt;         Dests Outlines Pages Threads AcroForm Names OpenAction PageMode URI
</pre>You will need to manually patch this, otherwise the barcode will not automatically print:sed -i -e ‘s@OpenActions@OpenAction@g’ lib/python*/site-packages/reportlab/pdfbase/pdfdoc.py
Package: django-bcrypt
You should be using bcrypt.django-bcrypt makes it easy to use bcrypt to hash passwords with Django.Installation and UsageInstall the package withpipandMercurialorgit:pip install -e hg+http://bitbucket.org/dwaiter/django-bcrypt#egg=django-bcrypt

# or ...

pip install -e git://github.com/dwaiter/django-bcrypt.git#egg=django-bcryptAdddjango_bcryptto yourINSTALLED_APPS.That’s it.Any new passwords set will be hashed with bcrypt.  Old passwords will still
work fine.ConfigurationYou can setBCRYPT_ROUNDSinsettings.pyto change the number of
rounds django-bcrypt uses.  The default is12.You can change the number of rounds without breaking already-hashed passwords.
New passwords will use the new number of rounds, and old ones will use the old
number.AcknowledgementsThis is pretty much a packaged-up version ofthis blog postfor easier
use.It also depends on thepy-bcryptlibrary.
Package: django-beam
django-beamdjango-beam provides you with a set of views, templates, and integrations for the most common CRUD applications. It aims to offer the functionality of Django's own admin but in a way that integrates seamlessly with your frontend code.FeaturesCRUD operations based on class-based viewsEasily extensibleExtensions for common use cases and popular third-party packagesDocumentationThe full documentation can be found athttps://django-beam.readthedocs.io/en/latest/.QuickstartTo get started, you'll need to follow these steps:Install django-beam:pipinstalldjango-beamAdd "beam" and "crispy_forms" to yourINSTALLED_APPSinsettings.py:INSTALLED_APPS=[# ..."beam","beam.themes.bootstrap4","crispy_forms",]Import and usebeamin your Django project, as shown in the example below:# books/models.pyfromdjango.dbimportmodelsclassBook(models.Model):title=models.CharField(max_length=255)author=models.ForeignKey("Author",on_delete=models.CASCADE,related_name="books")classAuthor(models.Model):title=models.CharField(max_length=255)# books/views.pyimportbeamclassBookViewSet(beam.ViewSet):model=Bookfields=['title','author']classAuthorViewSet(beam.ViewSet):model=Authorfields=['title']# urls.pyfromdjango.urlsimportpath,includeurlpatterns=[path('books/',include(BookViewSet().get_urls())),path('authors/',include(AuthorViewSet().get_urls())),# ...]For more examples and detailed explanations of various django-beam features, refer to thefull documentation.beam.contribThebeam.contribpackage provides integration with several third-party Django apps, such as:beam.contrib.auth: Viewsets for editing users and groups, and optional templates for default Django registration views.beam.contrib.autocomplete_light: Integration withdjango-autocomplete-light.beam.contrib.reversion: Experimental integration withdjango-reversion.Refer to the documentation for usage instructions on each of the contrib packages.TestingYou can use thetoxtesting tool to run the tests:tox-epy38-djangolatestRun the tests of a specific test file only:tox-epy38-djangolatest--test_tagsRun against all supported versions of Python and Django:toxSupportIf you encounter any issues or have questions, please refer to thedjango-beam documentationor raise an issue on theGitHub repository.
Package: django-beautifulpredicates
Library to provide a predicate dispatch for Django’s generic views.RequirementsPython 2.7 or later (not support 3.x)Django 1.4 or laterFeaturesUsing this, You can create views call method in considering of value returned by predicate.
For example folloing view calls method in considering of request parameter:class PonyView(PredicateProcessView):
    dispatch_config = (
                          ('get_corn_1', (RequestParamPredicate('corn=1'),)),
                          ('get_corn', (RequestParamPredicate('corn'),)),
                      )
    def get_corn(self, request, *args, **kwargs):
        return HttpResponse('pony with some corn')

    def get_corn_1(self, request, *args, **kwargs):
        return HttpResponse('pony with unicorn')

    def get_default(self, request, *args, **kwargs):
        return HttpResponse('pony')In this case, It used:beautifulpredicates.views.PredicateProcessViewbeautifulpredicates.predicates.RequestParamPredicateHistory0.0.1 (2012-01-13)first release
Package: django-beauty-view
# django-beauty-viewDjango collection mixin view## Requirements* Python (2.7.x )* Django (1.5+ )## InstallationInstall using `pip````shellpip install django-beauty-view```## Usage & Example```python# -*- coding: utf-8 -*-from django.views import generic...from beauty_view.auth import PermissionRequiredMixinclass Create(PermissionRequiredMixin, generic.CreateView):...permission_required = 'group.can_change'...```