Saravanan666/pypi-org huggingface dataset:
Package: django-ajax-chat
=====Django Chat=====DjangoChat is a simple Django Chat appdemo---------http://www.sharan.co/chat/Quick start-----------download from github for updated version1. Add "djangoChat" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'djangoChat',)2. Include the polls URLconf in your project urls.py like this::url(r'^chat/', include('djangoChat.urls')),3. Run `python manage.py syncdb` to create the djangoChat models.4. Start the development server and visit http://127.0.0.1:8000/chat/----------------------------------------------------------------todo list---------------------------------------------------------------chat input format options - links images youtube embbed  etc-escape html-allow selected tags in input-admin stuff-----------see logs-private messages ???
Package: django-ajax-comments-xtd
# django-ajax-comments-xtdAn addon app to https://github.com/danirus/django-comments-xtd that makes comments submittable via ajax# Installation1. Install from PYPI:```pip install django-ajax-comments-xtd```2. Add the app and its dependencies to INSTALLED_APPS in settings.py:```INSTALLED_APPS = [...'django_ajax_comments_xtd','django_comments_xtd','django_comments',...]```3. Add COMMENTS_APP to your settings.py:```COMMENTS_APP = 'django_comments_xtd'```Make sure you follow the exact order of putting these apps together4. Add this to your url config:```urlpatterns = [...url(r'^comments/', include('tow.django_ajax_comments_xtd.urls')),...]```Note: You don't need to add urls config provided by django_comments and django_comments_xtd because our app includes them all.5. Run migrations to create necessary database tables:```python manage.py migrate```6. Add JS library link to your template:```<script src="{% static 'django_ajax_comments_xtd/js/ajax_comments.js' %}"></script>```7. In templates use these tags to display a list of comments and the comment form:```{% load comments comments_xtd %}...<div id="comments">{% render_xtdcomment_tree for object %}{% render_comment_form for object %}</div>```And now you should have ajax comments enabled.
Package: django-ajax-csrf
Requires jQuery javascript libraryInstallation$pipinstalldjango-ajax-csrfINSTALLED_APPS+=('django_ajax',)Usage:{% load csrf_tags %}
{% include_ajax_csrf_token %}AuthournnsnodnbLICENSECopyright (c) 2017 Yuya Oka Released under the MIT license (seeLICENSE)
Package: django-ajaxerrors
Simple Django middleware that makes it easy to view Django’s technical error page for failed AJAX requests by automagically opening them in a different browser window.The ProblemI reckon most if not all Django developers know about Django’s useful debug-mode unhandled error page. However, when an AJAX request reaches a faulty view, the error page will not be rendered in your browser but instead be received by your AJAX error handler (assuming you even had one), which is almost always not what you want. This forces you you to find some other way to reach your traceback information. For example, before I wrote this package, I used to regularly open Chrome’s developer tools, find the failed resource in the Resources tab, and then either read through the raw HTML (yuck) or copy and paste it to a file and double click it (tedious).Suggested SolutionSince the problem is really about ease of development, and since I (and I suspect many other Django developers) do most of my development work locally, I figured the solution can take advantage of the server being a full fledged desktop with a modern browser and a GUI. Enterajaxerrors.middleware.ShowAJAXErrors. This little middleware intercepts all unhandled view exceptions, pickles the technical error page and uses Python’s webbrowser module to direct a new browser tab at a special URL that will serve (and delete) the previously stored page.All this is only triggered ifDEBUGis true andrequest.is_ajax()is true, so pretty much everything you’re used to in your development flow should stay the same. Sweet.Installation InstructionsInstall like any other Python package witheasy_installorpip, or simply with:python setup.py installAddajaxerrors.middleware.ShowAJAXErrorsto your MIDDLEWARE_CLASSES setting.You can also find more info in the package’sreadmefile.Contributingdjango-ajaxerrors is licensed under the MIT license, see theLICENSEfile in this distribution if you’re really interested in reading all them small letters.I’d really like to see this as a feature in Django some day, but first we should see if other people are interested and maybe add more stuff to this really simple utility. Anyway, feel free fork away and send me pull requests. I’ll do my sane best to fix any bugs for as long as… well, at least until I lose interest.If you’d like to discuss something about django-ajaxerrors or if you are otherwise curious about me, please find me at yaniv at aknin dot name, visit django-ajaxerrors’GitHub pageor my smashingPython-centric tech blog.
Package: django-ajaxfeedback
# django-ajax-feedback
Django easy ajax feedback formInstallationInstall or adddjango-ajaxfeedbackto your Python path.Adddjango-ajaxfeedbackto yourINSTALLED_APPSsetting.Add aAJAX_FEEDBACK_RECIPIENT_LISTsetting to the project’ssettings.pyfile.AJAX_FEEDBACK_RECIPIENT_LIST = (‘user@example.com’)
Package: django-ajaxify
A few little helpers.Instead of this:def view(request):
    context_dict = {'items': MyModel.objects.all()}
    return render(request, "template.html", context_dict)Use this:from ajaxify import render_ajax

def view(request):
    context_dict = {'items': MyModel.objects.all()}
    return render_ajax(request, "template.html", template_fragment.html", context_dict)Now if your view is responding to AJAX requests it will respond with only the
generated fragment.
Package: django-ajaximage
django-ajaximage===============Ajax image uploads.-------------------------------------[![PyPi Version](https://pypip.in/v/django-ajaximage/badge.png)](https://crate.io/packages/django-ajaximage)[![PyPi Downloads](https://pypip.in/d/django-ajaximage/badge.png)](https://crate.io/packages/django-ajaximage)Upload images via ajax. Images are optionally resized.![screenshot](https://raw.githubusercontent.com/bradleyg/django-ajaximage/master/screenshot.png)## SupportPython 2/3Chrome / Safari / Firefox / IE10+For older browser support use version 0.1.18.## InstallationInstall with Pip:```pip install django-ajaximage```## Django Setup### settings.py```pythonINSTALLED_APPS = [...'ajaximage',...]# SettingsAJAXIMAGE_AUTH_TEST = lambda u: True```### urls.py```pythonurlpatterns = patterns('',url(r'^ajaximage/', include('ajaximage.urls')),)```Run ```python manage.py collectstatic``` if required.## Use in Django admin only### models.py```pythonfrom django.db import modelsfrom ajaximage.fields import AjaxImageFieldclass Example(models.Model):thumbnail = AjaxImageField(upload_to='thumbnails',max_height=200, #optionalmax_width=200, # optionalcrop=True) # optional# if crop is provided both max_height and max_width are required```## Use the widget in a custom form### forms.py```pythonfrom django import formsfrom ajaximage.widgets import AjaxImageWidgetclass AjaxImageUploadForm(forms.Form):images = forms.URLField(widget=AjaxImageWidget(upload_to='form-uploads'))```### views.py```pythonfrom django.views.generic import FormViewfrom .forms import AjaxImageUploadFormclass MyView(FormView):template_name = 'form.html'form_class = AjaxImageUploadForm```### templates/form.html```html<html><head><meta charset="utf-8"><title>ajaximage</title>{{ form.media }}</head><body>{{ form.as_p }}</body></html>```## ExamplesExamples of both approaches can be found in the examples folder. To run them:```shell$ git clone git@github.com:bradleyg/django-ajaximage.git$ cd django-ajaximage$ python setup.py install$ cd example$ python manage.py syncdb$ python manage.py runserver 0.0.0.0:5000```Visit ```http://localhost:5000/admin``` to view the admin widget and ```http://localhost:5000/form``` to view the custom form widget.
Package: django-ajax-image-upload
Upload images via ajax.DocumentationThe full documentation is athttps://django-ajax-image-upload.readthedocs.io.QuickstartInstall Django Ajax Image Upload:pip install django-ajax-image-uploadAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'ajaximage',...)Add Django Ajax Image Upload’s URL patterns:fromajaximageimporturlsasajaximage_urlsurlpatterns=[...url(r'^',include(ajaximage_urls)),...]Define your Image model:
.. code-block:: pythonfrom ajaximage.models import AbstractImageclass MyImage(AbstractImage):# define additional fields hereclass Meta:…Define generic tabular inline
.. code-block::pythonfrom ajaximage.admin import ImageInlinefrom .models import MyImageclass MyImageInline(ImageInline):models = MyImageExample usage of AjaxImageUploadMixin:
.. code-block::pythonmodels.pyFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsHistory0.4.0 (2018-01-28)First release on PyPI.
Package: django-ajax-loading-overlay
jQuery Ajax Loading Overlay plugin package for Djangodjango-ajax-loading-overy uses Javascript to add/remove a loading overlay to a target element during Ajax calls. It can be called on any element that should receive the loading overlay, and accepts options for class selectors and loading overlay text.DependenciesjQuery library (http://jquery.com/)InstallationIn your Django project settings, add “ajax_loading_overlay” to your INSTALLED_APPS.UsageLinking the JS:<script src="{{ STATIC_URL }}ajax_loading_overlay/jquery.ajax-loading-overlay.js"></script>Calling the plugin:$('#target').loadingOverlay();Removing the loading overlay (usually upon success of the Ajax call):$('#target').loadingOverlay('remove');Options can be passed to override the default loading class (‘loading’), overlay class (‘overlay’), loading text(‘loading…’), and/or function to return loading text padding-top:$('#target').loadingOverlay({
    loadingClass: 'myLoadingClass',
    overlayClass: 'myOverlayClass',
    loadingText: 'Loading. Please Wait.',
    paddingTop: function (target) {
        return ((target.outerHeight() - parseInt(target.css('line-height'), 10)) / 2).toString() + 'px';
    }
});IfloadingClassoroverlayClassoptions are passed when initializing the loading overlay, the same options must be passed when removing that overlay:$('#target').loadingOverlay('remove', {
    loadingClass: 'myLoadingClass',
    overlayClass: 'myOverlayClass'
});CHANGES0.1.2 (2012.07.24)Added paddingTop option for overlay text.0.1.1 (2011.07.14)JS cleanup; added JSLint options.0.1.0 (2011.06.26)Initial release.TODO
Package: django-ajaxlte
ajaxlteAvailable features:class based viewsRewritable methods for class based views.adminlte 3.0Using adminlte template 3.0.TraslationTraslation Suport by Locales.RequirementsPython = 3Django >= 3.05django-crispy-forms >= 1.9.0Installationpip install django-ajaxltesettings.pyAdd 'ajaxlte' in your INSTALLED_APPS.INSTALLED_APPS=['ajaxlte',...,'django.contrib.humanize','mathfilters','crispy_forms',]CRISPY_TEMPLATE_PACK='bootstrap4'MIDDLEWARE=[...,'ajaxlte.middleware.JSONParsingMiddleware','ajaxlte.middleware.PutParsingMiddleware','ajaxlte.middleware.DeleteParsingMiddleware',]urls.pyPut ajax urls in 'urlpatterns':fromdjango.contribimportadminfromdjango.urlsimportpath,includeurlpatterns=[path('admin/',admin.site.urls),path('ajax/',include('ajaxlte.ajax_urls')),]How to useIn your models.py import BaseModel and use like parent.fromdjango.dbimportmodelsfromajaxlte.modelsimportBaseModelclassFoo(BaseModel):code=models.CharField(max_length=35,null=True,blank=True)name=models.CharField(max_length=165,null=True,blank=True)def__str__(self):returnself.codeclassBar(BaseModel):foo=models.ForeignKey(Foo,on_delete=models.CASCADE)code=models.CharField(max_length=35,null=True,blank=True)name=models.CharField(max_length=165,null=True,blank=True)def__str__(self):returnself.codeIn your views.pyfromajaxlte.genericsimportIndex,Datatables,AjaxSitefrom.modelsimport*fromdjango.shortcutsimportrender# this is a public website, maybe your root urldefwebsite(request):returnrender(request,'testapp/index.html')# general settingsAjaxSite.proyect_name="Amazing proyect"AjaxSite.name_space="testapp"AjaxSite.root_url="testapp/"AjaxSite.login_url="/admin/login/"AjaxSite.logo_url="/static/testapp/img/logo.png"AjaxSite.spinner="/static/testapp/img/spinner.gif"# the spinner is the gif loaded between ajax requests# creating de index pageclassTestIndex(Index):site=AjaxSite# creating the foo datatableclassFooDatatable(Datatables):site=AjaxSitemodel=Foolist_display=('code','name')search_fields=('code','name')# creating the foo datatableclassBars(Datatables):site=AjaxSitemodel=Barlist_display=('code','name','foo')search_fields=('code','name')# add index siteAjaxSite.set_index(TestIndex)# add menuAjaxSite.add_pill('test1')AjaxSite.add_pill('test2')# register classesAjaxSite.register(FooDatatable,'test1')AjaxSite.register(Bars,'test2')In your main urls.py include ajaxlte and your AjaxSite.fromdjango.contribimportadminfromdjango.urlsimportpath,includefromtestapp.viewsimportAjaxSite,websiteurlpatterns=[path('',website,name="website"),path(AjaxSite.root_url,include((AjaxSite.urlpatterns,AjaxSite.name_space),namespace=AjaxSite.name_space)),path('admin/',admin.site.urls),path('ajax/',include('ajaxlte.ajax_urls')),]
Package: django-ajax-redirection
# Ajax redirection middleware for Django[![Build Status](https://travis-ci.org/hysoftware/django-ajax-redirection.svg)](https://travis-ci.org/hysoftware/django-ajax-redirection)[![Code Health](https://landscape.io/github/hysoftware/django-ajax-redirection/master/landscape.svg?style=flat)](https://landscape.io/github/hysoftware/django-ajax-redirection/master)## What this?This is a collection of useful middlware for Django with Ajax.For example, [AngularJS](https://angularjs.org/) has URL routing subsystem,which uses AJAX. In addition, it supports history push state. This mean, whenyou access the website with ```https://example.com/#/login```, the addressbarshows ```https://example.com/login```. However, accessing```https://example.com/login```, you will get 404, because the HTTP requestis sent to ```https://example.com/login```, not ```https://example.com/#/login```.To avoid this problem, we should redirect the route to```https://example.com/#/login```, when accessing ```https://example.com/login```.This module provides middleware to avoid the problem.## How to use### Middleware1. Add ```dj_ajax_redirect.middleware.AjaxRedirectionMiddleware```to ```MIDDLEWARE_CLASSES``` on your setting.## Disable redirection### MiddlewareJust add a new item named "DISABLE_REDIRECT", of which type is list. i.e. just like this:~~~~DISABLE_REDIRECT = [r"^path_to_disable_redirect/disable$"]~~~~Note that static files are already added to disable list. Therefore, you don't need to addstatic urls.In addition, *the strings are treated as regexp-s*.
Package: django-ajax-search
A customizable AJAX-powered search for Django.FeaturesWorks with the latest jQuery library versionDisplays instant search results as you typeInstallation RequirementsPython 2.6 or Python 2.7Django>= 1.3jQuery>= 1.4.4To install:easy_install django-ajax-searchNext addajax_searchto yourINSTALLED_APPSto include the related css/js:INSTALLED_APPS = (
    'django.contrib.staticfiles',
    # Other apps here
    'ajax_search',
)The jQuery and jQuery UI libraries are not included in the distribution but must be included
in your templates. See the example project for an example using these libraries from the
Google CDN.Once installed you should add the urls to your root url patterns:urlpatterns = patterns('',
    # Other patterns go here
    url(r'^ajax_search/',include('ajax_search.urls')),
)Full documentation athttp://django-ajax-search.readthedocs.org/Additional Help/SupportYou can find additional help or support on the mailing list:http://groups.google.com/group/django-ajax-search
Package: django-ajax-selects
EditForeignKey,ManyToManyFieldandCharFieldin Django Admin using jQuery UI AutoCompleteThis Django app glues Django Admin, jQuery UI together to enable searching and managing ForeignKey  and ManyToMany relationships.At the time it was created Django did not have any way to do this, and this solution glued together some technologies of the day.If you are building a new project then you should not use this.Django has built in support now:https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fieldsDocumentationhttp://django-ajax-selects.readthedocs.org/en/latest/Installationpip install django-ajax-selectsAdd the app:# settings.pyINSTALLED_APPS=(...'ajax_select',# <-   add the app...)Include the urls in your project:# urls.pyfromdjango.urlsimportpathfromdjango.conf.urlsimportincludefromdjango.conf.urls.staticimportstaticfromdjango.contribimportadminfromdjango.confimportsettingsfromajax_selectimporturlsasajax_select_urlsadmin.autodiscover()urlpatterns=[# This is the api endpoint that django-ajax-selects will call# to lookup your model ids by namepath("admin/lookups/",include(ajax_select_urls)),path("admin/",admin.site.urls),]+static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)Quick UsageDefine a lookup channel:# yourapp/lookups.pyfromajax_selectimportregister,LookupChannelfrom.modelsimportTag@register('tags')classTagsLookup(LookupChannel):model=Tagdefget_query(self,q,request):returnself.model.objects.filter(name__icontains=q).order_by('name')[:50]defformat_item_display(self,item):returnu"<span class='tag'>%s</span>"%item.nameAdd field to a form:# yourapp/forms.pyfromajax_select.fieldsimportAutoCompleteSelectMultipleFieldclassDocumentForm(ModelForm):classMeta:model=Documenttags=AutoCompleteSelectMultipleField('tags')This will now work in the Django Admin.To use a form outside, be sure to includeform.mediaon the template where you place the form:{{ form.media }}
{{ form }}Read the full documention here:outside of the adminFully customizableCustomize search queryQuery other resources besides Django ORMFormat results with HTMLCustomize stylingCustomize security policyAdd additional custom UI alongside widgetIntegrate with other UI elements elsewhere on the page using the javascript APIWorks in Admin as well as in normal viewsAssets included by defaulthttps://jquery.com/3.7.1https://jqueryui.com/1.13.2Customize jqueryTo use a custom jQuery UI theme you can set:# settings.pyAJAX_SELECT_JQUERYUI_THEME="/static/path-to-your-theme/jquery-ui-min.css"https://jqueryui.com/themeroller/If you need to use a different jQuery or jQuery UI then turn off the default assets:# settings.pyAJAX_SELECT_BOOTSTRAP=Falseand include jquery and jquery-ui yourself, making sure they are loaded before the Django admin loads.CompatibilityDjango >=3.2Python >=3.10ContributorsMany thanks to all contributors and pull requesters !https://github.com/crucialfelix/django-ajax-selects/graphs/contributors/LicenseDual licensed under the MIT and GPL licenses:http://www.opensource.org/licenses/mit-license.php/http://www.gnu.org/licenses/gpl.html/
Package: django-ajax-selects-xadmin
Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.Customize search queryQuery other resources besides Django ORMFormat results with HTMLCustomize stylingCustomize security policyAdd additional custom UI alongside widgetIntegrate with other UI elements elsewhere on the page using the javascript APIWorks in Admin as well as in normal viewsDjango >=1.8, <=2.1Python >=2.7, <=3.7
Package: djangoajaxswiss
Fast and easy AJAX libraries for django applications.Requirements3.xpython>=3.5django>=2.02.xpython>=2.7django>=1.7,<2.0InstallationInstall django-ajax in your python environment1- Download and install package:$pipinstalldjangoajaxThrough Github:pipinstall-egit://github.com/yceruto/django-ajax#egg=djangoajaxor simply with:$pythonsetup.pyinstall2- Add'django_ajax'into theINSTALLED_APPSlist.3- Read usage section and enjoy this feature!Usage@ajax Decoratorfromdjango_ajax.decoratorsimportajax@ajaxdefmy_view(request):do_something()When the view does not return anything, you will receive this response (JSON format):{"status":200,"statusText":"OK","content ":null}Sending content@ajaxdefmy_view(request):c=2+3return{'result':c}The whole result is converted into a JSON format as part of thecontentelement:{"status":200,"statusText":"OK","content":{"result":5}}Combining with others decoratorsfromdjango.contrib.auth.decoratorsimportlogin_requiredfromdjango_ajax.decoratorsimportajax@ajax@login_requireddefmy_view(request):# if the request.user is anonymous then this view not proceedreturn{'user_id':request.user.id}The location or path of the redirection response will be given in thecontentitem,
also thestatusandstatusTextwill reflect what is going on:{"status":302,"statusText":"FOUND","content":"/login"}Template responsefromdjango.shortcutsimportrenderfromdjango_ajax.decoratorsimportajax@ajaxdefmy_view(request):returnrender(request,'home.html')The JSON response:{"status":200,"statusText":"OK","content":"<html>...</html>"}Catch exceptions@ajaxdefmy_view(request):a=23/0# this line throws an exceptionreturnaThe JSON response:{"status":500,"statusText":"INTERNAL SERVER ERROR","content":"integer division or modulo by zero"}AJAXMiddlewareIf you are using AJAX at all times in your project, we suggest you activate the AJAXMiddleware described below.Adddjango_ajax.middleware.AJAXMiddlewareto theMIDDLEWARE_CLASSESlist insettings.pyand all your responses will be converted to JSON whereas the request was made via AJAX, otherwise it will return a normal HttpResponse.Caution!If this middleware is activated you cannot use the@ajaxdecorator. That will cause double JSON conversion.AJAXMixin for class-based viewsAJAXMixinis an object that call to AJAX decorator.fromdjango.views.genericimportTemplateViewfromdjango_ajax.mixinimportAJAXMixinclassSimpleView(AJAXMixin,TemplateView):template_name='home.html'The JSON response:{"status":200,"statusText":"OK","content":"<html>...</html>"}Enjoy And Share!