Saravanan666/pypi-org huggingface dataset:
Package: django-anti-crawler
Djano-Anti-CrawlerA light weight anti crawler Django app which blocks the IP addresses which sends too many hits to your application.
You can decide the number of hits that are allowed per IP address in defined time.InstallationInstall viapippip install django-anti-crawlerQuick startAdddjango_anti_crawlerto your INSTALLED_APPS setting like this::INSTALLED_APPS = [
    ...
    'django_anti_crawler',
]Add'DjangoAntiCrawlerMiddleware'to your middleware classes insettings.pyfile::MIDDLEWARE = [
    'django_anti_crawler.middlewares.DjangoAntiCrawlerMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]DjangoAntiCrawlerMiddlewarecan be and should be first middleware as we need to make sure IP check is the very first
thing in processing request.If cache settings are not defined in your settings.py file, then you need to add below lines to your settings.py file::CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
        'LOCATION': 'cache_table',
    }
}Make sure you have database settings configured. Run the below command to create cache_table in database::python manage.py createcachetableYou may choose whatever cache backend you want to use.(optional) Set variables in MAX_ALLOWED_HITS_PER_IP and IP_HITS_TIMEOUT in settings.py file::MAX_ALLOWED_HITS_PER_IP = 2000  # max allowed hits per IP_TIMEOUT time from an IP. Default 2000.
IP_HITS_TIMEOUT = 60  # timeout in seconds for IP in cache. Default 60.(optional) Set variable ANTI_CRAWLER_WHITELIST_BOTS and IP_HITS_TIMEOUT in settings.py file to whitelist specific bots or Ips::To test on local system, set these values to very low, e.g. IP_HITS_TIMEOUT = 30 and MAX_ALLOWED_HITS_PER_IP = 2.
Restart the server and send requests frequently. After two requests you will start receiving 403 error.
If not defined in settings file, default values will be used.AuthorsMuhammad Haseeb-Initial work-Muhammad HaseebLicensingThe project isMIT Licenced.
Package: django_antimat
Django-antimatI. InstallRequirements:DjangoSouthPymorphy with installed MORPHY_DICT_PATH in settingsFor install:set MORPHY_DICT_PATH in setting to path of your dictsAdd to installed apps in settings django_antimat./manage migrate django_antimatinitialize antimat with:from django_antimat import AntimatAntimat.install(MODEL, 'FIELD')II. Get dicts for pymorphyhttps://bitbucket.org/kmike/pymorphy/downloads/III. Get mat list from internetAnd add this list in admin panel:each word on new lineIV. AuthorVadim aka ruscoderrusmiligamer@gmail.com
Package: django-antispam
Various anti-spam protection tools for django applications.See thedocumentationfor more details.InstallationThe package can be installed using:pip install django-antispamAdd the following settings:INSTALLED_APPS += (
    'antispam',

  # 'antispam.akismet',
  # 'antispam.honeypot',
  # 'antispam.captcha',
)

# Akismet protection configuration (optional)

AKISMET_API_KEY = '<akismet api-key>'

AKISMET_SITE_URL = '<base site url>'

AKISMET_TEST_MODE = False

# reCAPTCHA default configuration (optional)

RECAPTCHA_SITEKEY = 'sitekey'

RECAPTCHA_SECRETKEY = 'secretkey'

RECAPTCHA_WIDGET = 'antispam.captcha.widgets.ReCAPTCHA'

RECAPTCHA_TIMEOUT = 5

RECAPTCHA_PASS_ON_ERROR = FalseContributingIf you have any valuable contribution, suggestion or idea,
please let us know as well because we will look into it.Pull requests are welcome too.
Package: django-any
django-any the explicit replacement for old-style, big and error-prone
implicit fixture files.django-any allows to specify only fields important for test,
and fill rest by random with acceptable values.It makes tests clean and easy to undestood, without reading fixture files:from django_any import any_model, WithTestDataSeed

class TestMyShop(TestCase):
    __metaclass__ = WithTestDataSeed

    def test_order_updates_user_account(self):
        account = any_model(Account, amount=25, user__is_active=True)
        order = any_model(Order, user=account.user, amount=10)
        order.proceed()

        account = Account.objects.get(pk=account.pk)
        self.assertEquals(15, account.amount)The same approach available for forms also (django_any.any_form)See docs/quickstart.txt for more details
Package: django-anyfield-auth-backend
Use any field in the user table for identification (as principal), such as ‘first name’, ‘id’ or ‘email’.
It can be used in parallel or completely replace the standard django authentication backend
(django.contrib.auth.backends.ModelBackend)PyPI:https://pypi.org/project/django-anyfield-auth-backendRepository:https://gitlab.com/rristow/django_anyfield_auth_backendLicense: BSD 2-ClauseThis version is supported on Python 3.6+; and Django 2.2+.InstallationInstall the package with pip:$pipinstalldjango-anyfield-auth-backendTo use the auth backend in a Django project, add'django-anyfield-auth-backend'toAUTHENTICATION_BACKENDS. Do
not add anything toINSTALLED_APPS.AUTHENTICATION_BACKENDS+=['django-anyfield-auth-backend',]ConfigurationJust configure the fields to be searched in the settings:AUTH_ANYFIELDS (default [‘id’,’email’])All fields that will be used to look for the user.AUTH_ANYFIELDS_ONLY_UNIQUE_USERS (Default = True)Allow only uniquely identified users.Warning: false means that “all matched users” will be used to attempt authentication.
This option is NOT recommended because of security and performance gaps.TestsTo run the testspythonload_tests.py
Package: django-any-imagefield
django-any-imagefieldThis module offers a abstraction over the various image fields,
so allow third party applications can provide an imagefield at the project choice.Supported image fields:django-filebrowser-no-grappelli, which includes a preview and file selector.django-filer, which includes a preview and file selector.SORL-thumbnail, which includes a previewDjango’s defaultImageField, with a preview added to it.InstallationFirst install the module, preferably in a virtual environment. It can be installed from PyPI:pip install django-any-imagefieldConfigurationAdd the module to the installed apps:INSTALLED_APPS+=('any_imagefield',)UsageIn a Django model, the field can be included:fromdjango.dbimportmodelsfromany_imagefield.modelsimportAnyImageFieldclassArticle(models.Model):title=models.CharField("Title",max_length=200)image=AnyImageField("Image",upload_to='images')classMeta:verbose_name="Article"verbose_name_plural="Articles"def__unicode__(self):returnself.titleBy default, theAnyImageFielddisplays a standardImageFieldwith a preview thumbnail.
Whendjango-filebrowser-no-grappelliis installed, it will use theFileBrowseFieldfrom
that package to display the file/image browser. When your package has it’s ownImageFieldvariant/subclass,
please consider to add support for it in this package.ContributingThis module is designed to be generic. In case there is anything you didn’t like about it,
or think it’s not flexible enough, please let us know. We’d love to improve it!If you have any other valuable contribution, suggestion or idea,
please let us know as well because we will look into it.
Pull requests are welcome too. :-)
Package: django-any-js
DescriptionDjango-Any-JS helps you at including any combination of JavaScript/CSS
URLs in your site, with readable settings and template tags.UsageIn your settings:INSTALLED_APPS = [
    ...,
    "django_any_js",
    ...,
]
ANY_JS = {
    "DataTables": {
        "js_url": "/javascript/jquery-datatables/dataTables.bootstrap4.min.js",
        "css_url": "/javascript/jquery-datatables/css/dataTables.bootstrap4.min.css",
    }
}In your template:{% load any_js %}
{% include_js "DataTables" %}
{% include_css "DataTables" %}
Package: django-anylink
django-anylinkis a generic linking module for Django. Using this module, you
can create links for many usecases.Installation & DocumentationYou can find all documentation in the “docs/source” folder and online at
All documentation is in the “docs/source” directory and online atRead the Docs.Supported versionsThe latest release ofdjango-anylinkworks with Python 3.6+ and supports Django 1.11.Licensedjango-anylinkis licenced under the BSD License (see LICENSE).ResourcesDocumentationBug TrackerCodeChanges2.0.1 (2022-04-29)Add support for Django 3.2 and Python 3.92.0.0 (2020-10-30)Add support for Django 2.1 and 2.2Drop support for Python < 3.61.0.0 (2018-06-19)Add support for Django 2Drop support for Python < 2.7Drop support for Django < 1.110.4.2 (2016-11-24)Fix AddOrChangeWidget for Django 1.90.4.1 (2016-10-04)Fix translationImprove message formatting for multi link warningOrder link_type choices alphabetically to avoid redundant migrationsUpdate documentation0.4.0 (2016-05-11)Add support for django 1.9Use SVG if django-version is greater than 1.80.3.0 (2015-09-22)Add support for django 1.8 and python3.5drop support for django 1.50.2.0 (2015-03-30)Integrate Travis CI.Allow customization of admin form.Ensure the admin widget is not recognized as hidden input.AddANYLINK_ALLOW_MULTIPLE_USEsetting to enable reusability of AnyLink objects.We don’t check Python 3.3 anymore.Added Dutch and German translations.0.1.0 (2014-06-17)Initial release for the public.Contains the following features:Generic linking in DjangoSupport for TinyMCESupports Python 2.7, 3.3, 3.4, PyPy and Django 1.5+
Package: django-any-response-redirect-middleware
A subclass of Django’s RedirectFallbackMiddleware that will catch any response code, not just 404s.Installation:pip install django-any-response-redirect-middlewareSetup:MIDDLEWARE = [
    ...middleware classes,
    'any_response_redirect_middleware.AnyResponseCodeRedirectMiddleware',
]Run tests:./manage.py test any_response_redirect_middleware.tests
Package: django-anysign
django-anysigndjango-anysignis a Django application to manage online signature in a
generic way.Its goal is to provide a consistent API whatever the signature implementation,
so that you can either:switch from one signature backend to another;use several backends at once.SeeAlternatives & related projectsfor details about supported online
signature services.Project statusdjango-anysignis under active development. The project is not mature yet,
but authors already use it! It means that, while API and implementation may
change (improve!), authors do care of the changes.Also, help is welcome! Feel free to report issues, request features or
refactoring!ResourcesDocumentation:https://django-anysign.readthedocs.ioPyPI page:https://pypi.org/project/django-anysignBugtracker:https://github.com/peopledoc/django-anysign/issuesChangelog:https://django-anysign.readthedocs.io/en/latest/about/changelog.htmlCode repository:https://github.com/peopledoc/django-anysignContinuous integration:https://travis-ci.org/peopledoc/django-anysign
Package: django-any-urlfield
django-any-urlfieldTheany_urlfieldmodule provides an improved URL selector
that supports both URLs to internal models and external URLs.This addresses is a common challenge in CMS interfaces;
where providing aURLFieldmakes it hard to enter internal URLs,
while providing aModelChoiceFieldmakes it too inflexible.
This package provides the both of both worlds.For more details, see thedocumentationat Read The Docs.ScreenshotInstallationFirst install the module, preferably in a virtual environment:pip install django-any-urlfieldAdd the module to the installed apps:INSTALLED_APPS+=('any_urlfield',)UsageAdd the field to a Django model:fromdjango.dbimportmodelsfromany_urlfield.modelsimportAnyUrlFieldclassMyModel(models.Model):title=models.CharField("Title",max_length=200)url=AnyUrlField("URL")By default, theAnyUrlFieldonly supports linking to external pages.Register any model that theAnyUrlFieldshould support linking to:fromany_urlfield.modelsimportAnyUrlFieldAnyUrlField.register_model(Article)Now, theAnyUrlFieldoffers users a dropdown field to directly select an article.The default field is adjango.forms.models.ModelChoiceFieldfield
with adjango.forms.widgets.Selectwidget.
This can be customized using theform_fieldandwidgetparameters:fromany_urlfield.modelsimportAnyUrlFieldfromany_urlfield.formsimportSimpleRawIdWidgetAnyUrlField.register_model(Article,widget=SimpleRawIdWidget(Article))That will display theArticlemodel as raw input field with a browse button.ContributingThis module is designed to be generic. In case there is anything you didn’t like about it,
or think it’s not flexible enough, please let us know. We’d love to improve it!If you have any other valuable contribution, suggestion or idea,
please let us know as well because we will look into it.
Pull requests are welcome too. :-)
Package: django-api-admin
Expose django.contrib.admin as a restful service. useful for adding new features to django admin or writing a new admin.Features ⚡Expose all django.contrib.admin views as a restful api.Similar to django.contrib.admin.Customizable AdminSite and ModelAdmin.Supports InlineModelAdmins and bulk edits.Provides data to dynamically create forms on clients from serializers.Extensively testedDemo 🚀You can also test it in thisdemothat is hosted on replit. use these credentials to loginusername: adminpassword: passwordRequirements 📄Python 3.9+This package depends ondjango-rest-frameworkdjango.contrib.adminInstallation 📲Install django-api-admin package.$pipinstalldjango-api-adminIn your settings.py make sure you havedjango.contrib.adminandrest_frameworkin your installed apps. and adddjango_api_admin.INSTALLED_APPS=['django.contrib.admin','rest_framework','django_api_admin',]Example 💡1. create some models.models.pyfromdjango.dbimportmodelsclassAuthor(models.Model):name=models.CharField(max_length=100)def__str__(self):returnself.nameclassBook(models.Model):title=models.CharField(max_length=100)author=models.ForeignKey(Author,on_delete=models.CASCADE)def__str__(self):returnself.title2. register them using the admin site.admin.pyfromdjango_api_admin.sitesimportsitefrom.modelsimportAuthor,Booksite.register(Author)site.register(Book)3. include admin urls.urls.pyfromdjango_api_admin.sitesimportsiteurlpatterns=[path('api_admin/',site.urls),]4. run your development server.$pythonmanage.pyrunsevervisit yourlocalhostto see the browsable api.Screenshots 🖼
Package: django-apiblueprint-tests
This is a tool to automatically generate tests for a Django REST framework based
applications from [APIBlueprint](https://apiblueprint.org/) documents.It uses [plueprint](https://github.com/vmarkovtsev/plueprint) parser and
[Jinja2](http://jinja.pocoo.org) templates.Released under New BSD license.### Usage` python-mdjango-apiblueprint-testsapi_blueprint1.md api_blueprint2.md-otests.py python-mdjango-apiblueprint-tests--help`
Package: django-api-data-cache
API Data Cache is a simple mixin for Django REST framework to serve database
objects to clients using the api_data_cache service.It is composed of a mixing for list views that processes the request parameters from api_data_cache
clients for pagination and filtering.InstallationInstall the package using pip:pipinstalldjango_api_data_cacheAdd‘api_data_cache’to your Django project’sINSTALLED_APPSlist in thesettings.pyfile:INSTALLED_APPS=[# ...'rest_framework','api_data_cache',# ...]UsageImport theAPIDataCacheListViewMixininto your view module:fromapi_data_cache.mixinsimportAPIDataCacheListViewMixinInherit theAPIDataCacheListViewMixinin your view class:fromapi_data_cache.mixinsimportAPIDataCacheListViewMixinfromrest_frameworkimportviewsetsfrom.modelsimportYourModelfrom.serializerimportYourPartialSerializerclassYourListView(APIDataCacheListViewMixin,viewsets.GenericViewSet):queryset=YourModel.objects.all()serializer_class=YourPartialSerializersearch_fields=['field1','field2']
Package: django-api-decorator
Django API DecoratorA collection of tools to build function based Django APIs.WarningThis project is still in early development. Expect breaking changes.InstallationDjango API Decorator can be installed fromPyPI:pip install django-api-decoratorUsageThe main interface of this library is the@apidecorator. This handles input
and output from your view, according to type annotations on the view. Pydantic
is used to handle most of the encoding and decoding, but you are not limited to
use pydantic models for your types. You can use any type supported by pydantic,
from simple types to dataclasses and typed dicts.Here's a simple example:@api(method="GET")deflist_some_numbers(request:HttpRequest)->list[int]:return[1,2,3,4]Under the hood the@apidecorator will encode the list of numbers ot JSON and
wrap it up in a response object for Django to handle like any other response.You can also specify query parameters, that will be decoded according to the
specified type annotations:@api(method="GET",query_params=["count"])deflist_some_numbers(request:HttpRequest,count:int)->list[int]:return[random.randint(0,10)for_inrange(count)]Here the decorator will extract thecountquery paramter from the request and
make sure it's a valid integer.The decorator can also decode the request body for you:@api(method="POST")defsum_of_numbers(request:HttpRequest,body:list[int])->int:returnsum(body)The views produced by the decorator are plain Django views and should be added
in your urls module just like any other view:urlpatterns=[path("/api/numbers/",list_some_numbers,name="list-some-numbers"),]If you want to handle multiple methods on the same url amethod_routerhelper
function is provided, which can be used like this:urlpatterns=[path("/api/numbers/",method_router(GET=list_some_numbers,POST=...),name="list-some-numbers",),]OpenAPI specificationThis library can also generate an OpenAPI specification from your views. This
is done by inspecting the urlpatterns of the Django project, finding all views
using the@apidecorator. The schema for the specification is generated using
pydantic, so for details about how different types are treated seePydantic's
documentation.The specification is generated using thegenerate_api_schemasmanagement
command.
Package: django_api_doc
# django-api-docAPI docs for django## InstallationInstall using `pip````pip install django_api_doc```or```git clone git@github.com:fanhan/django-api-doc.gitcd django-api-doc/python setup.py install```## ExampleAdd `django_api_doc` to your INSTALLED_APPS setting.```INSTALLED_APPS = (...'django_api_doc',)```Now edit the your_project/urls.py module in your project:```urlpatterns = [...url(r'^api-docs/', include('django_api_doc.urls', namespace='api_docs')),]```In your project `urls.py`, you need set `name` or `namespace````urlpatterns = [...url(r'^common/', include('apps.test.urls', namespace='test')),]```In `your_apps/urls.py`, you can set urlpatterns like this...```urlpatterns = [...url(r'^$', views.TestIndex.as_view(), name='test_index'),]```In `view.py`, please use the `markdown` to write comments```pythonclass TestIndexView(View):"""test"""def get(self, request):"""test index#### Paramparams | category | must | description---- | ---- | ---- | ----null | null | null | null#### Return{"text": "test",}"""pass```then, open the url `http://127.0.0.1:8000/api-docs/`, you can see like this![api_doc_image](https://raw.githubusercontent.com/fanhan/django-api-doc/master/test/api_doc_test.png)## Add some parameters```API_DOC_IGNORE_NAMESPACES = []          # ignore your_project/urls.py namespacesAPI_DOC_TITLE = ''                      # doc html titleAPI_DOC_API_DOMAIN = 'http://api.com'   # api domainAPI_DOC_SKIN = 'skin-blue'              # skin-blue skin-black skin-purple skin-yellow skin-red skin-green```
Package: django-api-docs
#OverviewThis application is based upon interactive API Docs from the Mashery.  Interactive docs allow your API consumers to see exactly
how your APIs are called and what results they should expect.  Take a look at api.stegelman.com for an example of how
this app is implemented.## Read Some Docshttp://readthedocs.org/docs/django-api-docs/en/latest/## Pippip install django-api-docs
Package: django-api-generator
Django API GeneratorSimple tool thatGenerates Secure APIson top ofDRFwith minimum effort - actively supported byAppSeed.Django Dynamic Services-sample project that uses the libraryDjango - Build Services without Coding-video presentationFeaturesAPI engineprovided byDRFSecured byJWT Tokens(mutating requests)Minimal Configuration(single line in config for each model)Handles any modeldefined across the projectCRUDaccess logic:READis public (all items, get item by ID)Mutating requestsare protected byJWT TokensHow to use itStep #1-Install the package$pipinstalldjango-api-generator
//OR
$pipinstallgit+https://github.com/app-generator/django-api-generator.gitStep #2-Update Configuration, include the new APPsINSTALLED_APPS=['django_api_gen',# Django API GENERATOR  # <-- NEW'rest_framework',# Include DRF           # <-- NEW'rest_framework.authtoken',# Include DRF Auth      # <-- NEW]Step #3-Register the modelincore/settings.py(API_GENERATOR section)This sample code assumes thatapp1exists and modelBookis defined and migrated.API_GENERATOR={# pattern:# API_SLUG -> Import_PATH'books':"app1.models.Book",}REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':['rest_framework.authentication.SessionAuthentication','rest_framework.authentication.TokenAuthentication',],}Step #4-Migrate DBand create the tables used byDRF$pythonmanage.pymakemigrations
$pythonmanage.pymigrateStep #5-Generate API$pythonmanage.pygenerate-api
//OR$pythonmanage.pygenerate-api-f# supress confirmation (forcing mode)The code is generated under theapifolder in the ROOT of the project. At each iteration theAPI code is overwritten.Step #6-Update routing, include APIsfromdjango.contribimportadminfromdjango.urlsimportpath,include# <-- UPD: 'include` directivefromrest_framework.authtoken.viewsimportobtain_auth_token# <-- NEWurlpatterns=[path("admin/",admin.site.urls),path("api/",include("api.urls")),# <-- NEWpath('login/jwt/',view=obtain_auth_token),# <-- NEW]Step #7-Use APIIf the managed model isBooks, the API interface is/api/books/and all CRUD methods are available.Note: for mutating requests, theJWT Tokenis provided byhttp://localhost:8000/login/jwt/route (the user should exist).Links & resourcesDRF- HOMEpageMoreDeveloper Toolsprovided byAppSeedAsk forSupportviaEmail&DiscordDjango API Generator- Open-source library provided byAppSeed
Package: django-apihangar
== Installation ==To install into an existing Django project:Add “apihangar” to your INSTALLED_APPSinclude() “apihangar.urls” somewhere in your URLconfDefine APIHANGAR_DATABASES in your settings.pyAPIHANGAR_DATABASES specifies which database connections may be used
by the apihangar to issue queries against.  The setting should be
a list of 2-tuples (alias, label) where the aliases refer to database
connection aliases defined in your project’s DATABASES setting.IT IS NOT RECOMMENDED THAT YOU ADD “default” TO YOUR APIHANGAR_DATABASES.
The recommended way to use apihangar is to set up one or more read-only
database connections; add these as secondary databases in your DATABASES
dict; and then use these read-only connections for your APIHANGAR_DATABASES.