Saravanan666/pypi-org huggingface dataset:
Package: djangobuk-envsettings
envsettingsUpdate django settings from environment variables by updatingsys.modulesMostly usingast.literal_evalto convert string to python object.Tested by converting all default django settings to string and back to python object and then running django command.todosimplify codeverify settings after they are casted to python objectUsage:inmyproject.settings:importosimportsysimportastfromdjangobuk_envsettingsimportupdate_from_envupdate_from_env(sys.modules[__name__],# default prefix for all variablespre='DJANGO_',# settings that can be updated from env# by default all settings are allowed (this option overrides)allowed=['SECRET_KEY','SITE_ID',],# optional# extra settings and their types (to be used with extra_allowed)extra_mapping={'DATABASE_PATH':ast.literal_eval,},# optional# extra settings that can be updated from envextra_allowed=['DATABASE_PATH',])# nothing more requiredDATABASES={'default':{'ENGINE':'django.db.backends.sqlite3','NAME':DATABASE_PATH,}}
Package: django-bulk-admin
django-bulk-adminDjango bulk admin enables you to bulk add, bulk edit, bulk upload and bulk select in django admin.View the screenshots below to get an idea of how django bulk admin does look like.Requires Django >= 1.7.Quick startInstall with pip:$ pip install django-bulk-adminAdd “bulk_admin” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'bulk_admin',
)Inherit frombulk_admin.BulkModelAdmininstead ofdjango.contrib.admin.ModelAdmin:from django.contrib import admin
from example_project import models

import bulk_admin


@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    search_fields = ('title',)


@admin.register(models.Project)
class ProjectAdmin(bulk_admin.BulkModelAdmin):
    raw_id_fields = ('images',)Enjoy!Bulk UploadBy default, django bulk admin provides a bulk upload button for each field type that has anupload_toattribute, likeFileFieldorImageField.
If you want to customize the provided buttons (or disable bulk upload at all), setbulk_upload_fieldsin theBulkAdminModel:@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    bulk_upload_fields = ()When files are bulk uploaded, a model instance is created and saved for each file.
If there are required fields, django bulk admin tries to set unique values (uuid) which can be edited by the uploading user in the next step.
For setting custom values or to support non string fields that are required, overridegenerate_data_for_file:@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):

    def generate_data_for_file(self, request, field_name, field_file, index):
        if field_name == 'data':
            return dict(title=field_file.name)
        return super(ImageAdmin, self).generate_data_for_file(request, field_name, file, index)CaveatsNo admin logs are generated for bulk operationsCustomize InlineDjango bulk admin provides two inlines that are similar to those provided by django admin:bulk_admin.TabularBulkInlineModelAdmin(which is the default)bulk_admin.StackedBulkInlineModelAdminYou can configure them exactly like django admin one’s:from django.contrib import admin
from example_project import models

import bulk_admin


class ProjectInline(bulk_admin.StackedBulkInlineModelAdmin):
    model = models.Project
    raw_id_fields = ('images',)


@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    search_fields = ('title',)


@admin.register(models.Project)
class ProjectAdmin(bulk_admin.BulkModelAdmin):
    raw_id_fields = ('images',)
    bulk_inline = ProjectInlineScreenshotsBulk addBulk editBulk uploadBulk select
Package: django-bulk-admin-marcusl
django-bulk-adminDjango bulk admin enables you to bulk add, bulk edit, bulk upload and bulk select in django admin.View the screenshots below to get an idea of how django bulk admin does look like.Requires Django >= 2.2.Available on PyPi ashttps://pypi.org/project/django-bulk-admin-marcusl/Quick startInstall with pip:$ pip install django-bulk-adminAdd “bulk_admin” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'bulk_admin',
)Inherit frombulk_admin.BulkModelAdmininstead ofdjango.contrib.admin.ModelAdmin:from django.contrib import admin
from example_project import models

import bulk_admin


@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    search_fields = ('title',)


@admin.register(models.Project)
class ProjectAdmin(bulk_admin.BulkModelAdmin):
    raw_id_fields = ('images',)Enjoy!Bulk UploadBy default, django bulk admin provides a bulk upload button for each field type that has anupload_toattribute, likeFileFieldorImageField.
If you want to customize the provided buttons (or disable bulk upload at all), setbulk_upload_fieldsin theBulkAdminModel:@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    bulk_upload_fields = ()When files are bulk uploaded, a model instance is created and saved for each file.
If there are required fields, django bulk admin tries to set unique values (uuid) which can be edited by the uploading user in the next step.
For setting custom values or to support non string fields that are required, overridegenerate_data_for_file:@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):

    def generate_data_for_file(self, request, field_name, field_file, index):
        if field_name == 'data':
            return dict(title=field_file.name)
        return super(ImageAdmin, self).generate_data_for_file(request, field_name, file, index)CaveatsNo admin logs are generated for bulk operationsCustomize InlineDjango bulk admin provides two inlines that are similar to those provided by django admin:bulk_admin.TabularBulkInlineModelAdmin(which is the default)bulk_admin.StackedBulkInlineModelAdminYou can configure them exactly like django admin one’s:from django.contrib import admin
from example_project import models

import bulk_admin


class ProjectInline(bulk_admin.StackedBulkInlineModelAdmin):
    model = models.Project
    raw_id_fields = ('images',)


@admin.register(models.Image)
class ImageAdmin(bulk_admin.BulkModelAdmin):
    search_fields = ('title',)


@admin.register(models.Project)
class ProjectAdmin(bulk_admin.BulkModelAdmin):
    raw_id_fields = ('images',)
    bulk_inline = ProjectInlineScreenshotsBulk addBulk editBulk uploadBulk select
Package: django-bulk-copy
Django Bulk CopyCreate your mass data in a faster way with theCOPYcommand.Currently it supports only the Postgresql database.Installpip install django-bulk-copyUsageclassTestModel(models.Model):integer_field=models.IntegerField(null=True)char_field=models.CharField(max_length=32,null=True)boolean_field=models.BooleanField(default=False)datetime_field=models.DateTimeField(null=True)json_field=models.JSONField(null=True)frombulk_copyimportBulkCopyobjects=[TestModel(integer_field=i,char_field=str(i),boolean_field=bool(i%2),datetime_field=timezone.now(),json_field={i:f"{i:>09}"},)foriinrange(1000)]BulkCopy(objects)BulkCopy only uses the initial time of the transaction if your model has a date/datetime field withauto_now=True.AdditionalIf you need to create your models from a csv file,django-postgres-copycould be a better alternative.
Package: django-bulk-create
Installation$pipinstalldjango-bulk_createFeaturesmultiple models aggregatorExamplesfromdjango_bulk_createimportbulk_createfromapps.app.modelsimportModel1,Model2create_list=[]create_list+=[Model1(id=42,description='description')]create_list+=[Model2(key="value")]model2kwargs={Model1:dict(update_conflicts=True,unique_fields=['id'],update_fields=['description',]),Model2:dict(ignore_conflicts=True)}bulk_create(create_list,model2kwargs)
Package: django-bulk-delete
Installation$pipinstalldjango-bulk_deleteFeaturesmultiple models aggregatorExamplesfromdjango_bulk_deleteimportbulk_deletefromapps.app.modelsimportModel1,Model2delete_list=[]forobjinModel1.objects.all():ifdelete_condition:delete_list+=[obj]forobjinModel2.objects.all():ifdelete_condition:delete_list+=[obj]bulk_delete(delete_list)
Package: django-bulk-saving
Django Bulk SavingAboutThis package provides utility for saving multiple Django model instances using one SQL query.Installpipinstalldjango-bulk-savingUsageInherit fromBulkSavableModel:frombulk_saving.modelsimportBulkSavableModelfromdjango.dbimportmodelsclassProduct(BulkSavableModel):name=models.CharField(max_length=30)Use as follows:withProduct.bulk_saving():foridx,productinenumerate(Product.objects.all(),1):product.name='Product nr%s'%idxproduct.save_later()Products will be saved after exit from context.LicenseThe Django Wicked Historian package is licensed under theFreeBSD
License.
Package: django-bulk-signals
SummaryThis django library adds signals for the bulk database actions provided by django (bulk_create,bulk_updateandQuerySet.update)usageAdd app to settingsINSTALLED_APPS = [
    ...,
    bulk_signals,
    ...
]Import signals and connect.The signals are connected the same way as in Django itself.
To see them in action use the following snippet:from django.dispatch import receiver
from bulk_signals import signals

@receiver(signals.pre_bulk_update, signals.post_bulk_update, signals.post_query_update)
def debug(*args, **kwargs):
    print(args)
    print(kwargs)You can skip the signals on a single execution by using theskip_signal=Truekeyword argument.
Which keyword should be used for skipping is configurable via theBULK_SIGNALS_SKIP_KEY="skip_signal"configuration in the django settings.TODOtest against different database backends
Package: django-bulk-tracker
django-bulk-trackerRun testspipinstall-rrequirements_dev.txt
pytestContributeIf you have great ideas for django-bulk-tracker, or if you like to improve something,
feel free to fork this repository and/or create a pull request.
I'm open for suggestions.
If you like to discuss something with me (about django-bulk-tracker), please open an issue.GitHub repository:https://github.com/hassaanalansary/django-bulk-trackerissue tracker:https://github.com/hassaanalansary/django-bulk-tracker/issues
Package: django-bulk-user-upload
Installable Django admin interface for bulk user creation from uploaded CSV file.InstallationFirst install using pippipinstalldjango-bulk-user-uploadThen add to yourINSTALLED_PACKAGESINSTALLED_PACKAGES=[...,'bulk_user_upload',]Then override the default User admin:fromdjango.contrib.adminimportregisterfromdjango.contrib.authimportget_user_modelfrombulk_user_upload.adminimportBulkUploadUserAdminUser=get_user_model()@register(User)classCustomUserAdmin(BulkUploadUserAdmin):passSetup and CustomizationBy default, the upload only processesusername,email,permissions, andgroups, e.g., you could use a CSV
with the following information:usernameemailpermissionsgroupsuseruser@example.com"auth.add_user,auth.change_user""Example Users,Test Users"But if you have a custom user model or need to capture more fields, you can modify the defaults by settingBULK_USER_UPLOADinsettings.py. Below are the defaults:BULK_USER_UPLOAD={'USERNAME_FIELD':'username',# user model username field'EMAIL_FIELD':'email',# user model email field'LOGIN_URL':'/',# used in account creation notification email template'USER_UPLOAD_FORM':'bulk_user_upload.forms.BulkUserUploadForm',# django admin upload form'USERS_PREPROCESSOR':'bulk_user_upload.utils.UsersPreProcessor',# cleanup/pre-process the uploaded CSV'USERS_CREATOR':'bulk_user_upload.utils.BaseUsersCreator',# creates users from the uploaded CSV'USERS_VALIDATOR':'bulk_user_upload.utils.UsersValidator',# validates users from the uploaded CSV'USER_FIELD_VALIDATORS':{},# add or override field-level validators'SEND_EMAILS_BY_DEFAULT':True,# whether "send emails" is checked by default in the upload form'ACCOUNT_CREATION_EMAIL_SENDER_ADDRESS':None,# email address used to notify user of account creation'ACCOUNT_CREATION_EMAIL_SUBJECT':'Account Created','EMAIL_SENDER':'bulk_user_upload.utils.EmailSender',# sends emails to created accounts# compute the name of the recipient, used in the account creation notification email template'GET_EMAIL_RECIPIENT_NAME':'bulk_user_upload.utils.get_email_recipient_name',}For example, if you wanted to indicate whether your uploaded users are staff, you could modify these settings like so:defintish(value):try:int(value)returnTrueexcept:returnFalseBULK_USER_UPLOAD=dict(USER_FIELD_VALIDATORS=dict(is_staff=(lambdais_staff:notintish(is_staff)orint(is_staff)notin[True,False],lambdais_staff,*args:"is_staff must be 0 or 1.",)))The sample project has an example of this and other customizations.Demohttps://user-images.githubusercontent.com/12461302/133109664-3f2a223d-cc8c-4085-965a-c04e48065d72.mov
Package: django-bullion
Django Bullion - PRE-ALPHAAn agnostic package for working with Billing, Invoicing, and Payment Processing APIsFree software: MIT licenseDocumentation:https://django-bullion.readthedocs.io.BackgroundWhile there are several projects for working with payment gateways, and some for creating invoices, no project me our needs for working with payment gateway APIs what provide invoicing, billing, and payment processing.FeaturesTODO:Implement APIs:QuickbooksBluePayWaveOthers to consider:ForteFusebillPayscapeCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-07-16)First release on PyPI.
Package: django-bulma
A Bulma Theme for Django ProjectsA Django base theme based on Bulma (bulma.io). Bulma is a modern CSS framework based on Flexbox.*** work in progress ***InstallationInstall the python package django-bulma from pippip install django-bulmaAlternatively, you can install download or clone this repo and callpip install -e ..Add to INSTALLED_APPS in yoursettings.py:'bulma',If you want to use the provided base template, extend frombulma/base.html:{% extends 'bulma/base.html' %}

{% block title %}Bulma Site{% endblock %}

{% block content %}
  Content goes here...
{% endblock content %}If you want to customize bulma sass and your own components:4.1 Copy bulma static files into your project'sSTATIC_ROOT:python manage.py copy_bulma_static_into_projectYou should seebulmadir appeared in yourSTATIC_ROOT. It contains
two dirs:sass- this is the place where you can put your own sass code and customize
bulma variablescss- this is where compiled sass output goes, you should link this file
in your base.html4.2 Install npm packages for sass compilation to work:python manage.py bulma install4.3 Start sass watch mode:python manage.py bulma startFor forms, in your templates, load thebulma_tagslibrary and use the|bulmafilters:Example template{%loadbulma_tags%}{# Display a form #}<form action="/url/to/submit/" method="post">{%csrf_token%}{{form|bulma}}<div class="field"><button type="submit" class="button is-primary">Login</button></div><input type="hidden" name="next" value="{{next}}"/></form>Included templatesdjango-bulmacomes with:a base template,django core registration templates,Bugs and suggestionsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/timonweb/django-bulma/issues
Package: django-bulmacss
django-bulmacss：快速搭建 Django 应用程序的必备工具django-bulmacss是一个基于Bulma CSS的常用 HTML 模板库，为 Django 开发者提供了快速搭建 Django 应用程序的解决方案。django-bulmacss提供了以下功能：基于 Bulma CSS 的常用 HTML 模板，包括表单、导航栏、页脚、消息、模态框等。开箱即用的 Django 扩展模板，如 Django-allauth、Django-filters、Django.contrib.flatpages 等。允许您通过 Bulma CSS 的官方方式来自定义 CSS，比如通过 node-sass 来自定义 CSS 主题颜色等。ScreenshotsQuick StartInstall Packagepip install django-bulmacss修改settings.pyINSTALLED_APPS = [
    'bulma',
    ...
]

FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'ExtraFeather IconsSimply beautiful open source iconshttps://feathericons.com/JdenticonOpen source library for generating identicons.https://jdenticon.com/
Package: django-bundledmedia
django-bundledmedia===================``django-bundledmedia`` is a Django application for adding compressed CSS andJS files in some prepared slots.This functionality was splitted out of Merengue CMS.Installing----------* Install package from pypi::$ easy_install django-bundledmedia* Include ``bundledmedia`` in the ``INSTALLED_APPS`` setting.* Include ``bundledmedia.middleware.BundledMediaMiddleware`` in the ``MIDDLEWARE_CLASSES`` setting.Usage-----In your base template (i.e. ``base.html``)::{% load bundledmedia %}<html><head>{# placeholder to allow plugins and other templates to add css assets #}{% bundledmedia "css" "css" %}...{% bundledmedia "extracss" "css" %}</head><body>...{# placeholder to allow plugins and other templates to add javascript assets #}{% bundledmedia "js" "js" %}</body></html>In your included template (i.e. ``inc.sidebar.html``)::{% load bundledmedia %}{% addmedia "css" %}<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/sidebar.css"/>{% endaddmedia %}{% addmedia "js" %}<script language="javascript" src="{{ MEDIA_URL }}js/jquery.sidebar.js"></script>{% endaddmedia %}...In your specific template (i.e. ``myview.html``)::{% load bundledmedia %}{% addmedia "extracss" %}<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/myview.css"/>{% endaddmedia %}...This code will render all chunks of code of all the included templates in theplaceholders above.Compression-----------``django-bundledmedia`` uses ``django-compressor`` to render compressed CSS andJS when the ``COMPRESS`` setting is set to ``True``0.1b3----* Backward incompatible improvement: using new ``media_type`` parameter to get a more explicit type definition (JS or CSS).0.1b2----* Not generating compressed JS or CSS if there is no content to compress.0.1b1----* More flexible naming conventions in the bundled blocks.0.1a----* Initial version.
Package: django-bundles
# django_bundles: Another Django media bundlerdjango_bundles is a media bundler for Django. It can be used to bundle groups of media files (e.g. CSS, JavaScript) into a single file with a hash in the filename (to play nicely with browser caching) whilst keeping the files separate during development.There are ideas taken from a lot of the other media bundlers - none of them worked quite how I wanted and I fancied writing my own.I think Django 1.4 is required, but possibly only because of the assignment tag decorator used.IMPORTANT NOTE: 0.3.0 is not backwards compatible with 0.2.5## Features* Pre and post processing of files (e.g. LessCSS, UglifyJS) - really easy to add others* Could be used with script loaders either using the template tags for inline scripts or a DjangoTemplateProcessor to preprocess a JavaScript file* Management command to bundle media* Management command to lint files (e.g. using JSLint/JSHint)* Flexible API that doesn't force you to work in a certain way## UsageThe main settings are `USE_BUNDLES` which is True/False to enable/disable bundling in the template (defaults to `not settings.DEBUG`), `BUNDLES_VERSION_FILE` which is where versions are stored (in a python file) and `BUNDLES` which looks like:```pythonBUNDLES = (('master_css', {'type': 'css','files': ('css/*.css','css/more/test3.css','less/test.less',),}),('master_js', {'type': 'js','files': ('js/*.js',)}),('script_loader_example', {'type': 'js','files': ('script_loader_example.js',),'processors': ('django_bundles.processors.django_template.DjangoTemplateProcessor',)}),)```All of the `BUNDLES` options can be found in django_bundles/core.py on the `Bundle` and `BundleFile` classes.The `{% render_bundle bundle_name %}` template tag can then be used to render the HTML (e.g. script or link tag) in place. django_bundles/templates needs to be in your template directories list (or copy them in).Other settings are (check out django_bundles/conf/default_settings.py):* `DEFAULT_PREPROCESSORS` - dict of file type to list of processors (default is LessCSS for .less files)* `DEFAULT_POSTPROCESSORS` - dict of bundle type to list of processors (default is UglifyJS for .js bundles)## LintingIf you define a `BUNDLES_LINTING` setting you can use the `lint_bundles` management command to lint your files. e.g.```pythonBUNDLES_LINTING = {'js': {'command': '/path/to/jslint/bin/jslint.js {infile}','default': True,},}```It currently expects output like JSLint.## Things it doesn't do* JavaScript tags are rendered in place in the template - there's no deferring them to the bottom of the page automatically* Files aren't passed through preprocessors before being rendered in development mode - for LessCSS you have to include the LessCSS script tag (wrapped in `{% if not settings.USE_BUNDLES %}` so you don't use it in production)## staticfilesI think it should be pretty simple to use this with staticfiles with clever use of `files_url_root`, `files_root`, `bundle_url_root` and `bundle_file_root` as long as `collectstatic` management command is run before `create_bundles` in the deployment process.
Package: django-bunny
django-bunnyA bunny.net storage for Django. It was created as a replacement fordjango-bunny-storage.InstallationYou can install the library usingpip:pipinstalldjango-bunnyConfigurationFirst, adddjango_bunnyto yourINSTALLED_APPS:INSTALLED_APPS=[...,"django_bunny",...]Now, create the following variables inside yoursettings.pyfile. These are required if you are using Django <4.2. Otherwise, you can useOPTIONSin theSTORAGESsetting.# These can be found in your storage's dashboard under `FTP & API Access`BUNNY_USERNAME="my-storage-name"BUNNY_PASSWORD="my-storage-password"# This is the storage region's code. E.g. Los Angeles is `la`, Singapore is# `sg`, etc. The default is `ny` (New York).BUNNY_REGION="my-storage-region"# Optional. For example, `https://myzone.b-cdn.net/`. `MEDIA_URL` will be used# if this is not set.BUNNY_HOSTNAME="my-pullzone-hostname"# Optional. For example, `static/`. If not set, files will be stored in the# storage's root dir.BUNNY_BASE_DIR="my-storage-base-dir-where-i-want-my-files-stored/"Finally, depending on which version of Django you are using you'll need to create one of these variables:# Django < 4.2DEFAULT_FILE_STORAGE='django_bunny.storage.BunnyStorage'# Django >= 4.2. Set `BunnyStorage` where you want to use bunny.net's storage.{"default":{"BACKEND":"django_bunny.storage.BunnyStorage",# Add this if you did not create the BUNNY_* settings before. They are# the same as BUNNY_* variables."OPTIONS":{"username":"my-storage-name","password":"my-storage-password",# Optional. Defaults to `ny`"region":"my-storage-region",# Optional. `MEDIA_URL` will be used if it is not set"hostname":"my-pullzone-hostname",# Optional. `BUNNY_BASE_DIR` will be used if it is not set."base_dir":"my-storage-base-dir-where-i-want-my-files-stored/"}},}In Django >= 4.2 you can set different credentials for the different storages. This allows you to, for example, use a separate storage for static files.Using in templatesIn templates, you can use{{ instance.file.url }}directly. For example:<imgsrc="{{ instance.file.url }}"/>
Package: django-bunny-storage
django-bunny-storageProvides Bunny.net file storage in Django.Installationdjango-bunny-storagerequires Python >= 3.7.pipinstalldjango-bunny-storageConfigurationEverything is configured in yoursettings.pyfile.To use:Adddjango_bunny_storageto yourINSTALLED_APPS.INSTALLED_APPS=[...'django_bunny_storage']AddBUNNY_USERNAMEandBUNNY_PASSWORDto your settings.BUNNY_USERNAME='myzone'BUNNY_PASSWORD='myzone-random-password-string'# OptionalBUNNY_REGION='de'These settings correspond to your storage zone'sUsernameandPasswordfound under FTP & API Access in your Bunny.net Storage dashboard.You must includeBUNNY_REGIONif the default region,NY, does not match the region you set yourself.Change your media url and default file storage backend.DEFAULT_FILE_STORAGE='django_bunny_storage.storage.BunnyStorage'MEDIA_URL='https://myzone.b-cdn.net/'# The Pull Zone hostname.TheMEDIA_URLis set based on a linked Pull Zone that you setup in the Bunny.net dashboard.In TemplatesIn order to display your media properly in templates, refer to Django'sdocs on the MEDIA_URL attributeto ensure you're not getting 404s when trying to load media.Whenever referencing media, do<imgsrc="{{ MEDIA_URL }}{{ mymodel.file }}"/>