Saravanan666/pypi-org huggingface dataset:
Package: django-beefycachecontrol
django-beefycachecontrol is a Django middleware that smacks misbehaving upstream caches into submission with beefier anti-cache HTTP headers.Normally, when a view is decorated with @never_cache:@never_cache
def my_view(request):
    ...The resulting HTTP headers (among other things) include:Cache-Control       max-age=0While this should be sufficient to prevent the response from being cached upstream, but there may be circumstances where this is not enough. Enter django-beefiercachecontrol!With BeefyCacheControlMiddleware enabled, these HTTP headers become:Cache-Control       max-age=0, no-cache, no-storeCache that and you’d be arrested by the internet cops!Installationeasy_installdjango-beefycachecontrolorpip installdjango-beefycachecontrolAddbeefycachecontrolto yourINSTALLED_APPSIn settings.py add'beefycachecontrol.middleware.BeefyCacheControlMiddleware'toMIDDLEWARE_CLASSESUsagedjango-beefycachecontrol is a middleware. Once it is enabled, there is nothing more to do. It simply fixes up your no-cache related HTTP headers.
Package: django-before
django-before - tools that are needed BEFORE any others in each django project.subpathermake_subpather - tool to calculate relative paths from root directory.# at the beginning of settings.pyfromdjango_beforeimportmake_subpather# e.g. I have project structure where this file is here: project_root/src/django_project/settings/base.py# so root of my project is 4 levels higher:subroot=make_subpather(__file__,4)# know I can handy get paths relative to root of the project:MEDIA_ROOT=subroot('static_content/media/')DIR_SAMPLE_IMAGES=subroot('src/crm/res/sample_images')json settings readermake_json_settings_reader - tool to read settings from json file (e.g. secret settings).# create settings readersecrets=make_json_settings_reader(subroot('conf/secrets.json'))# use it for reading settingsDATABASES={'default':{'ENGINE':'django.db.backends.postgresql_psycopg2','NAME':'mydbname','USER':'mydbuser','PASSWORD':secrets['DATABASE_PASSWORD'],}}SECRET_KEY=secrets['SECRET_KEY']Data in json file must be represented as dict:{"SECRET_KEY":"user123","DATABASE_PASSWORD":"user123"}
Package: django-behind-lb
Behind-LB is a very simple and efficient Django middleware to obtain
the client IP address when the project runs behind a trusted load
balancer.It allows to specify the path that activate the middleware, for example/or/a/specific/path. The pathmustbe specified in the variableBEHIND_LB_PATHin your settings.py.It works with any load balancer that sends the public remote address in
a fixed relative position in the header (first, second,… , last).
For example, Amazon ELB puts it in the last position, Google Compute
Load Balancer in the penultimate one. The positionmustbe specified insettings.BEHIND_LB_POSITION.Quick startInstall the package:pip installdjango-behind-lbJust adddjango-behind-lbto yourINSTALLED_APPSsetting like this:MIDDLEWARE_CLASSES = (
    'behind_lb.middleware.BehindLB',
    ...Configure the path and position in settings.py:BEHIND_LB_PATH = "/"
BEHIND_LB_POSITION = -2 # For Google Compute EngineTry it reading the defaultrequest.META['REMOTE_ADDR']in a View class. It
should read the real client IP.Position optionsTheBEHIND_LB_PATHvalue specifies the position of the real IP address in theX-Forwarded-Forheader, where 0 is the first (or “left”), 1 the second, -2 the
penultimate position and -1 the last one. Examples:BEHIND_LB_POSITION =  0 # First

BEHIND_LB_POSITION = -2 # Next to last, for Google Compute Engine LB

BEHIND_LB_POSITION = -1 # Last, for Amazon EC2 LBIn GithubThe code is available athttps://github.com/APSL/django-behind-lb
Package: django_bench_runner
Django Bench Runner is a drop-in enhancement of the default django test
runner that times how long it takes to run individual tests. It helps
detect tests that might need optimization.Installationpip install django-bench-runnerIn settings.py, add:TEST_RUNNER = 'django_bench_runner.runner.BenchRunner'UsageAdd the-b(or--benchmark) flag when running your tests.ColorizationTests that run under .5 seconds are colored green. The resulting tests
are divvied into 3 groups. The fastest third (yellow), the middle third
(magenta), and the slowest third (red).Red tests do not mean the tests
are necessarily bad or in critical need of a
speedup.
It is just a graphical way to identify the various times of the tests.Example Output$ ./manage.py test core.tests.test_transfer_money -b --keepdb
Using existing test database for alias 'default'...
..

Test                                                              Runtime    Percent
--------------------------------------------------------------  ---------  ---------

core.tests.test_transfer_money.TestReleaseAmounts
: test_wells_fargo                                                8.25052     47.81%
: test_wells_fargo_exempt_from_prefunding                         9.00663     52.19%
---------------------------                                       -------    -------
TestReleaseAmounts                                               17.25715    100.00%

----------------------------------------------------------------------
Ran 2 tests in 17.262s

OKDjango compatibilityTested and working in Django 1.8 and 1.9.CreditsSpecial thanks Sergey Astanin for
`tabulate <https://pypi.python.org/pypi/tabulate>`__
Package: django-bento
|ZZZZZZZZZZZZZZZZZZZZZZZZZ|
|:|  +------+ +------+  |:|
|:|  |      | |      |  |:|
|:|  |      | |      |  |:| django-bento helps you adding editable
|:|  |      | |      |  |:| text and image content areas on
|:|  +------+ +------+  |:| your site. These content boxes are
|:|  |      | |      |  |:| easy to define in templates and are
|:|  |      | |      |  |:| updated from Django admin.
|:|  |      | |      |  |:|
|:|  +------+ +------+  |:|
|ZZZZZZZZZZZZZZZZZZZZZZZZZ|FeaturesDynamic content: Editable from the Django adminEdit Link: Admin users see an edit link that bring them to the right
admin edit pageMultilingual: Using django-linguo to enable multiple
languages support for both texts and imagesExport/Import: Backup and restore you content from the admin.
For instance, you could export from a staging site
and them import into a live site.DocumentationRead more:https://github.com/lazybird/django-bento
Package: django-best-templatetags
Best tags and filters for Django templatesDocumentationPlease,read the docNews0.0.5 (2020-05-06)Change update_url() and extend_url() parametersRemove some dependenciesUse Pipfile instead of requirements.txt0.0.4 (2018-03-31)Added ‘type’ filter0.0.3 (2018-01-22)Added many filters and tags0.0.1 (2018-01-02)First running version
Package: django-bestzhlocale
Collect the best chinese translation.The best Chinese locale.DocumentationThe full documentation is athttps://django-bestzhlocale.readthedocs.io.QuickstartInstall The Best Chinese Locale:pip install django-bestzhlocaleAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_bestzhlocale',...)Add The Best Chinese Locale’s URL patterns:fromdjango_bestzhlocaleimporturlsasdjango_bestzhlocale_urlsurlpatterns=[...url(r'^',include(django_bestzhlocale_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2020-01-17)First release on PyPI.
Package: django-beta
django-betadjango-betais a simple application to help you capture pre-beta interest
with your sites.By defaultdjango-betaonly captures a user’s email address, however you
can alternately set one of these two configuration options:BETA_CAPTURE_FIRST = True, will use a form and require the user to enter their
first name and email address.BETA_CAPTURE_BOTH = True, will use a form and require the user enter their
first name, last name, and email address.InstallationAddbetato yourINSTALLED_APPSand run syncdb.Add the following to your urls.py:url(r’^beta/’, include(‘beta.urls’)),Using the example templates provided in the code, create your customized beta signup templates.ManagersTheBetaSignupmodel has the following manager method to help out:BetaSignup.objects.contacted()
BetaSignup.objects.not_contacted()
BetaSignup.objects.registered()
BetaSignup.objects.not_registered()Side Effectsdjango-betalistens for a signal on User creation and marks the
corresponding BetaSignup entry as ‘registered’.TODOAdmin views to show beta registrations over timeManagement commands to simplify emailing the interested users
Package: django-bethany-components
django-bethany_componentscomponents collection for bethany_dsSupported components필수 컴포넌트'popup',
'base',
'hero',선택 공통 컴포넌트'about',
'clients',
'gallery',
'cta',
'services',
'portfolio',
'contact',
'counts',
'whyus',
'faq',
'team',
'appointment',
'testimonials',
Package: django-bethany-ds
django-bethany_dsdjango-bethany_ds는 bethany_ds 템플릿의 기본형이다.Quick start본 템플릿은 다음의 필수 앱들이 필요하다. 프로젝트의 settings.py에 다음을 추가한다.INSTALLED_APPS=[...'django.contrib.humanize','bethany_ds',# 필수 컴포넌트'popup','base','hero',# 선택 공통 컴포넌트'about','clients','gallery','cta','services','portfolio','contact','counts','whyus','faq','team','appointment','testimonials',]static 파일을 저장하기 위해 settings.py에 다음을 추가한다.STATICFILES_DIRS=[os.path.join(BASE_DIR,'_static/'),]프로젝트의 urls.py에 다음을 추가하여 home app과 템플릿에 연결한다.fromdjango.urlsimportpath,includefromdjango.confimportsettingsfromdjango.conf.urls.staticimportstaticurlpatterns=[# ...path('',include('bethany_ds.urls')),]+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)BASE_DIR에 _data폴더를 생성하고 context.py를 생성한다.BASE_DIR에 _static폴더를 생성하고 이미지를 저장한다.데이터베이스 구성python manage.py makemigrations popup portfolio
python manage.py migrate프레임으로 창을 띄울때 거부하는 문제 해결위해 settings.py에 다음을 주석처리함.MIDDLEWARE=[...# 프레임으로 창을 띄울때 접속을 거부하는 문제 해결# 'django.middleware.clickjacking.XFrameOptionsMiddleware',]
Package: django-better-admin-arrayfield
Django better admin ArrayFieldBetter ArrayField widget for adminSupported Python versions:Supported Django versions: 2.0, 2.1, 2.2, 3.0, 3.1might work with different django/python versions as well but I did not test that.It changes comma separated widget to list based in admin panel.Before:After:QuickstartInstall Django better admin ArrayField:pip install django-better-admin-arrayfieldAdd it to your `INSTALLED_APPS`:INSTALLED_APPS=(...'django_better_admin_arrayfield',...)Usagedjango_better_admin_arrayfield.models.fields.ArrayFieldis a drop-in replacement for standard DjangoArrayField.Import it like below and use it in your model class definition.fromdjango_better_admin_arrayfield.models.fieldsimportArrayFieldImport DynamicArrayMixin like belowfromdjango_better_admin_arrayfield.admin.mixinsimportDynamicArrayMixinIn your admin class addDynamicArrayMixin:
...classMyModelAdmin(admin.ModelAdmin,DynamicArrayMixin):That's it.Custom subwidgetBy default the subwidget (the one used for each item in the array) will be TextInput. If you want something else, you can use your own specifying it in theformfield_overridesof your Admin model:classMyWidget(DynamicArrayWidget):def__init__(self,*args,**kwargs):kwargs['subwidget_form']=MyFormsuper().__init__(*args,**kwargs)classMyModelAdmin(models.ModelAdmin,DynamicArrayMixin):...formfield_overrides={DynamicArrayField:{'widget':MyWidget},}If you wanted to have Textarea as the subwidget, you can simply use the included drop-in widget replacement:fromdjango_better_admin_arrayfield.forms.widgetsimportDynamicArrayTextareaWidgetclassMyModelAdmin(models.ModelAdmin,DynamicArrayMixin):...formfield_overrides={DynamicArrayField:{'widget':DynamicArrayTextareaWidget},}Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxPre-commit hooksInstall pre-commit black hooksource <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_dev.txt
(myenv) $ pre-commit installCreditsInspired by:https://stackoverflow.com/a/49370480/4638248Tools used in rendering this
package:Cookiecuttercookiecutter-djangopackageHistory1.4.2 (2020-12-08)Adjust template to better match django style1.4.1 (2020-12-08)Allow submitting empty array field1.4.0 (2020-10-04)allow choosing subwidget for DynamicArrayWidget1.3.0 (2020-07-09)Handle default values in form field1.2.1 (2020-07-09)Fix tests requirements1.2.0 (2020-07-09)handle default values in model fields1.1.0 (2020-04-28)Add spanish translations1.0.7 (2020-04-27)Add possibility to i18n strings1.0.6 (2020-04-15)Remove debugging print statementsuse default_app_config for easier integrationSupport dynamically-added inline forms1.0.5 (2019-12-30)Add python 3.8 and Django 3.0 to tests1.0.4 (2019-09-02)Can add item after removing everything from the list1.0.3 (2019-09-02)Can add item after removing everything from the listDo not call static at startup time1.0.2 (2019-04-03)If field is required empty list raises ValidationError on clean.1.0.1 (2019-02-23)Empty list is no longer recognized as changed.1.0.0 (2019-02-21)First release on PyPI.
Package: django-better-auth-oidc
This is a Django login view that authenticates against an OpenID Connect
Authentication Server.Use it if you own a single Authentication Server that you want to share
between multiple apps.Huh?This is a fork of the abandoneddjango-auth-oidc. Original code by theAiakosteam.What is OpenID Connect?It’s a OAuth2-based standard for authentication in applications.It can be used for social logins, and for setting up Single Sign-On into multiple services
hosted by the same company. In the last case, it somewhat supersedes LDAP,
as with OIDC people are entering their credentials only into the views
served by the Authentication Server, and not into all the company’s
applications.RequirementsPython 3.5+Django 4.x+openid-connectInstallationpipinstalldjango-better-auth-oidcsettings.pyINSTALLED_APPS+=['django_better_auth_oidc']urls.pyurlpatterns+=[path('auth/',include('django_better_auth_oidc.urls')),]ConfigurationServer Cache LockBy default, DBAO will only fetch the server info based on a cache lock timer. To disable this feature, use the setting AUTH_SERVER_CACHE_LOCK and set to false.Authorization ServerApp’s redirect URI: http(s)://app-domain/auth/done
App’s post-logout redirect URI: http(s)://app-domain/LOGOUT_REDIRECT_URL(or / if not set)Authorization Server detailsYou may specify following settings in the Django settings file:AUTH_SERVER - OpenID Connect Authorization Server URL.AUTH_CLIENT_ID - Client ID received from the Authorization ServerAUTH_CLIENT_SECRET - Client secret received from the Authorization ServerAUTH_PROTOCOL (optional) - Legacy protocol supported byopenid-connectlibrary, for example github or gitlab. Seeopenid-connect’s documentation for full list of supported protocols.Or, alternatively, you may set the AUTH_URL environment variable:AUTH_URL=(protocol+)http(s)://client_id:client_secret@server/(Note: “:”, “@”, “/” and “%” inside client_id and client_secret must be urlquoted.)BehaviorAUTH_SCOPE (default: [‘openid’]) - list of scopes to request from the auth serverAUTH_GET_USER_FUNCTION (default: ‘django_auth_oidc:get_user_by_username’) - name of a function that takes the user info dict, and returns an user object representing that user; note that it should set the user.backend attribute.
Package: django-better-filter-widget
django-better-filter-widget===========================A better filter widget for foreign key relationships that also works on mobile devices. This was initially developed as a drop-in replacement for  admin forms. It will work in a normal form but you'll have to include some css/js dependencies. I'll write about how to do that soon.<img src="http://i.imgur.com/jzKen5h.gif" width="542"/># AboutDjango's [horizontal and vertical filter widget](http://i.imgur.com/RBgrm.png) is ugly, confusing to new users and completely broken on mobile devices. **django-better-filter-widget** is not magic and does not do real-time lookups like **django-selectable**. It's simply a nicer UI for filtering a list of things that, most importantly, actual works on mobile devices.# InstallationNote: This project is brand spanking new and is still being tested. It was developed using django 1.6. It was tested in modern desktop and mobile browsers.**Install with pip**`pip install django-better-filter-widget`**settings.py**Add 'better_filter_widget' to INSTALLED_APPS in your settings.py**admin.py**Specify BetterFilterWidget as the widget for your field:from django import formsfrom django.contrib import adminfrom better_filter_widget import BetterFilterWidgetclass MyModelForm(forms.ModelForm):class Meta(object):model = MyModelwidgets = {'my_field': BetterFilterWidget(),}class MyModelAdmin(admin.ModelAdmin):form = MyModelFormadmin.site.register(MyModel, MyModelAdmin)# LicenseThe MIT License (MIT)Copyright (c) 2014 Exotic ObjectsPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
Package: django-betterforms-jpic
App for Django featuring improved form base classes.Home-page:https://django-betterforms.readthedocs.org/en/latest/Author: Fusionbox
Author-email:programmers@fusionbox.comLicense: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Framework :: Django :: 2.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Internet :: WWW/HTTP
Package: django-better-json-widget
django-better-json-widgetBetter JSON Widget for Django AdminFeaturesBetter Json widget with schema for your Django Admin siteCan watch for changes in the given field (follow_field) and dynamically update the JSON schemaSupportsJSON SchemaYou can edit generated UI fields specified in schema or edit raw JSONUse Vue.js for UISupports Python 3.8+ and Django 3.2+LimitationsSupports only a small subset of the JSON Schema (integer, number, boolean, string types)Does not support enum, list types (yet) and nested objects (not planned)So, PR's are welcome!InstallationInstall packagepipinstalldjango-better-json-widgetAddbetter_json_widgetto yourINSTALLED_APPSExamplefrombetter_json_widget.widgetsimportBetterJsonWidgetfromdjango.contribimportadminfromdjango.formsimportModelFormfrom.modelsimportTestModelschema_mapping={"animal":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limbs":{"type":"integer","title":"Number of limbs","description":"How many limbs does the animal have?",},"color":{"type":"string","title":"Color"},"herbivore":{"type":"boolean","title":"Is it herbivore?","default":True,},},"required":["limbs","herbivore"],},"superhero":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","title":"Name","description":"Give a name to your superhero",},"superpower":{"type":"string"},},"required":["name"],},}classTestModelAdminForm(ModelForm):classMeta:model=TestModelfields="__all__"widgets={"options":BetterJsonWidget(follow_field="type",# `schema_mapping` and `schema` can be callablesschema_mapping=schema_mapping,),}@admin.register(TestModel)classTestModelAdmin(admin.ModelAdmin):form=TestModelAdminFormfields=["type","options",# JsonField]Also, if you don't need to dynamically change schema, you can useschemaoption:BetterJsonWidget(schema={"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{...},"required":[],},)SettingsIf for some reason you don't want to use bundled Vue.js, you can changeBETTER_JSON_WIDGET_VUE_URLsettings:BETTER_JSON_WIDGET_VUE_URL="https://unpkg.com/vue@3"If you set this setting toNone, then bundled Vue.js will not be used.TODOImprove JSON Schema supportShow current field value in UIUI testsLicenseMITCreditsThis project was generated withyakimka/cookiecutter-pyproject.
Package: django-better-migrations
Django Better MigrationsThis project aims at providing improvements to Django's default migration system.More informations in the documentation, see "docs/" folder.ExampleSee below migration, generated automatically viamanage.py makemigrations:# -*- coding: utf-8 -*-# Generated by Django 1.9 on 2017-12-01 00:00from__future__importunicode_literalsfromdjango.dbimportmigrations,models# Generated SQL code (sqlite):## --# -- Create model Person# --# CREATE TABLE "example_app_person" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "name" varchar(100) NOT NULL);## Check results:# CHECK OK: No ALTER TABLE ADD COLUMN with non-NULL constraintclassMigration(migrations.Migration):initial=Truedependencies=[]operations=[migrations.CreateModel(name='Person',fields=[('id',models.AutoField(auto_created=True,primary_key=True,serialize=False,verbose_name='ID')),('name',models.CharField(max_length=100)),],),]LicenseMIT, seeLICENSEfile.