Saravanan666/pypi-org huggingface dataset:
Package: django-fields-history
django-fields-historyA Django app that track history changes in model fields.Important note: currently only one implementation ofFieldsHistoryis supported and it's withdjango.contrib.postgres.fields.JSONFieldwhich isJSONBunder the hood. So onlypostgresqlas database is supportedSimilar projects:django-reversiondjango-simple-historydjango-field-historyMain difference that those libraries keep track of changes, and this library
tracks the history change.Simple explanation:fromfield_history.trackersimportFieldsHistoryTrackerclassSimpleModel(models.Model):field=models.CharField(max_length=50)field_history=FieldsHistoryTracker(fields=['field'])obj=SimpleModel.objects.create(field='value')assertnotobj.get_field_history()obj.field="new_value"obj.save()assertobj.get_field_history()assertobj.get_field_history()[0].value=="value"QuickStartInstalldjango-fields-history:pipinstalldjango-fields-historyAddfields_history.postgrestoINSTALLED_APPS(currently only
postgres implementation is supported):INSTALLED_APPS=[# rest of apps"fields_history.postgres",]And add trackers to your models and specify fields to track:fromfield_history.trackersimportFieldsHistoryTrackerclassYourModel(models.Model):...history_tracker=FieldsHistoryTracker(fields=["field1","field2"])And you are done.ImplementationEvery change of your fields field changes be tracked infields_history.models.FieldsHistoryin:fields_history.postgres-JSONBpostgres fieldOne object per save if tracked fields has been changed.CreditsBasically this project is implemented based ondjango-field-historywhich itself useddjango-model-utils.
Package: django-fieldsignals
Introductiondjango-fieldsignals simply makes it easy to tell when the fields on your model have changed.Often model updates are quite expensive. Sometimes the expensive operations
are very rare. This makes it tempting to put the update logic in a view,
rather than in a save() method or in a signal receiver:# A bad example. Don't do this!defedit_poll(request,poll_id):# ...ifform.cleaned_data['poll_name']!=poll.name:poll.update_slug(form.cleaned_data['poll_name'])poll.save()That's a bad idea, because your model consistency is now dependent on your view.Instead, use django-fieldsignals:fromfieldsignalsimportpre_save_changeddefupdate_poll_slug(sender,instance,**kwargs):instance.slug=slugify(instance.name)pre_save_changed.connect(update_poll_slug,sender=Poll,fields=['name'])In case you want to know what changed, django-fieldsignals even tells you the old and
new values of your fields:fromfieldsignalsimportpre_save_changeddefprint_all_field_changes(sender,instance,changed_fields,**kwargs):forfield,(old,new)inchanged_fields.items():print(f'{field.name}changed from{old}to{new}')pre_save_changed.connect(print_all_field_changes,sender=Poll)InstallationThis library is on PyPI so you can install it with:pipinstalldjango-fieldsignalsor from github:pipinstall'git+https://github.com/craigds/django-fieldsignals.git#egg=django-fieldsignals'Add"fieldsignals"to yourINSTALLED_APPSsetting like this:INSTALLED_APPS=(...'fieldsignals',)Add some signals!Where should my signals code live?Field signals must be connected after the django apps are ready.
So putting signal connectors at the bottom of your models file, or other random places won't work.The best place to connect fieldsignals is anAppConfig.ready()handler.NotesCurrently no support forManyToManyFieldor reverse side ofForeignKey(one to many).
Package: django-field-translate
=====Field Translate=====Field TranslateQuick start-----------1. Add "location" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'field_translate',]2. Example usage::to cansado.3. Start the development server and visit http://127.0.0.1:8000/admin/to visit the example form (you'll need the Admin app enabled).
Package: django-filebrowser
Media-Management with Grappelli.The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.include images/documents to your models/database using theFileBrowseField.select images/documents with TinyMCE.RequirementsFileBrowser 4.0.3 requiresDjango 4.0 (http://www.djangoproject.com)Grappelli 3.0 (https://github.com/sehmaschine/django-grappelli)Pillow (https://github.com/python-imaging/Pillow)Documentationhttp://readthedocs.org/docs/django-filebrowser/Translationhttps://www.transifex.com/projects/p/django-filebrowser/ReleasesFileBrowser 4.0.3 (July 27th, 2023): Compatible with Django 4.0FileBrowser 3.14.3 (January 12th, 2022): Compatible with Django 3.2 (LTS)Current development branches:FileBrowser 4.0.4 (Development Version for Django 4.0, see Branch Stable/4.0.x)FileBrowser 3.14.4 (Development Version for Django 3.2, see Branch Stable/3.14.x)Older versions are available at GitHub, but are not supported anymore.
Package: django-filebrowser-no-grappelli
Media-Management. (based onhttps://github.com/sehmaschine/django-filebrowser)The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.include images/documents to your models/database using theFileBrowseField.select images/documents with TinyMCE.RequirementsFileBrowser 4.0 requiresDjango 2/3/4 (http://www.djangoproject.com)Pillow (https://github.com/python-imaging/Pillow)No GrappelliThis fork removes the dependency on Grappelli.InstallationLatest version:pip install -e git+git://github.com/smacker/django-filebrowser-no-grappelli.git#egg=django-filebrowserStable version:pip install django-filebrowser-no-grappelliDocumentationhttp://readthedocs.org/docs/django-filebrowser/It also has fake model to show filebrowser in admin dashboard, but you can disable it by settingFILEBROWSER_SHOW_IN_DASHBOARD = False.Translationhttps://www.transifex.com/projects/p/django-filebrowser/ReleasesFileBrowser 4.0.2 (July 18th, 2023): Compatible with Django 3/4FileBrowser 3.8.0 (November 4th, 2019): Compatible with Django 1.11/2.0/2.1/2.2/3.0FileBrowser 3.7.9 (November 3rd, 2019): Compatible with Django 1.8/1.9/1.10/1.11/2.0/2.1/2.2FileBrowser 3.6.2 (March 7th, 2016): Compatible with Django 1.4/1.5/1.6/1.7/1.8/1.9Older versions are available at GitHub, but are not supported anymore.
Package: django-filebrowser-no-grappelli2
Media-Management. (based onhttps://github.com/sehmaschine/django-filebrowser)The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.include images/documents to your models/database using theFileBrowseField.select images/documents with TinyMCE.The only difference by now to the original smacker/django-filebrowser-no-grappelli
is the additional Azure storage class.RequirementsFileBrowser 4.0 requiresDjango 2/3/4 (http://www.djangoproject.com)Pillow (https://github.com/python-imaging/Pillow)No GrappelliThis fork removes the dependency on Grappelli.InstallationLatest version:pip install -e git+git://github.com/christianwgd/django-filebrowser-no-grappelli.git#egg=django-filebrowser-no-grappelliStable version:pip install django-filebrowser-no-grappelli2Documentationhttp://readthedocs.org/docs/django-filebrowser/It also has fake model to show filebrowser in admin dashboard, but you can disable it by settingFILEBROWSER_SHOW_IN_DASHBOARD = False.Translationhttps://www.transifex.com/projects/p/django-filebrowser/ReleasesFileBrowser 4.0.1 (March 2nd, 2022): Compatible with Django 3/4, merge back smacker/masterFileBrowser 3.8.0 (November 4th, 2019): Compatible with Django 1.11/2.0/2.1/2.2/3.0FileBrowser 3.7.9 (November 3rd, 2019): Compatible with Django 1.8/1.9/1.10/1.11/2.0/2.1/2.2FileBrowser 3.6.2 (March 7th, 2016): Compatible with Django 1.4/1.5/1.6/1.7/1.8/1.9Older versions are available at GitHub, but are not supported anymore.
Package: django-filebrowser-no-grappelli-emencia
Media-Management. (based onhttps://github.com/sehmaschine/django-filebrowser)Yet another “django-filebrowser” fork to release an updatedPypi packagewith a current version.The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.include images/documents to your models/database using theFileBrowseField.select images/documents with TinyMCE.RequirementsFileBrowser 3.5 requiresDjango 1.4 or 1.5 or 1.6 (http://www.djangoproject.com)Pillow (https://github.com/python-imaging/Pillow)No GrappelliThis fork removes the dependency on Grappelli.Installationpip install -e git+git://github.com/smacker/django-filebrowser-no-grappelli.git#egg=django-filebrowserDocumentationhttp://readthedocs.org/docs/django-filebrowser/Translationhttps://www.transifex.com/projects/p/django-filebrowser/ReleasesFileBrowser 3.5.7 (Development Version, not yet released, see Branch Stable/3.5.x)FileBrowser 3.5.6 (April 16th, 2014): Compatible with Django 1.4/1.5/1.6Older versions are availabe at GitHub, but are not supported anymore.
Package: django-filebrowser-no-grappelli-no-pillow
Media-Managementbased onhttps://github.com/sehmaschine/django-filebrowserandhttps://github.com/smacker/django-filebrowser-no-grappelli.The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.RequirementsFileBrowser 3.8 requiresDjango 1.11/2.2/3.0 (http://www.djangoproject.com)No Grappelli No PillowThis fork removes the dependency on Grappelli and Pillow (no image processing).InstallationStable version:pip install django-filebrowser-no-grappelli-no-pillowDocumentationhttp://readthedocs.org/docs/django-filebrowser/It also has fake model to show filebrowser in admin dashboard, but you can disable it by settingFILEBROWSER_SHOW_IN_DASHBOARD = False.
Package: django-filebrowser-no-grappelli-nph
Fork of http://github.com/smacker/django-filebrowser-no-grappelli-django14Works with Django 1.6The FileBrowser is an extension to theDjangoadministration interface in order to:browse directories on your server and upload/delete/edit/rename files.include images/documents to your models/database using theFileBrowseField.select images/documents with TinyMCE.RequirementsFileBrowser 3.4 requiresDjango 1.4+ (http://www.djangoproject.com)pillowNo GrappelliThis fork removes the dependency on Grappelli.Installationpip install django-filebrowser-no-grappelli-nphDocumentationhttp://readthedocs.org/docs/django-filebrowser/Translationhttps://www.transifex.net/projects/p/django-filebrowser/
Package: django-filechooser
Supply a server-side file-chooser in your Django application.InstallationInstall using pip:pip installdjango-filechooserAlternatively, you can install download or clone this repo and callpip install-e..Add to INSTALLED_APPS in yoursettings.py:'filechooser',In your templates, load thefilechooserlibrary and use thefilechooser_*tags:Example template{# Load the tag library #}{%loadfilechooser%}{# Load CSS #}{%filechooser_css%}{# Display a filetabel #}{%filechooser_filetableid="identifier"%}{# Load CSS and JavaScript #}{%filechooser_javascriptid="identifier"%}{# Read the documentation for more information #}DocumentationThe full documentation is athttp://django-filechooser.readthedocs.org/.RequirementsPython 3.2, 3.3 or 3.4Django >= 1.6Contributions and pull requests for other Django and Python versions are welcome.Bugs and requestsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/martinvw/django-filechooser/issuesLicenseYou can use this under MIT license. SeeLICENSEfile for details.AuthorDeveloped and maintained by Martin van WingerdenHistory1.0.0 (??)
Initial setup of seperate module
Package: django-file-context
=============================Django File Context=============================.. image:: https://gitlab.sigmageosistemas.com.br/dev/django-file-context/badges/master/coverage.svg.. image:: https://gitlab.sigmageosistemas.com.br/dev/django-file-context/badges/master/pipeline.svg.. image:: https://readthedocs.org/projects/django-file-context/badge/?version=latestFile Context provides an easy way to store different documents/attachmentsDocumentation-------------The full documentation is at https://django-file-context.readthedocs.io.Quickstart----------Install Django File Context::pip install django-file-contextAdd it to your `INSTALLED_APPS`:.. code-block:: pythonINSTALLED_APPS = (...'file_context.apps.FileContextConfig',...)You need to add this to your INSTALLED_APPS, because we have our ownmodels.Add Django File Context's URL patterns:.. code-block:: pythonfrom file_context import urls as file_context_urlsurlpatterns = [...url(r'^', include(file_context_urls)),...]This is optional. Actually, you can include your own URLs.Features--------* Generic File model so you can store different kinds of files, images,etc, using a single model;* Attach/Detach the file model to other models* Cool descriptor, so you don't have to keep mangling GenericForeignKeysinside your models.Usage-----1. First of all, define your first model:: pythonfrom file_context.managers import Filesclass MyModel(models.Model):name = models.CharField(max_length=128)files = Files()2. That's it.3. You can use the Files API to attach files to MyModel instances, using::: pythonuploaded_file = File.objects.get(pk=1)a = MyModel.objects.create(name='foo')a.files.attach(uploaded_file)a.files.detach(uploaded_file)a.files.clear()Running Tests-------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install tox(myenv) $ toxCredits-------Tools used in rendering this package:* Huge props to django-taggit that inspired me to do the descritoridea!*  Cookiecutter_*  `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.1.0 (2017-10-25)++++++++++++++++++* First release on PyPI.
Package: django-file-download
django-file-downloadDjango File DownloadInstallationpipinstalldjango-file-downloadUrls.pyfromdjango.urlsimportinclude,re_pathurlpatterns=[re_path(r'^f/',include('django_file_download.urls',namespace='django_file_download')),]orfromdjango.urlsimportre_pathfromdjango_file_downloadimportviewsasfile_viewsurlpatterns=[re_path(r'^download$',file_views.file_download,name='file_download'),]Settings.pyINSTALLED_APPS=(...'django_file_download',...)
Package: django-file-explorer
Django File ExplorerA django app to explore the host machine directory.It will provide following features:Allow user loginAllow to set roles for user to delete and download directories.Allow user to upload single file.InstallationFollowing command will help to install the package.pipinstalldjango-file-explorerSetupAdd the app tosetting.pyfile inINSTALLED_APPSsection.INSTALLED_APPS=[...'explorer.apps.ExplorerConfig',]If logging is required then add the following information tosettings.pyfile:EXPLORER={'log_dir':MEDIA_ROOT/'logs','log_file':MEDIA_ROOT/'logs'/'access.log'}log_dir:This is the path where multiple user log files will be created. Each file contain information about the single user.log_file:Path to a file containing log information.Following is the example of single log line.[25/Feb/2023 12:44:43:PM] GET | 200 | <<username>> | <<action>> | <<volume>> | <<pageNumber>> | <<location>> | <<checkboxIdx>> |Migrate the changespythonmanage.pymigrateI you are managing DB separate then make following tables in database:explorer_actionNamePositionData typeLengthRelationNot NULL?Typeid1bigintPKtrueNonename2character varying120trueNonecreation_date3timestamp with time zonetrueNoneAdd followingactionsto table:downloaddeleteuploadunzipNote: All PK are auto incremental.explorer_volumeNamePositionData typeLengthRelationNot NULL?Typeid1bigintPKtrueNonename2character varying120trueNonepath3character varying2048trueNoneactive4booleantrueNonecreation_date5timestamp with time zonetrueNoneexplorer_userroleNamePositionData typeLengthRelationNot NULL?Typeid1bigintPKtrueNonecreation_date2timestamp with time zonetrueNoneuser_id3integerFKtrueNonevolume_id4bigintFKtrueNoneForeign Key ConstraintsNameColumnsReferenced Tableuser_id(user_id) -> (id)auth_uservolume_id(volume_id) -> (id)explorer_volumeexplorer_userrole_actionsNamePositionData typeLengthRelationNot NULL?Typeid1bigintPKtrueNoneuserrole_id2bigintFKtrueNoneaction_id3bigintFKtrueNoneForeign Key ConstraintsNameColumnsReferenced Tableuserrole_id(userrole_id) -> (id)explorer_userroleaction_id(action_id) -> (id)explorer_actionAdd URL tourls.pyfile.fromdjango.urlsimportincludeurlpatterns=[...path('explorer/',include('explorer.urls'),name='explorer')]Addvolumesto database by specifying its name and path. After that define the user roles for specific volume inuser rolestable.RunGo to explorer urlSERVER:PORT/explorerand explore the volumes.AuthorTahir RafiqueReleasesDateVersionSummary12-Jul-23v1.6.1Adding local bootstrap 4.6.2 files. This will correct the wrong appearance of UI when there is no Internet connection.4-Jul-23v1.6.0Adding file unzip option.16-Jun-23v1.5.0Separating vscode icons from this app.
Package: django-filefield-encrypted
DJANGO FILE FIELD ENCRYPTEDdjango-filefield-encrypted - An encrypted file field for Django.This will encrypt when saving and decrypt on reading files on the fly.
Files will be stored in a directory other than MEDIA_ROOT, so not exposed through 'media/...'.INSTALLATIONInstall django-filefield-encrypted:.. code:: shellpip install django-filefield-encryptedThen add to your settings.py:.. code:: python# the key to encrypt the files. Keep it safe!
ENCRYPTED_FILES_KEY = b"<your key here>"
# The directory where files will be stored.
SAFE_MEDIA_ROOT = BASE_DIR / "safe/"You can generate a key with:.. code:: pythonfrom cryptography.fernet import Fernet
key = Fernet.generate_key()
print(key)USAGEIn your models.py:.. code:: pythonfrom encrypted_files.fields import EncryptedFileField

    class Foobar(models.Model):
        foo = EncryptedFileField(upload_to="whatever/")You can create your records normally. To read the file contents:.. code:: pythonfrom encrypted_files.fields import EncryptedFileField

    obj = Foobar.objects.get(pk=pk)
    with obj.foo.open(mode="rb") as f:
        content = f.read()To retrieve the contents of the file in a view:.. code:: pythonfrom encrypted_files.views import EncryptedFileDetailView

    class FoobarView(EncryptedFileDetailView):
        model = Foobar
        encrypted_file_field = "foo"Add this view to your urls.py. When you go to that url it will return the plain contents of the file. Treat if like a ´django.views.generic.detail.DetailView´.
All you need is to indicate the model and the ´encrypted_file_field´ which is the field that contains the encrypted file.
So let's say you want to store an image, and use it in your html. Given the above example. This is how the template would look like:.. code:: html<img src="{% url 'foo_view_url_name' object.pk %}" />That's it! The rendering page will load the image from that url, that will return the contents of the encrypted file transparently.Alternatively you can also use it to download the file, in your template add the download link:.. code:: html<a href="{% url 'foo_view_url_name' object.pk %}" download>
        click here...
    </a>
Package: django-file-field-utils
This package is a set of field and widget that improves the images and files field behaviourDocumentationThe full documentation is athttps://django-file-field-utils.readthedocs.io.QuickstartInstall Django File Field Utils:pip install django-file-field-utilsYou need to addeasy_thumbnailstoINSTALLED_APPS:INSTALLED_APPS=(...'easy_thumbnails',...)Runpythonmanage.pymigrateeasy_thumbnailsFeaturesA image-field that support also svg filesExample of usageimage=SVGAndImageField(_("Image"),blank=True)An admin widget that get the preview of image-fieldExample of usagefromfile_field_utils.db.widgetsimportConfigurableImageWidgetclassNewsAdminForm(forms.ModelForm):classMeta:model=Newswidgets={'image':ConfigurableImageWidget()}@admin.register(News)classNewsAdmin(admin.ModelAdmin):form=NewsAdminFormMethod for media file upload path support in file fieldsExample of usageimage=ImageField(_("Image"),upload_to=UploadPath("example"),blank=True)The image of model instance will be upload under directory:/media/uploads/<instance_model_app_label>/<instance_model_name>/example/image=ImageField(_("Image"),upload_to=UploadPathWithID("example"),blank=True)The image of model instance will be upload under directory:/media/uploads/<instance_model_app_label>/<instance_model_name>/example/<instance_id>/Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2022-01-17)First release on PyPI.0.1.1 (2022-01-24)0.1.2 (2022-01-24)0.1.5 (2022-01-24)Update requirements and readme.
Package: django-file-form
Django file formDjango-file-formhelps you to write forms with a pretty ajax upload.Read the documentation athttp://mbraak.github.io/django-file-form/Features:You can easily add an ajax file-upload to a form.The ajax upload works the same as an html upload.This means that you don't have to change your code to support ajax upload.Supports single and multiple file upload.Supports edition of uploaded files.Supports upload directly to AWS S3 compatible storages.Supports frontend events for the addition and removal of files.Supports addition of arbitrary file meta data and related widgets.The project is hosted ongithub.
Package: django-file-inbox
django-file-inboxPurposeInstallation & configurationsettings.pyThe following values may be added to thesettings.pyfile:NameDescriptionDefaultFILE_INBOX_BOOTSTRAPWhether the project is using BootstrapFalseFILE_INBOX_TABLE_CLASSESCSS classes to apply to the table. This supercedesFILE_INBOX_BOOTSTRAPEmpty stringFILE_INBOX_PAGINATIONNumver of records to show per page for the Inbox ListView10FILE_INBOX_BASE_TEMPLATEBase template name to use for the inbox list and detail viewsbase.htmlFILE_INBOX_BLOCK_NAMEName of the tempalte block to use for the inbox list and detail viewscontent