Saravanan666/pypi-org huggingface dataset:
Package: django-ajax-toolkit
django-ajax-toolkitDependenciesmsgpack-python>=0.2.4django>=1.3CI status (Travis)InstallationGrab it from pypi with:pip install django-ajax-toolkitor:easy_install django-ajax-toolkitReturning data objects in viewsJsonResponseIf you want to extend your views to work with ajax you may choose to return json data in your response.
To make this easier you can useJsonResponsefound inajaxtoolkit.http:from ajaxtoolkit.http import JsonResponse

class MyView(TemplateView):

    def get(self, request, *args, **kwargs):
        if request.is_ajax:
            context = self.get_context_data()
            return JsonResponse(context)
        # ...This will set the correct mimetype (application/json) and serialise your context data into a json object.MsgpackResponseMsgpackResponseworks in a similar way toJsonResponse, but uses msgpack to provide with binary serialisation.
The usage is the same as withJsonResponse:def get(self, request, *args, **kwargs):
    if request.is_ajax:
        context = self.get_context_data()
        return MsgpackResponse(context)
    # ...Ajax MiddlewareIf you’re using Django’s messages framework, you can also addajaxtoolkit.middleware.AjaxMiddlewarein your
middleware.This will inject all messages generated in your request into yourJsonResponseobject:from django.contrib import messages
from ajaxtoolkit.http import JsonResponse

class MyView(TemplateView):

    def get(self, request, *args, **kwargs):
        if request.is_ajax:
            context = self.get_context_data()

            messages.info(request, "This is very useful")
            messages.warning(request, "Be careful!")

            return JsonResponse(context)
        # ...This would be rendered as the following:{
    //...
    'django_messages': [
        {"extra_tags": "info",
         "message": "This is very useful",
         "level": 20},
        {"extra_tags": "warning",
         "message": "Be careful!",
         "level": 30}
    ]
}Bypassing the message middlewareIf you want to send an http response without attaching messages you can do that
by setting themessage_supportattribute of the response object:context = self.get_context_data()

response = JsonResponse(context)
response.message_support = False

return responseYou can also choose to subclass the original response classes, eg.:class MsgpackResponseWithoutMessages(MsgpackResponse):
    message_support = False

# ...ContributeClone, create a virtualenv and run:make installThis will install all dependencies.  You can then run the tests with:./runtests.py
Package: django-ajax-upload-widget
Provides AJAX file upload functionality for FileFields and ImageFields with a simple widget replacement in the form.No change is required your model fields or app logic. This plugin acts transparently so your model forms can treat files as if they were uploaded by “traditional” browser file upload.FeaturesDrop-in replacement for Django’s built-inClearableFileInputwidget (no change required to your model).Works in all major browsers including IE 7+.Random hash string added to file names to ensure uploaded file paths are not guessable by others.UsageRefer to theexampleapp included in the package for a working example.Server SideIn your form, use theAjaxClearableFileInputon yourFileFieldorImageField.from django import forms
from ajax_upload.widgets import AjaxClearableFileInput

class MyForm(forms.Form):
    my_image_field = forms.ImageField(widget=AjaxClearableFileInput())Or, if using aModelFormyou can just override the widget.from django import forms
from ajax_upload.widgets import AjaxClearableFileInput

class MyForm(forms.ModelForm):
    class Meta:
        model = MyModel
        widgets = {
            'my_image_field': AjaxClearableFileInput
        }Client SideInclude the Javascript (and optionally CSS) files in your page and call theautoDiscoverfunction.
This will search the page for all the AJAX file input fields and apply the necessary Javascript.<link href="{{ STATIC_URL }}ajax_upload/css/ajax-upload-widget.css" rel="stylesheet" type="text/css"/>
<script src="{{ STATIC_URL }}ajax_upload/js/jquery.iframe-transport.js"></script>
<script src="{{ STATIC_URL }}ajax_upload/js/ajax-upload-widget.js"></script>

<script>
    $(function() {
        AjaxUploadWidget.autoDiscover();
    });
</script>You can also pass options toautoDiscover():<script>
    $(function() {
        AjaxUploadWidget.autoDiscover({
            changeButtonText: 'Click to change',
            onError: function(data) { alert('Error!'); }
            // see source for full list of options
        });
    });
</script>OR … you can explicitly instantiate an AjaxUploadWidget on an AJAX file input field:<input id="Foo" name="foo" type="file" data-upload-url="/ajax-upload/" data-filename="" data-required=""/>
<!-- The input field needs to be outputed by Django to contain the appropriate data attributes -->

<script>
    new AjaxUploadWidget($('#Foo'), {
        // options
    });
</script>DependenciesjQuery 1.7+jQuery Iframe Transport plugin (included in this package)App InstallationAddajax_uploadto yourINSTALLED_APPSsetting.1. Hook in the urls.# urls.py
urlpatterns += patterns('',
    (r'^ajax-upload/', include('ajax_upload.urls')),
)That’s it (don’t forget include the Javascript as mentioned above).Running the Tests./manage.py test ajax_uploadLicenseThis app is licensed under the BSD license. See the LICENSE file for details.
Package: django-ajaxview
Django Ajax ViewSimple Django library for quickly using Ajax calls in regular views.For example, suppose you have a regular TemplateView in Django, which you want to add Ajax interactivity to. Simply add an@ajaxmethod to your controller, and it becomes accessible in the HTML template side as a function:classMyController(AjaxView):...@ajaxdefgreetings(self,name):returnf'Why hello there,{name}!'Inside the rendered HTML:constmessage=awaitgreetings({name:'Ken'})Seedocumentation for details. Licensed under MIT.
Package: django-akamai
Dependencies:requests(required),django-celery(optional)django-akamai serves as a means to perform purge requests from Django apps
using the Akamai REST API. Purge requests are performed on demand or, optionally,
placed in a queue using Celery.ConfigurationThis library uses theedgegrid-pythonclient for authentication. If the~/.edgercconfig file contains aCCUsection those credentials will be used
automatically.To specify a different location for the edgerc file, you may use these Django
settings:AKAMAI_EDGERC_FILENAME
AKAMAI_EDGERC_CCU_SECTIONIf you prefer to keep the values in your Django settings you may specify them
directly:AKAMAI_CCU_CLIENT_SECRET
AKAMAI_CCU_HOST
AKAMAI_CCU_ACCESS_TOKEN
AKAMAI_CCU_CLIENT_TOKENFor simplicity and security use of the.edgercfile is recommended.Consult Akamai’s documentation for full information about the API:https://developer.akamai.com/api/purge/ccu/overview.htmlDirectly issuing purge requestsYou may importPurgeRequestfromdjango_akamai.purgeand provide it with
one or more URLs to invalidate or delete.Note that Akamai’s API specifies a byte limit on the number of requests and a
single purge call may require multiple HTTP requests to complete.TODO: discuss options for rate-limitingExample:>>> pr = PurgeRequest()
>>> pr.add("http://www.example.com/url-1.html")
>>> pr.add(u"http://www.example.com/url-2.html")
>>> for url_batch, response in pr.purge():
    print(resp.status_code, len(url_batch))
201 2
>>> print pr.urls
[]Using Django Signalsdjango_akamai.signalsdefines two signals to directly issue a purge request
or, when Celery is available, queue the request.When sending these signals from other apps, you can pass in a variety of things
as the sender for convenience. Sender can be a single URL string, a list of
URL strings, an individual Django object, or a QuerySet. If passing in an
object or QuerySet, thenget_absolute_url()must be defined on every object.Example of signalling to immediately perform the request:>>> from django_akamai.signals import purge_request, queue_purge_request
>>> obj = MyObject.objects.get(pk=3)
>>> obj.get_absolute_url()
u'http://www.example.com/blahblah.html'
>>> purge_request.send(obj)Or, to queue the request using Celery:>>> queue_purge_request.send(obj)Using TasksTo use the task directly, importPurgeRequestTaskfrom tasks.py thusly:>>> from akamai.tasks import PurgeRequestTask
>>> obj = MyObject.objects.get(pk=3)
>>> PurgeRequestTask.delay(obj)
Package: django-akismet-comments
Django moderator for checking django.contrib.comments spam against akismet service.INSTALL=======::$ pip install django-akismet-commentsUSAGE=====- First, you need to specify ``AKISMET_API_KEY`` in ``settings.py``- Add ``django_akismet_comments`` to ``INSTALLED_APPS`` in ``settings.py``- Register your models::from django.contrib.comments.moderation import moderatorfrom django_akismet_comments import AkismetModerator...# where News is your model you want to moderate for commentsmoderator.register(News, AkismetModerator)Settings========``AKISMET_API_KEY``The api key of Akismet of your url.DEVELOP=======::$ git clone https://github.com/iElectric/django-akismet-comments.git django-akismet-comments$ cd django-akismet-comments$ virtualenv .$ source bin/activate$ python setup.py develop$ easy_install django-akismet-comments[test]Changelog=========0.1 (2012-12-19)----------------- Initial release.[Domen Kožar]django_akismet_comments Copyright (c) 2012, Domen KožarAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.3. The name of the author may not be used to endorse or promote productsderived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: django-akkount
=======
AkkountAkkount is a Django app to handle users accounts.Detailed documentation is in the "docs" directory.Quick startAdd "polls" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'akkount',
]Include the polls URLconf in your project urls.py like this::path('account/', include('account.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you'll need the Admin app enabled).Visithttp://127.0.0.1:8000/account/to participate in the poll.
Package: django-alacarte
django-alacarteis a minimalist menu app for Django.Installation$pipinstalldjango-alacarteUsageAdd “alacarte” to yourINSTALLED_APPS:INSTALLED_APPS=(...,'alacarte',)In your rooturls.pyadd the following code:# ...importalacartealacarte.autodiscover()# Your url patternsNote: You don’t need this if you use Django >= 1.7, autodiscovery is
made automatically with AppConfig.Create a file calledmenu.pyinside the app of your choice and
register its corresponding menus:importalacarteclassBankTransactionsMenu(alacarte.Menu):label='Transactions'url_name='bank_transactions'classBankBalanceMenu(alacarte.Menu):label='Balance'url_name='bank_balance'classBankPremiumMenu(alacarte.Menu):label='Premium Offers'url_name='bank_premium_offers'defshown(self)user=self.context['user']returnuser.is_premium()classBankMenu(alacarte.Menu):group='main'label='Bank'submenus=(BankTransactionsMenu(),BankBalanceMenu(),BankPremiumMenu(),)defshown(self):user=self.context['user']returnuser.is_authenticated()alacarte.register(BankMenu)Then in your template:{%loadalacarte%}{# ... #}{# ... #}{%alacarte"main"%}{# ... #}{# ... #}SupportDjango >= 1.3Tested on Python 2.7 and 3.4django-alacarteis not related tohttps://pypi.python.org/pypi/alacarte
Package: django-albertson
Homepage:https://github.com/FocusLab/django-albertsonIntegration library for Django andAlbertson.UseDjangoSettingsMixindj_albertson.mixins.DjangoSettingsMixinThis mixin provides automatic loading of default settings for a CounterPool
from the django settings module.Below is an example use:from albertson import CounterPool
from dj_albertson.mixins import DjangoSettingsMixin

class MyCounter(DjangoSettingsMixin, CounterPool):
    '''
    That's it, your done!
    '''Once you’ve added this mixin to your counter pool classes, the following
settings will be used:ALBERTSON_AWS_ACCESS_KEYThe AWS access key id that will be used to access DynamoDB.  This is the
setting that will be used if bothAWS_ACCESS_KEY_IDandALBERTSON_AWS_ACCESS_KEYare provided.ALBERTSON_AWS_SECRET_KEYThe AWS secet key that will be used to access DynamoDB.  This is the
setting that will be used if bothAWS_SECRET_ACCESS_KEYandALBERTSON_AWS_SECRET_KEYare provided.AWS_ACCESS_KEY_IDA more generic form ofALBERTSON_AWS_ACCESS_KEYAWS_SECRET_ACCESS_KEYA more generic form ofALBERTSON_AWS_SECRET_KEYALBERTSON_DEFAULT_READ_UNITSThe default read throughput that will be set on newly created tables.default:3ALBERTSON_DEFAULT_WRITE_UNITSThe default write throughput that will be set on newly created tables.default:5ALBERTSON_AUTO_CREATE_TABLEA flag to control how Albertson should behave when it tries to use a
table that doesn’t exist.  If set toTrue, Albertson will create a new
table.  If set toFalse, Albertson will allow the underlying boto
exception to bubble up through the stack.default:True
Package: django-alert
[![Build Status](https://travis-ci.org/jiaaro/django-alert.png?branch=master)](https://travis-ci.org/jiaaro/django-alert)## Installation ##1. Install lib with pip:`pip install django-alert`**- OR -**Put the "alert" directory somewhere in your python path2. Add "alert" to your installed apps (in the settings.py file)3. Also add "django.contrib.sites" in installed apps in case it's not there.4. Run ./manage.py migrate## Making Alerts ##Create an "alerts.py" file and import it at the bottom of yourmodels.py file. This is where you will define your alert class. Everyalert is subclassed from "alert.utils.BaseAlert"Here is an example alert that is sent to users when they first sign up:from django.contrib.auth.models import Userfrom django.db.models.signals import post_savefrom alert.utils import BaseAlertclass WelcomeAlert(BaseAlert):title = 'Welcome new users'description = 'When a new user signs up, send them a welcome email'signal = post_savesender = Userdefault = Falsedef before(self, created, **kwargs):return createddef get_applicable_users(self, instance, **kwargs):return [instance]## Writing Alert Backends ##Alert includes an Email Backend by default. But you can write a backendfor *any* messaging medium!Alert Backends just need to subclass BaseAlertBackend and implement a`send()` method that accepts an alert instanceYou can copy and paste the following code to get started:from alert.utils import BaseAlertBackendclass MyAlertBackend(BaseAlertBackend):def send()## Signals ##When an alert is sent, a signal is fired (found in alert.signals). The"sender" keyword argument is the Alert you defined (WelcomeAlert inthis case).example:from alert.signals import alert_sentdef do_something_after_welcome_alert_is_sent(sender, alert, **kwargs):passalert_sent.connect(do_something_after_welcome_alert_is_sent,sender=WelcomeAlert)
Package: django-alert-winglet
A Django app to send any exception to a Discord channel.Quick startInstallationYou can installdjango-alert-wingletusingpip::pip install django-alert-wingletAdd “alert_winglet” to yourINSTALLED_APPSsetting in your Django project’s settings file:INSTALLED_APPS = [
    ...,
    "alert_winglet",
]DiscordSet theDISCORD_WEBHOOK_URLvariable in your Django settings. This is the URL of the Discord webhook you want to use for sending exceptions.Use theDiscordEmbedManagerclass to create a Discord Embed object.from alert_winglet.discord.manager import DiscordEmbedManager

# If the request is not provided, the `extra_detail` variable will be None
discord_manager = DiscordEmbedManager(
      exc,
  )
formatted_exc, extra_detail = discord_manager.format_exception()
data = discord_manager.prepare_embed_data(formatted_exc, extra_detail)3. Then use theDiscordDeliveryclass to send the exception to your Discord channel using the webhook.
This class can be used for other purposes as well, like sending messages or files… .from alert_winglet.discord.sender import DiscordDelivery

delivery = DiscordDelivery(
    embeds=[
        data,
    ]
)
delivery.send()Requirementsdjango >= 3.0discord.py >=2.2.3requests >=2.28.2LicenseThis project is licensed under the MIT License.Bug Reports and Feature RequestsPlease use theGitHub_issuetracker to report any bugs or submit feature requests.AuthorsMojtaba DaviEmail:Mojtabadavi14@gmail.com
Package: django-aliases
# django aliases
##### Brandon R. Stoner <monokrome@monokro.me># What is this?This is a small project that I made because I wanted a flexible method for aliasing extra URLs to different objects. It’s provides a more flexible method for making a URL direct django to display the page for any Model that has a get_absolute_url method.As an example, if you were to create a “Page” model that simply described a page on a website - you could link it to the URL model in django-aliases and you would end up with a version of django’s flatpages module that had added support for linking multiple URLs to a single item.
Package: django-aligo
Django-Aligo는 Django에서 알리고 SMS 서비스(https://smartsms.aligo.in)를 손쉽게 연동할 수 있도록 하는 app 입니다.설치Quick Start“aligo_sms”를 settings.py의 INSTALLED_APPS에 추가합니다:INSTALLED_APPS = [
    ...
    'aligo_sms'
]settings 파일에 아래 설정을 지정합니다::DJANGO_ALIGO_IDENTIFIER =aligo identiferDJANGO_ALIGO_KEY =aligo keyDJANGO_ALIGO_DEBUG = False  # 테스트 모드 여부. 기본값 True.DJANGO_ALIGO_SENDER = None # 기본 발신자 번호. 기본값 Nonepython manage.py migrate를 실행해 aligo_sms의 모델을 생성합니다.
Package: django-alipay
=======alipay=======alipay api for djangoQuick start-----------1. Add "alipay" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'alipay',)2. Include the alipay URLconf in your project urls.py like this::url(r'^alipay/ptn/', include('alipay.create_partner_trade_by_buyer.ptn.urls')),3. Run `python manage.py syncdb` to create the alipay 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/alipay/ to participate in the poll.
Package: django-alipay2
提供django下alipay直接支付接口Quick startInstall:pip install django_alipay2Add “alipay” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'alipay',
][Optional] Include the alipay URLconf in your project urls.py like this:url(r'^alipay/', include('alipay.urls')),Migrate:python manage.py migrateAdd config ‘ALIPAY’ to settings.py like this:# account below is for sandbox
ALIPAY = {
    'pid': '2088101122136241',
    'key': '760bdzec6y9goq7ctyx96ezkz78287de',
    'seller_email': 'overseas_kgtest@163.com',
    'gateway': 'https://openapi.alipaydev.com/gateway.do?',
    'server_url': 'http://localhost:8000'

    # RSA specified
    'rsa_public_raw_key': '',
    'sign_type': 'RSA',
}

# you may add an 'api_provider' to support multiple seller
ALIPAY = {
    'api_provider': 'some_package.sub_package.get_alipay_alipay'  # input:seller_email, output:AlipayAPI
}Create alipay redirect:import uuid
payment = AlipayPayment.objects.create(
    out_no=uuid.uuid4(),
    subject='充值',
    body='1年365元',
    amount_total=0.01,
    user=None, # 可以指定user
    seller_email='your_seller_email@domain.com',
    # reference_id='1' # 可选
)
return redirect('alipay_redirect', out_no=payment.out_no)
Package: django-aliyun-oss2
Django aliyun OSS2Django storage foraliyun OSSFeaturesDjango file storage for aliyun OSSDjango static file storage for aliyun OSSWorks in Python 3+Install$pipinstalldjango-aliyun-oss2Configurationsput the following config in yoursettings.pyfile:ACCESS_KEY_ID="<your access key id>"ACCESS_KEY_SECRET="<your access key secret>"# The URL of AliCloud OSS endpoint# Refer https://www.alibabacloud.com/help/zh/doc-detail/31837.htm for OSS Region & EndpointEND_POINT="<your access endpoint>"BUCKET_NAME="<your bucket name>"# if not exist in aliyun oss platform, it will created automaticallyALIYUN_OSS_CNAME=""# custom domain. optionalBUCKET_ACL_TYPE="private"# bucket access type. available value: private, public-read, public-read-writeALIYUN_OSS_HTTPS=False# optional config. determine use https or not. if not declare, this value will be False by default.# storage media fileDEFAULT_FILE_STORAGE='django_aliyun_oss2.backends.AliyunMediaStorage'# storage static fileSTATICFILES_STORAGE='django_aliyun_oss2.backends.AliyunStaticStorage'UsageAll of the static file storage settings are available for the staticfiles storage.# The default location for your static filesSTATIC_URL='/static/'Run following command to collect all sub-folderstaticof each app and upload to STATIC_URL:$pythonmanage.pycollectstaticLicenseMIT LICENSE
Package: django-aliyun-oss2-storage
# Django Aliyun OSS2 Storage### Django storage for [阿里云 OSS2](https://www.aliyun.com/product/oss/?spm=5176.383338.201.42.WB7sGd)## Installpip install django-aliyun-oss2-storage## ConfigurationsDjango Aliyun OSS2 Storage 需要以下几个配置才能正常工作。这些配置通过可以环境变量或 settings.py 来设置。环境变量的优先级要高于 settings.py 。BUCKET_NAME`是Bucket的名字，如果该bucket不存在，程序会自动创建。`BUCKET_ACL_TYPE`用于设置Bucket的权限，可以设置为`private,public-read`和 `public-read-write。`python ACCESS_KEY_ID = "40ZhE1HyuWdllpMh" ACCESS_KEY_SECRET = "KbxtlKSvKyuyuymTiQvrxhsYFMguXy" END_POINT ="oss-us-west-1.aliyuncs.com"BUCKET_NAME = "XXXX" BUCKET_ACL_TYPE = "private" # private,public-read,public-read-write`## Usage在 settings.py 里设置DEFAULT_FILE_STORAGE:`python # mediafile将自动上传 DEFAULT_FILE_STORAGE = 'aliyun_oss2_storage.backends.AliyunMediaStorage' # staticfile将自动上传 STATICFILES_STORAGE = 'aliyun_oss2_storage.backends.AliyunStaticStorage' `## License基于MIT许可证发布
Package: django-all-access
django-all-access is a reusable application for user registration and authentication
from OAuth 1.0 and OAuth 2.0 providers such as Twitter and Facebook.The goal of this project is to make it easy to create your own workflows for
authenticating with these remote APIs. django-all-access will provide the simple
views with sane defaults along with hooks to override the default behavior.You can find a basic demo application running athttp://django-all-access.mlavin.org/FeaturesSane and secure defaults for OAuth authenticationEasy customization through class-based viewsBuilt on the amazingrequestslibraryInstallationIt is easiest to install django-all-access from PyPi using pip:pip install django-all-accessdjango-all-access requires Python 2.7 or 3.3+ along with the following Python
packages:django>=1.8
pycrypto>=2.4
requests>=2.0
requests_oauthlib>=0.4.2
oauthlib>=0.6.2DocumentationAdditional documentation on using django-all-access is available onRead The Docs.Licensedjango-all-access is released under the BSD License. See theLICENSEfile for more details.ContributingIf you have questions about using django-all-access or want to follow updates about
the project you can join themailing listthrough Google Groups.If you think you’ve found a bug or are interested in contributing to this project
check outdjango-all-access on Github.