Saravanan666/pypi-org huggingface dataset:
Package: django-dynamic-resource-admin
django-dynamic-resource-adminAdd dynamic css & js resources to django's admin site.Installpipinstalldjango-dynamic-resource-adminUsageNote:We use template override mechanism, so you MUST add app name django_dynamic_resource_admin into INSTALLED_APPS.The parameter request pass to get_css&get_js is the request of this view.The parameters **kwargs pass to get_css&get_js are the paramters of admin view prameters.Every extra js part is wrappered with closure function, so that they will be NO local variables conflict. If you want to add a global variable, name it like:window.xxx = 123;.;(function(){...yourjscode...})();pro/settings.pyINSTALLED_APPS=[...'django_dynamic_resource_admin',...]app/admin.pyfromdjango.contribimportadminfromdjango_dynamic_resource_admin.adminimportDjangoDynamicResourceAdminfrom.modelsimportBookclassBookAdmin(DjangoDynamicResourceAdmin,admin.ModelAdmin):defget_css(self,request,**kwargs):csses=super().get_css(request)csses+=["""body{background-color: red;}""",]returncssesadmin.site.register(Book,BookAdmin)How to add your custom css&js?Override get_css to add extra css.Override get_js to add extra js.defget_css(self,request,**kwargs):extra_css=super().get_css(request,**kwargs)extra_css+=["""body{xxx}""",""".title{xxx}"""]returnextra_cssdefget_js(self,request,**kwargs):extra_js=super().get_js(request,**kwargs):extra_js+=["""window.msg="hello world";""","""...""",]returnextra_jsReleasev0.1.1 2020/09/25Fix js code wrapper from<style></style>to<script type="text/javascript"></script>.Add license file.v0.1.0 2020/03/13First realse.
Package: django-dynamic-rest
Django Dynamic RESTDynamic API extensions for Django REST FrameworkSeehttp://dynamic-rest.readthedocs.orgfor full documentation.OverviewDjango Dynamic REST (or DDREST) extends the popularDjango REST
Framework(or DRF) with API
features that empower simple RESTful APIs with the flexibility of a
graph query language.DDREST classes can be used as a drop-in replacement for DRF classes,
which offer the following features on top of the standard DRF kit:Linked relationshipsSideloaded relationshipsEmbedded relationshipsField inclusionsField exclusionsField-based filteringField-based sortingDirectory panel for your Browsable APIOptimizationsDDREST is the continuation ofdynamic-rest <https://github.com/AltSchool/dynamic-rest>written byAltSchool <https://github.com/AltSchoolwhich meant to complementEmber
Data, but it can be used to provide
fast and flexible CRUD operations to any consumer that supports JSON
over HTTP.MaintainersErnesto GonzálezRequirementsPython (3.6, 3.7, 3.8)Django (2.0, 2.1, 2.2, 3.1, 3.2)Django REST Framework (3.8, 3.9, 3.10, 3.11, 3.12)
Package: django-dynamic-rules
Sometimes when you develop apps for other people, they like todefine their own sets of "rules".For example, one customer might say the value of a certain field ona model might be valid when it is between 100 and 1000. Another customermight consider the same field valid only when the value is between500 and 1000.That kind of validation is extremely difficult to do in a modelform'sclean method like you would if you knew beforehand what the valid valueswere supposed to be.This app lets you create some boundaries for various arbitrary parametersthat are tied to some other arbitrary model. Each customer can then definewhat the rule parameters will be for their particular organization.Usage:First create a file called dynamic_actions.Inside dynamic actions, you must register your rule classwith the dynamic_rules site.The rule class must have the following attributes:key: a string to identify the rule class with the registrydisplay_name: a name to use for the admin_form to show a readable namefields: a dictionary of field_names, and django form classes. This declaresthe parameters available.The following optional attribute is available:category: a grouping used as the header of an option group in the Key dropdownin the admin to make it easier to organize rules.If a category is not provided, the rule defaults to "uncategorized'.Additionally, the rule class must accept a rule_model and model_to_checkas initialization arguments, and have a run method that accepts*args and **kwargs.To see the dynamic rules in action, syncdb from this project and fireup the admin. Create a rule tied to group_object_id: 1 (i.e. customer 1)and content type: 'customer'Add a ModelToCheck model from the sample app that has a value thatviolates your rule. Check the runserver console and see that theviolation printed.This is best used in conjunction with django-dynamic-validation which lets youtrack and store violations to the rules, or django-dynamic-manipulationwhich lets you manipulate other data because of a triggered rule.- http://pypi.python.org/pypi/django-dynamic-validation- http://pypi.python.org/pypi/django-dynamic-manipulationRecent Updates--------------1/24/2012Updated dynamic_rules to use latest version of django-class-registry (0.0.3)which handles the registry like a dictionary.'dynamic_rules.site' should now be referred to as 'dynamic_rule.rule_registry'however, you can access 'site' for a while. We just believe 'rule_registry'is a much better name.
Package: django-dynamic-scraper
# django-dynamic-scraperDjango Dynamic Scraper (DDS) is an app for Django which builds on top of the scraping framework Scrapy and lets
you create and manage Scrapy spiders via the Django admin interface. It was originally developed for german
webtv program sitehttp://fernsehsuche.de.## DocumentationRead more about DDS in the ReadTheDocs documentation:http://django-dynamic-scraper.readthedocs.org/## Getting Help/UpdatesThere is a mailing list on Google Groups, feel free to ask questions or make suggestions:https://groups.google.com/group/django-dynamic-scraperInfos about new releases and updates on Twitter:https://twitter.com/#!/dynamicscraper
Package: django-dynamicsettings
django-dynamicsettingsDjango app to allow (chosen) settings to be configurable through django admin (or anything that updates the Settings model).UsageIn yoursettings.py(or whatever DJANGO_SETTINGS_MODULE you are using), simply change:MIGHTY_SETTING='boring_setting_requires_deploy'tofromdynamicsettingsimportDynamicSettingasDYNMIGHTY_SETTING=DYN('boring_setting_requires_deploy')And done.MIGHT_SETTINGvalue can now be changed usingdynsetting.Settingmodel (registered in django-admin).DynamicSettingclass caches the values from database as, quite often, the settings are accessed many times in the same loop.There isCACHE_TTLsetting to control it (default being1second).To change it simply putfromdynamicsettingsimportDynamicSettingasDYNDYN.CACHE_TTL=30in that same settings module.0disables cache entirely (not recommended).Alternativeshttps://django-dynamic-preferences.readthedocs.io/en/latest/seems like a popular solution to this problem but it solves it differently.You need to register the settings with those decorators while withdynamicsettingsyou just add an helper to your usual settings.py definition and everythingshouldseamlessly works!
Package: django-dynamic-shields
django-dynamic-shields📚 OverviewShields.iois one of the great inventions in human history. Everyone has collected badges and stickers as a child. In other words, it is one of the fundamental human needs to stick a badge.With django-dynamic-badge, the display can be changed dynamically using information from a server built withDjango.For example, create a badge with the number of active users today, the number of times the function has been used, and the results of the server health check.💾 InstallPublished onPyPI. It can be installed with the following command.pipinstalldjango-dynamic-shieldsAlternatively, you can download and install the .whl file from therelease.🎮 Usage⚒️ Develop📝 LicenseMIT License
Package: django-dynamic-sites
A django application, which implements a flexible and generic viewsystem providing a convenient way to handle
staticpages, model based pages and much more.SO big question: What exactly does it for you?TLDR:dynamic_sites in its core is a combination of a site model representing each page
and a set of generic views which in conjunction with django-sitetree create a powerful
and yet simple system to create and manage static pages and model dependent/displaying pages.Long Answer:The core of the app is twofold.
On the one side you have the site model of which the instances represent each page
on your website. For each instance you can specify where in your sitetree it is placed
which name it should have (for each language of your website), which template you
you want to be displayed, if so which picture should be displayed in the background,
which rights are needed to access this page and a couple other things.
Most importantly, if wished for, which model instances of the models you registered
to the collecting signal (more on this in the usage part) you would like to be displayed
or edited, printed and so one, on this page. All of this is handled via the admin
interface without any active coding on your site.
Now to the second part. How does all this fancy stuff work so easy.
The core functionality comes from a small number of generic views. Detailed description
of each view are found in the respective chapter. These views serve the not only
the site object you accessed via the url, but also serve the specified model and
the necessary templates to handle it. Depending on the title you gave the site on its creation
it can also handle creation, editing, print-to-pdf, or deletion of objects from the given model.The core point is here you have a ton of basic functionality for each of your custom
models independent of which fields, capabilities or complexity it has. In addition
you can still add custom pages with your own views as long as you specify the url
pattern above the dynamic_sites.urls include (more in Installation and Usage).The full Documentation can be foundhereFree software: MIT licenseNeeded DependenciesThe package is based on thedjango-sitetreepackage which handles the tree structure, access permissions and menu generation.For the translation capabilitiesdjango-modeltranslationis used.django-bleachis used for cleaning textfields.Optional Dependenciesdjango-weasyprintfor printing to pdf via the ContentDownloadView.Changelog1.0.0 (2021-02-25)First release on PyPI.1.0.1 (2021-03-18)Added a ton of documentation.1.1.0 (2021-03-25)Addednew‘private objects’ feature.Added more documentation.
Package: django-dynamicsites-lite
Expands the standard django.contrib.sites package to allow for:Sites identified dynamically from the request via middleware
No need for multiple virtual hosts at the webserver level
301 Redirects to canonical hostnames
A site may have its own urls.py and templates
A single site may accept requests from multiple hostnames
Allows for environment hostname mappings to use non-production hostnames (for use in dev, staging, test, etc. environments)
Package: django-dynamic-sprites
Create sprites dynamicaly for Python and Django.Version 0.1.3InstalationInstall the package viapip:pip install django-dynamic-spritesGenerating sprite for images in a folderOne way to generate sprites is from all pictures within a folder. To do so, type this command:generate_sprites.py path/to/folder path/to/outputOne thing to notice is that you don’t pass the output extension. The script already generates the image with.pngand the CSS with.css.Generating sprite from Python codeWithin your python code you can generate sprites for a given set of images. All you have to do is provide the images paths, a nome to each image, generate the sprite and save it:from dynamic_sprites.sprite import Sprite

images = (
    ('brazil', '/path/to/brazil/image.png'),
    ('usa', '/path/to/usa/image.png'),
)

sprite = Sprite('sprite_name', images)

output_image = sprite.generate()
output_image.save('/path/to/output/image.png')

output_css = sprite.generate_css('http://images.com/output/image.png')
output_css.save('/path/to/output/style.css')That’s the basics for generating a sprite from Python code. But there is some abstractions integrating it with Django. Even the name of the project having Django on it, the sprites can be generated without using Django.Generating sprites for Django queryset objectsLet’s pretend you have a Django model like this:from django.db import models

class Country(models.Model):
    name = models.CharField(max_length=255)
    slug = models.SlugField()
    flag = models.ImageField(upload_to='countries')And you want to have a sprite with all the country flags. You can generate it using aSpritespecialization:from dynamic_sprites.model_sprite import ModelSprite

sprite = ModelSprite('country-flags', queryset=Country.objects.all(), image_field='flag', slug_field='slug')

output_image = sprite.generate()
output_image.save('/path/to/output/image.png')

output_css = sprite.generate_css('http://images.com/output/image.png')
output_css.save('/path/to/output/style.css')You can also connect the sprite generation to the post_save listener and have your sprite generated again each time an object in your queryset is saved:from django.db.models.signals import post_save
from dynamic_sprites.listeners import ModelSpriteListener

listener = ModelSpriteListener('country-flags', image_field='flag', slug_field='slug', queryset=Country.objects.all())

post_save.connect(listener, sender=Country)Contributing to the projectThis project is open source, contributions are welcome.
Package: django-dynamic-storage
django-dynamic-storageHave you ever wanted not to store every instance of FileFileds or ImageFileds of a model in one storage or one bucket of a storage?Now you can, because I wanted that formy project.prerequisites:If your django version is earlier than 3.1 (<=3.0) then your database should be PostgreSQL otherwise you are good to go.Usage:pip install django-dynamic-storagein storage.py:fromdynamic_storage.storageimportDynamicStorageMixin@deconstructibleclassMyDynamicStorage(DynamicStorageMixin,AnyStorage):definit_params(self)->dict:"""here you should return a dictionary of key value pairs thatlater django-dynamic-storage could instantiate this class with"""return{"named_param1":self.named_param1,"named_param2":self.named_param2,...}AnyStoragecan be a storage that you define yourself or import fromdjango-storages.in models.py:fromdynamic_storage.modelsimportDynamicFileField,DynamicImageFieldclassMyModel(models.Model):"""DynamicFileField and DynamicImageField accept any options that django's native FileField and ImageField accept"""file=DynamicFileField()image=DynamicWagtailImageField()Now your logic to take control of the storage where your content is going to be saved to:obj=MyModel(file=file,image=image)obj.file.destination_storage=MyDynamicStorage(named_param1="something",named_param2="another_thing")obj.image.destination_storage=MyDynamicStorage(named_param1="foo",named_param2="bar")obj.save()or usingsignals:(new to signals? learn how toconnect them)fromdynamic_storage.signalsimportpre_dynamic_file_save@receiver(pre_dynamic_file_save,sender=models.MyModel)defdecide_the_storage_to_save(instance,field_file,to_storage,*args,**kwargs):ifnotto_storage:# destination_storage is not set, so we set it herefield_file.destination_storage=MyDynamicStorage(named_param1="something",named_param2="another_thing")elifto_storage==wrong_storage:# override the destination_storage set earlierfield_file.destination_storage=MyAnotherDynamicStorage(named_param1="foo",named_param2="bar")Performance penalty?!Not even a bit!HOW?We are just using the django's built inJsonFieldinstead ofCharFieldto store more data (init_params output) in addition to the path to the file.so no extra queries, no extra steps, no performance penalty.
Package: django-dynamic-views
=============================django-dynamic-views=============================.. image:: https://badge.fury.io/py/django-dynamic-views.png:target: https://badge.fury.io/py/django-dynamic-views.. image:: https://travis-ci.org/ddaan/django-dynamic-views.png?branch=master:target: https://travis-ci.org/ddaan/django-dynamic-viewsProvides out of the box CRUD functionality including templates and gives you the ability to build your screen top-down.Documentation-------------The full documentation is at https://django-dynamic-views.readthedocs.org.Quickstart----------Install django-dynamic-views::pip install django-dynamic-viewsThen use it in a project::from django_dynamic_views.views import DynamicListView, DynamicCRUDView, DynamicUpdateView, DynamicCreateViewAdd django-dynamic-views to installed apps::INSTALLED_APPS = (...'django_dynamic_views',...)Example=====================Consider this simple model:models.py::class Article(models.Model):name = models.Charfield(max_length=200)description = models.Charfield(max_length=200)Define a Crud view by extending DynamicCRUDView and set the model as a attributeviews.py::class ArticleCRUDView(DynamicCRUDView):model = ArticleNow add the urls to your urlpatterns with one commandurls.py::urlpatterns += ArticleCRUDView.urls()You'll point your browser to /article/list/ and a basic list with Create / Read / Update and Deletebuttons will be displayed.So on the background it will create the following urls::/article/list//article/create//article/(?P<pk>[-\w]+)/update//article/(?P<pk>[-\w]+)/read//article/(?P<pk>[-\w]+)/delete/If you don't care for some of the urls you can modfiy the _links_ atribute on the CrudView::class ArticleCRUDView(dynamicviews.DynamicCRUDView):model = Articlelinks = ['list', 'read']This will result in the following urls::/article/list//article/(?P<pk>[-\w]+)/read/So this will give you a basic list with a Read button next to it.## Override the default classesYou can define which class the CRUD uses, so you can easily modify it's appearance and behaviour::class ArticleDetailView(DetailView):template_name = 'articles/article_detail.html'class ArticleCRUDView(dynamicviews.DynamicCRUDView):model = Articlelinks = ['list', 'read']read_class = ArticleDetailRunning Tests--------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install -r requirements-test.txt(myenv) $ python runtests.pyCredits---------Tools used in rendering this package:*  Cookiecutter_*  cookiecutter-pypackage_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _cookiecutter-djangopackage: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.1.0 (2016-04-09)++++++++++++++++++* First release on PyPI.
Package: django-dynamite
This package provides a module to create dynamic models in django and use it in view and admin interface.
Thx toWill Hardyfor this fantastic paperRuntime Dynamic Models DocumentationInstallationQuick StartLicenseDocumentationInstallationClone and install:git clone git://github.com/z4r/django-dynamite.git
cd django-dynamite
python setup.py installUsing pip:$ pip install django-dynamiteQuick StartTake a look toexampleproject, try it and enjoy:cd example
python manage.py test
python manage.py syncdb
python manage.py runserverLicenseThis software is licensed under theApache License 2.0. See theLICENSEfile in the top distribution directory for the full license text.DocumentationYou can generate your own local copy usingSphinxtrough the setup.py:$ python setup.py build_sphinxOr simply clickDynamite Documentation
Package: django-dynamo
Dynamo let users and admins create and mantain their DjangoDYNAmicMOdels dynamically at runtime.
For details on setup and usage, please read thedocumentationon Readthedocs.Why would you need a dynamic model?Dynamic models are beneficial for applications that need data structures, which are only known at runtime, but not when the application is coded. Or when existing models need to be extended at runtime by additional fields. Typical use cases are:CMS:In content management systems, users often need to maintain content that is unique for their specific website. The required data structures to store and maintain this content is therefore not known to the developers beforehand.Web Shop:The owner of a web shop has highly customized products, with very special product attributes. The shop developers want the web shop owner to define these attributes herself.Survey:If you have an application to create and maintain online surveys, you do neither know the questions nor the possible answers at runtime, but let your users define these, as they implement their surveys.Dynamo supports the three of these use cases - and many more!How does Dynamo work?Dynamo lets you define the meta data for your models their fields. This metadata definition is stored in “real” Django models. The defined model is then created at runtime. And of course, you can also modify the models later on, e.g. adding, renaming or deleting fields; or changing model attributes. It will also automatically manage your admin and app cache for the dynamic models. The meta data maintenance can be done via the Django Admin or via the provided API.What else is there?There are various approaches and implemenations available for Django developers:The most straight forward approach is to use the Django internals and its DB API to create and maintain models at runtime. Numerous authors have elaborated this option in theDjango Wiki. Michael Hall has created anappfollowing this approach; he has also called in dynamo, I hope this does not cause too much confusion.Entity-Attribute-Value/EAVModel is the traditioal computer science approach to tackle this kind of problem, and there are also django implementations for that available likedjango-eavoreav-django.Finally, Will Hardy has introduced aSouth-based concept, that he has presented and discussed at theDjangoCon Europe 2011. Following this concept, he has implementeddynamic-modelsThe South based approach seems to be the cleanest and clearly follows the DRY approach: all database handling, maintenance and transactions are left to the excellent South API.Who else gets credits for Dynamo?Dynamo is inspired by the excellent work of Will Hardy’sdynamic-modelsand thisDjango Wiki Article. It also re-uses parts of their concepts and coding.
Furthermore, South is used to maintain the Dyanmo related database objects.Under which license is Dynamo available?Dynamo is available under theBSD license.How do I get suport?The onlinedocumentationon ReadtheDocs is a great place to start. If you have any further questions, issues or would like to contribute, please let us know at theDynamo Google Group