Saravanan666/pypi-org huggingface dataset:
Package: django-aggressivequery
(this is experimental package)handling select_related and prefetch_reated, semi-automatically.fromdjango_aggressivequeryimportfrom_queryset(from_queryset(UserInfo.objects.filter(point__gt=0),["user__teams__games"]).prefetch_filter(user__teams__games=lambdaqs:qs.filter(name__contains="-a")))# almost same meansfromdjango.db.modelsimportPrefetch(UserInfo.objects.filter(point__gt=0).select_related("user").prefetch_related("user__teams",Prefetch("user__teams__games",queryset=Game.objects.filter(name__contains="-a"))))SQL exampleSELECT"userinfo"."id","userinfo"."point","userinfo"."ctime","userinfo"."user_id","user"."id","user"."name","user"."ctime"FROM"userinfo"INNERJOIN"user"ON("userinfo"."user_id"="user"."id")WHERE"userinfo"."point">0;SELECT("team_users"."user_id")AS"_prefetch_related_val_user_id","team"."id","team"."name","team"."price","team"."ctime"FROM"team"INNERJOIN"team_users"ON("team"."id"="team_users"."team_id")WHERE"team_users"."user_id"IN(2);SELECT"game"."id","game"."team_id","game"."name","game"."price","game"."ctime"FROM"game"WHERE("game"."name"LIKE'%-a%'ESCAPE'\'AND"game"."team_id"IN(1,2));model# relation: UserInfo - User *-* Team -* GameclassUser(models.Model):name=models.CharField(max_length=255,default="",null=False)ctime=models.DateTimeField()classUserInfo(models.Model):point=models.IntegerField(null=False,default=0)user=models.OneToOneField(User,related_name="info")ctime=models.DateTimeField()classTeam(models.Model):users=models.ManyToManyField(User,related_name="teams")name=models.CharField(max_length=255,default="",null=False)price=models.IntegerField(null=False,default=0)ctime=models.DateTimeField()classGame(models.Model):team=models.ForeignKey(Team,related_name="games")name=models.CharField(max_length=255,default="",null=False)price=models.IntegerField(null=False,default=0)ctime=models.DateTimeField()more specific optionCallingfrom_queryset()withmore_specificoption, then useQuery.only().fromdjango_aggressivequeryimportfrom_queryset(from_queryset(UserInfo.objects.filter(point__gt=0),["point","user__name","user__teams__name","user__teams__games__name"],more_specific=True).prefetch_filter(user__teams__games=lambdaqs:qs.filter(name__contains="-a")))0.3.1:fix bug when unexpected relations are found.0.3.0:
- fix bug that duplicated hints are occured
- fix bug thatget_accessor_name()method is not used
- adding extension feature.
- reimplementingskip_filter()as extension
- implementingcustom_prefetch()as extension
- reimplementingprefetch_filter()as extension
- (module separation)0.2.0:
- skipping function support (AggressiveQuery.skip_filter())0.1.2:
- gentle type check, infrom_query()0.1.1
- remove need less join (on prefetch releated)0.1
- first release
Package: django-agilesites
Django Agile Sites (django_agilesites)This provides django the ability of dynamic switching of the settings.SIDE_ID.  This allows
you to then alter the template paths based on the SITE_ID by referencing settings.SITE_FOLDERS.The way this works is first by dynamically setting (thread-safe) the settings.SITE_ID based on
the request.get_host() (which is based in part on request.META['HTTP_HOST']).  Once the SITE_ID
is established, then it uses that to dynamically look up any template path folder structure you
define.Example / SetupLets assume we want to have all traffic going to //beta.foo.com to use our new templates tree
called 'beta' for a new templateapp_detail.html.  This app will allows you to place the
following templates folder structure in your app to achieve this:app/
    templates/
        app/
            app_detail.html
            app_list.html
        beta/
            app_detail.htmlWe need to reference the two sites in question - so in the sites app assume the following.
SITE_ID: 1  domain: foo.com
SITE_ID: 2  domain: beta.foo.comNow to enable this to work you need to do the following:Add thedjango_agilesitesto the settings.INSTALLED_APPSAdd thedjango_agilesites.loaders.AgileSiteAppDirectoriesFinderto the settings.TEMPLATE_LOADERS.  I put itfirst.Add thedjango_agilesites.middleware.AgileSitesMiddleware'to the
settings.MIDDLEWARE_CLASSESAdd the following settings to reference the folder beta.SITE_FOLDERS = {
2: 'beta',
}That's it.Now when you go to //beta.foo.com/app/detail you will use the template in the beta tree and when
you go to the list view on beta it will refer to the parent app_list.html.Notes:You do NOT need to reference the SITE_ID 1 as there isn't a path change for that.You don't have to put every url.  We also support the notion of aliases through the use of
settings.SITE_ALIASES dictionary.  This will force //beta.bar.com to also use the beta templates.SITE_ALIASES = {
'beta.bar.com': 2,
}Versions1.0.x Django 1.81.1.x Django 1.9 < 2Build Process:Update the__version_info__inside of the application. Commit and push.Tag the release with the version.git tag <version> -m "Release"; git push --tagsBuild the releaserm -rf dist build *egg-info; python setup.py sdist bdist_wheelUpload the datatwine upload dist/*Have fun!
Package: django-agora
Django-Agora is a Django app to help integrating Video Calling Feature Using Agoro.io .Detailed documentation is in the “docs” directory.Quick startAdd “agora” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'agora',
]Import Agora views in your project urls.py like this:from agora.views import AgoraInclude the agora view in your project urls.py like this:path('agora/',Agora.as_view(
    app_id='<APP_ID>',
    channel='<CHANNEL_ID>'
)),Visithttp://127.0.0.1:8000/agora/to participate in the Video Call.
Package: django-aid
django-aidHelper module used in general django applicationsDjangoJinja2django.jinja2.environmentModeldjango.model.QuerySetannotate_choicesAnnotate the get_FOO_display() values of fields where choices existDRFViewSetviewsets.***ModelViewSetViewSetMixin클래스를 상속받은 GenericViewSet.serializer_classes속성을 사용하며,put메서드에 대한 문서화를 해제한다.Rendererrenderers.BrowsableAPIRendererForm을 제거한 BrowsableAPIRendrerFieldsfields.pk_model_field.PkModelField특정 Model의 instance를 나타내는 Field주어지는 데이터가 아래와 같을 경우를 처리# dict{'pk':1}or{'id':1}# literal (pk가 될 수 있는 숫자/문자 등의 고정 값)1or'1'생성시에만 사용 가능하다drf-yasgdrf_yasg.schema문서화 생성 헬퍼 클래스
Package: django-aiml
FeaturesTODORequirementsTODOInstallationYou can installDjango AIMLviapipfromPyPI:$pipinstalldjango-aimlUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,Django AIMLis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz’sHypermodern Python Cookiecuttertemplate.
Package: django-airbrake
Django Airbrake provides a logging handler to push exceptions and other errors
to airbrakeapp or other airbrake-compatible exception handler services (e.g.
aTech Media’s Codebase).Compatible with all supported Django (LTS) versions. At the moment of writing
that’s including 1.11 and 2.0 on Python 2.7(only django1.11), 3.4, 3.5 and 3.6.InstallationInstallation withpip:$ pip install django-airbrakeAdd'airbrake.handlers.AirbrakeHandler'as a logging handler:LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'airbrake': {
            'level': 'WARNING',
            'class': 'airbrake.handlers.AirbrakeHandler',
            'filters': ['require_debug_false'],
            'api_key': '[your-api-key]',
            'env_name': 'develop',
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['airbrake'],
            'level': 'WARNING',
            'propagate': True,
        },
    }
}Settingslevel(built-in setting)
Change thelevelto'ERROR'to disable logging of 404 error messages.api_key(required)API key provided by the exception handler system.env_name(required)Name of the environment (e.g. production, develop, testing)api_urlTo use aTech Media’s Codebase exception system, provide an extra settingapi_urlwith the value'https://exceptions.codebasehq.com/notifier_api/v2/notices'.env_variablesList of environment variables that should be included in the error message,
defaults to['DJANGO_SETTINGS_MODULE'].meta_variablesList ofrequest.METAvariables that should be included in the error
message, defaults to['HTTP_USER_AGENT', 'HTTP_COOKIE', 'REMOTE_ADDR', 'SERVER_NAME', 'SERVER_SOFTWARE'].timeoutTimeout in seconds to send the error report, defaults to 30 seconds.ContributingFork the repository on GitHub and start hacking.Run the tests.Send a pull request with your changes.ReleasingThe following actions are required to push a new version:bumpversion [major|minor|patch]
python setup.py sdist bdist_wheel upload
git push
Package: django-airdrop
Django is a high-level Python web framework that encourages rapid development
and clean, pragmatic design. Thanks for checking it out.All documentation is in the “docs” directory and online athttps://docs.djangoproject.com/en/stable/. If you’re just getting started,
here’s how we recommend you read the docs:First, readdocs/intro/install.txtfor instructions on installing Django.Next, work through the tutorials in order (docs/intro/tutorial01.txt,docs/intro/tutorial02.txt, etc.).If you want to set up an actual deployment server, readdocs/howto/deployment/index.txtfor instructions.You’ll probably want to read through the topical guides (indocs/topics)
next; from there you can jump to the HOWTOs (indocs/howto) for specific
problems, and check out the reference (docs/ref) for gory details.Seedocs/READMEfor instructions on building an HTML version of the docs.Docs are updated rigorously. If you find any problems in the docs, or think
they should be clarified in any way, please take 30 seconds to fill out a
ticket here:https://code.djangoproject.com/newticketTo get more help:Join the#djangochannel onirc.libera.chat. Lots of helpful people
hang out there.Webchat is available.Join the django-users mailing list, or read the archives, athttps://groups.google.com/group/django-users.Join theDjango Discord community.Join the community on theDjango Forum.To contribute to Django:Check outhttps://docs.djangoproject.com/en/dev/internals/contributing/for
information about getting involved.To run Django’s test suite:Follow the instructions in the “Unit tests” section ofdocs/internals/contributing/writing-code/unit-tests.txt, published online athttps://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-testsSupporting the Development of DjangoDjango’s development depends on your contributions.If you depend on Django, remember to support the Django Software Foundation:https://www.djangoproject.com/fundraising/
Package: django-airports
Provides airports’ related models and data (fromOurAirports) that can be used in  django projects, inspired bydjango-citiesAuthored byBasil Shubin,  and some greatcontributors.InstallationFirst install the module, preferably in a virtual environment. It can be installed from PyPI:pipinstalldjango-airportsRequirementsYou must havedjango-citiesinstalled and configured, see thedjango-citiesdocumentation for details and setup instructions.SetupFirst make sure the database support spatial queries, see theGeoDjango documentationfor details and setup instructions.You’ll need to addairportstoINSTALLED_APPSin your projectssettings.pyfile:INSTALLED_APPS+=['airports',]Then run./manage.py migrateto create the required database tables.Import dataAfter you have configured all settings, runpythonmanage.pyairportsTheairportsmanage command has options, seeairports--helpoutput.Second run will update the DB with the latest data from the source csv file.ContributingIf you like this module, forked it, or would like to improve it, please let us know!
Pull requests are welcome too. :-)Licensedjango-airportsis released under the MIT license.Changes1.0.3 (2021-12-22)Fixed broken release.1.0.2 (2021-12-22)Include missing .mo files.1.0.1 (2021-12-22)Added ru translation.Renamed city_name field to municipality, local field to local_code.1.0.0 (2021-12-21)Added Django 3+ support.Dropped Python 2.7 support.Dropped Django 1.10 / 1.11 support.
Package: django-airports-apis
django-airports-apis=====Airport data for Django. Using different API EndpointsFeatures-1. Fetch Airport data from different API's2. django-modeltranslation support3. Basic views and serializers for django-rest-frameworkBasic setup-Install django-airports-apis via [PyPI][]```pip install django-airports-apis```Add airports to installed apps and configure your preferred API:```# settings.pyINSTALLED_APPS = (...'airports'...)AIRPORT_API = {'openflights': ('airports.openflights.OpenFlights',{})}```Then run `/manage.py migrate` to sync your database.Call the management command to fetch airports from the selected API (this may take a while):```/manage.py load_airports            #fetches airport data from API/manage.py load_airports --flush    #deletes all airport records```Provided API Backends-[openflights.org][]Openflights provides free English airport data.You don't need to register to use this API:```# settings.pyAIRPORT_API = {'openflights': ('airports.openflights.OpenFlights',{})}```[flightstats.com][]Go to [flightstats.com] and register for an account. As soon as your account is active you can use the multilingual airport data. At the moment it supports 8 different languages:English, Simplified Chinese, Japanese, German, Spanish, French, Portuguese, and Arabic```# settings.pyAIRPORT_API = {'flighstats': ('airports.flightstats.Flightstats',{'app_id' : '1234asdfc','app_key' : 'asg5j67hzergrgevwe'}),}```Modeltranslation-The package supports [django-modeltranslation][] out of the box. If the API supports different languages (like flightstats.com), the management command will automatically fetch the languages specified in your settings.py.Rest Framework-The package also includes some basic support for [django-rest-framework][]. To activate the views simply include the urls in your urls.py:```#urls.pyurlpatterns = patterns('',...url(r'api/',include('airports.urls'),),...)```Example Application-Please see the `example` application. This was used to test the developed features. It also serves as a nice quicklook into django-airport-apis.[django-rest-framework]: http://www.django-rest-framework.org/[django-modeltranslation]: https://github.com/deschler/django-modeltranslation[flightstats.com]: http://www.flightstats.com[openflights.org]: http://openflights.org/data.html[PyPI]: https://pypi.python.org/pypi/murcss
Package: django-airports-legacy
QuickstartRequirements (Ubuntu 16.04):sudo apt-get install -y libsqlite3-mod-spatialite binutils libproj-dev gdal-binInstall django-airports-legacy:pip install django-airports-legacyAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'cities','airports','django.contrib.gis',...)FeaturesThe`airports`manage command has options, see`airports--help`output.
Second run will update the DB with the latest data from the source csv file.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxMake a package::python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*History0.2.5 (2022-01-03)upstream django-cities-legacy==0.6.1 requirementdjango 4 support0.2.2 (2020-10-01)upstream django-cities==0.6 requirementbetter doc on installation0.2.1 (2019-12-17)compatibility with Django 3.00.2 (2019-09-15)renaming and uploading to Pypi0.1.5 (2018-03-08)creation of the HISTORY.rst file;
Package: django-aislug
A slug field that automatically calculates its value from another attribute or
method.Requirementsdjango-aislug depends ondjango-stringfield.InstallationUsing pip to install will install django-aislug and all of its dependencies:pip install django-aislugOptionsAll options that are available fordjango.db.models.CharFieldare also
available toAISlugField. There are some additional options:populate_from: Property or method on the model that is the base for the
computed slug.Default'title'slugify: User defined slugify callback function to compute the slug frompopulate_frominvalid: List or function that returns a list of invalid valuesDefault:[]update: IfFalsethe slug will not be updated frompopulate_fromon subsequent saves.Default:Falseunique_for: A list of fields to make this slug unique for.Default:[]
Package: django-aissonline
django-aiss-online本项目借鉴于aiss-spider现在你可以通过pip install django-aissonline来安装安装app后在djangosetting.py中INSTALLED_APPS加入django-aissonline 如INSTALLED_APPS=[...'django-aissonline',]在djangourls.py中urlpatterns加入url 如urlpatterns=[...path('',include('django-aissonline.urls')),]启动django server 并游览/aissonline/
Package: djangoajax
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!
Package: django_ajax
ABOUTdjango_ajax provides some basic structure to make working with AJAX (and
Javascript in general) more easy.HOWdjango_ajax provides various utils.render_to_jsonrender_to_json is both implemented as a view and a decorator. The view does
the real work, while the decorator is a utility function which itself uses
the view to convert objects to json.The view expects two arguments:requestthe object to output as JSONIt sets some HTTP headers to make sure the JSON can be loaded everywhere and
nothing is cached in the browser.The decorator just calls the original view function. If the response is not
already a HttpResponse, it will be passed through the view as described above.{% json %}Template tag to render various objects as JSON.Syntax:<script type="text/javascript">
        var obj_as_json = {% json object %};
</script>

<script type="text/javascript">
        {# Output "null" of variable does not exist (prevents JS error) #}
        var obj_as_json = {% json object or null %};
</script>{% ajax_cache %}Utility template tag to pass objects to some JS function. May be used to
implement JS-side caching of objects. This will speed up JS-driven apps, as
the template can put out JS-objects then they are needed anyways. The tag
makes sure every object will only be cached once, multiple calls will only
output one JS-call.Syntax:<script type="text/javascript">
        {% comment %}
                Will output the same as "some_func.to.call({% json object %});"
                But only if object was not used in combination with
                "some_func.to.call" before.
        {% endcomment %}
        {% ajax_cache object using "some_func.to.call" %}
</script>ajax_processorsLike context_processors, but used to put variables into the JS context.
Provides JS_CONTEXT via a context processor, which can be rendered using
{% json JS_CONTEXT %}. Example:<script type="text/javascript">
        var config = {% json JS_CONTEXT %};
</script>Uses settings.AJAX_CONFIG_PROCESSORS, which uses the same syntax as
for context processors.dango_ajax comes with three ajax processors
(living in django_ajax.ajax_processors):media: provides MEDIA_URLstatic: provides STATIC_URLsession: provides basic authentcation informationincludes AJAX login/logout urls and viewsAPIUses object.ajax_data() in various places to allow defining method to convert
models/… into dictionaries, which can be converted to JSON. This way you may
pass model instances directly to {% json %} and the model may define which
data to output.
Package: django-ajax-access
Django Ajax AccessDescriptionA set of views and urls for ajax-based logout and logout for Django.Installationpip install django_ajax_accessorpipenv install django_ajax_accessUsagesettings.pyAJAX_ACCESS={"LOGIN_RATELIMIT":{"KEY":"ip","RATE":"10/h","BLOCK":True,},"LOGOUT_RATELIMIT":{"KEY":"ip","RATE":"10/h","BLOCK":True,},}urls.pyfromdjango.conf.urlsimporturl,includeurlpatterns=[...url("^access/",include("ajax_access.urls")),...]
Package: django-ajax-auth
# django-xauth[![PyPI version](https://badge.fury.io/py/django-ajax-auth.svg)](https://badge.fury.io/py/django-ajax-auth)Some simple AJAX authorisation endpoints for Django.## Why?I wanted a package to integrate AJAX authorisation with Django'sstandard authorisation views. When a request is made via AJAX itshould be handled as such, and when a standard request is made thelogin form should be rendered.## Installation`pip` is the easiest way to get the package:```pythonpip install django-ajax-auth```Add the package to your Django settings file:```pythonINSTALLED_APPS = ['xauth',...]```Replace the standard authorisation URLs in your URL configuration:```pythonurlpatterns = [url(r'^', include('xauth.login_ajax_urls'))]```## UsageNow you can either perform the usual non-AJAX GET and POST to loginas you would normally, or POST using `application/json` encoding tologin over AJAX.```javascriptimport $ from 'jquery'$.ajax({url: '/login',method: 'POST',contentType: 'application/json',data: {username: 'harry',password: 'henderson123'}})```Sometimes you may wish to only allow AJAX logins, in which case set`XAUTH_AJAX` to `True` in your settings file.
Package: django-ajax-cbv
Django module to easily use generic Class Based views with ajax.Table of contents:How to install;License.CompatibilityTested with python 2.7, 3.4, 3.5, 3.6 and Django 1.9, 1.10, 1.11:Travis CIHow to installTo install the app run :pipinstalldjango-ajax-cbvor add it to the list of requirements of your project.Then add ‘ajax_cbv’ to your INSTALLED_APPS.INSTALLED_APPS=[...'ajax_cbv',]LicenseMIT license, see the LICENSE file. You can use obfuscator in open source
projects and commercial products.