Saravanan666/pypi-org huggingface dataset:
Package: django-imperavi-widget
Django Imperavi editor======================Supported versions------------Supports Django >=1.8 and Python 2/3Installation------------```pip install git+https://github.com/dzaytsev91/django-imperavi-widget.git```* Add ``imperavi`` to your ``INSTALLED_APPS`` setting.* Add imperavi URL include to your project's ``urls.py`` file::```url(r'^imperavi/', include('imperavi.urls')),```Example-----```cd example/python manage.py migrate./manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')"python manage.py runserver```Then go to [http://127.0.0.1:8000/admin/](127.0.0.1:8000/admin/) and try to create post instancelogin: adminpassword: adminUsage-----The quickest way to add rich text editing capabilities to your admin is to use the included ``ImperaviAdmin`` class. For example::from .models import Categoryfrom imperavi.admin import ImperaviAdminclass CategotyAdmin(ImperaviAdmin):passadmin.site.register(Category, CategotyAdmin)If you want to use it with inline admin models you need to use ``ImperaviStackedInlineAdmin`` class::from .models import Postfrom imperavi.admin import ImperaviStackedInlineAdminclass PostInline(ImperaviStackedInlineAdmin):model = Postextra = 1Custom settings---------------Add a ``IMPERAVI_CUSTOM_SETTINGS`` variable to your ``settings.py`` with custom config::IMPERAVI_CUSTOM_SETTINGS = {'resize': true}Full list of settings is here.[http://redactorjs.com/docs/settings/](ttp://redactorjs.com/docs/settings/)Media URL---------You can also customize the URL that django-imperavi-widget will look for the Editor media at by adding ``IMPERAVI_UPLOAD_PATH`` to your ``settings.py`` file like this::IMPERAVI_UPLOAD_PATH = 'imperavi-uploads/'The default value is ``'imperavi/'``.Unique images per model-----------------------If you want to serve unique media content for specific model you can add ``unique_media = True`` to your admin class::from .models import Categoryfrom imperavi.admin import ImperaviAdminclass CategotyAdmin(ImperaviAdmin):unique_media = Trueadmin.site.register(Category, CategotyAdmin)
Package: django-impersonator
django-impersonateThis Django app lets admin users impersonate other users, useful when testing and debugging permissions.Non superusers are not allowedto perform this request, even if they have view rights to theUsermodel, so that this cannot be used for privilege escalation.As admin, I can choose the "Impersonate" action:Impersonations are terminated by closing the bottom left pop-up.Impersonate is not available for regular users, returning an error for those with view rights to theUsermodel.SetupAdd middleware to your middleware list and make sure it comesafterdjango.contrib.auth.middleware.AuthenticationMiddleware:MIDDLEWARE=[...'django.contrib.auth.middleware.AuthenticationMiddleware',...'impersonate.middleware.ImpersonateMiddleware',...]In one of youradmin.pyfiles, add the action toUserAdmin(or the admin model of your custom User)fromimpersonate.adminimportimpersonate_actionfromdjango.contrib.authimportadminadmin.UserAdmin.actions.append(impersonate_action)Or call it from any of your views (if you're not using django-admin)fromdjango.contrib.authimportmodelsfromimpersonate.adminimportimpersonate_actiondefmy_view(request,target_username):returnimpersonate_action(None,request,models.User.objects.filter(username=target_username))
Package: django-import-export
django-import-export is a Django application and library for importing
and exporting data from a variety of formats.  Includes Django Admin site integration.Documentation:https://django-import-export.readthedocs.io/en/stable/GitHub:https://github.com/django-import-export/django-import-export/Free software: BSD licensePyPI:https://pypi.org/project/django-import-export/
Package: django-import-export-extensions
Descriptiondjango-import-export-extensionsextends the functionality ofdjango-import-exportadding the following features:Import/export resources in the background via CeleryManage import/export jobs via Django AdminDRF integration that allows to work with import/export jobs via APISupportdrf-spectaculargenerated API schemaAdditional fields and widgets (FileWidget, IntermediateM2MWidget, M2MField)InstallationTo installdjango-import-export-extensions, run this command in your terminal:$pipinstalldjango-import-export-extensionsAddimport_exportandimport_export_extensionstoINSTALLED_APPS# settings.pyINSTALLED_APPS=(..."import_export","import_export_extensions",)Runmigratecommand to create ImportJob/ExportJob models andcollectstaticto let Django collect package static files to use in the admin.$pythonmanage.pymigrate$pythonmanage.pycollectstaticUsagePrepare resource for your model# apps/books/resources.pyfromimport_export_extensions.resourcesimportCeleryModelResourcefrom..importmodelsclassBookResource(CeleryModelResource):classMeta:model=models.BookUseCeleryImportExportMixinclass and setresource_classin admin model
to import/export via Django Admin# apps/books/admin.pyfromdjango.contribimportadminfromimport_export_extensions.adminimportCeleryImportExportMixinfrom..importresources@admin.register(models.Book)classBookAdmin(CeleryImportExportMixin,admin.ModelAdmin):resource_class=resources.BookResourcePrepare view sets to import/export via API# apps/books/api/views.pyfrom..importresourcesfromimport_export_extensions.apiimportviewsclassBookExportViewSet(views.ExportJobViewSet):resource_class=resources.BookResourceclassBookImportViewSet(views.ImportJobViewSet):resource_class=resources.BookResourceDon’t forget toconfigure Celeryif you want to run import/export in backgroundLinks:Documentation:https://django-import-export-extensions.readthedocs.io.GitHub:https://github.com/saritasa-nest/django-import-export-extensions/PyPI:https://pypi.org/project/django-import-export-extensions/License:Free software: MIT license
Package: django-import-export-pandas
django-import-export-pandas is a Django is an addon-application
for django-pandas and django-import-export.Features:support multiple formats (Excel, CSV, JSON, …
and everything else thatpandassupport)GitHub:https://github.com/django-import-export/django-import-export-pandas/Free software: BSD licensePyPI:https://pypi.org/project/django-import-export-pandas/RequirementsPython 3.5+Django 2.0+django-import-export requires Python 3.5 and Django 2.0 or newer. See the 1.x
branch for older Python and Django versions where fixes for security issues and
critical errors continue to be released for all officially supported Django
versions.ContributeIf you’d like to contribute, simply forkthe repository, commit your
changes to thedevelopbranch (or branch off of it), and send a pull
request.As most projects, we try to followPEP8as closely as possible. Please bear
in mind that most pull requests will be rejected without proper unit testing.
Package: django-importo
django-importoNOTE: This is still very much a work-in-progress. Don't expect anything to work yet!Management commands and utilities for importing large amounts of data from various sources. The app is tested for compatibility with:Django >= 3.1Wagtail >= 2.12Get startedInstall this app withpip install django-importoAddimportoto yourINSTALLED_APPS
Package: django-import-path-field
Installationpipinstalldjango-import-path-fieldor from gitpipinstall-egit+https://githib.com/Apkawa/django-import-path-field.git#egg=django-import-path-fieldDjango and python versionPythonDjango3.53.63.73.81.8✘✘✘✘1.11✔✔✔✘2.2✔✔✔✔3.0✘✔✔✔Usagemodels.pyfromdjango.dbimportmodelsfromimportpath_fieldimportImportPathField,ImportPathChoicesclassDescriptionClassStrategy:# Description for classshort_description='Strategy description'@classmethoddefclass_method(cls):return1@classmethoddefclass_method_description(cls):"""Class method description"""return1defmethod(self):return3defexample_function_description():return1# Can description for choiceexample_function_description.short_description='Function description'IMPORT_CHOICES=ImportPathChoices(DescriptionClassStrategy,example_function_description,)# Also may add to choice@IMPORT_CHOICES.register("Example description")defexample_function():return1classExampleModel(models.Model):example_class=ImportPathField()example_class_choices=ImportPathField(choices=IMPORT_CHOICES)example_class_null=ImportPathField(null=True,blank=True)</code></pre><h1>Contributing</h1><h2>runexampleapp</h2><prelang="bash"><code>pipinstall-rrequirements-dev.txt./test/manage.pymigrate./test/manage.pyrunserverrun testspipinstall-rrequirements-dev.txt
pytest
toxUpdate versionpythonsetup.pybumpversionpublish pypipythonsetup.pypublish
Package: django-impression-client
Impression ClientSource:https://github.com/gregschmit/django-impression-clientPyPI:https://pypi.org/project/django-impression-client/Impression Client is a reusable Django app that provides helpers for interacting with
remote systems runningImpression.Installation$pipinstalldjango-impression-clientConfigurationAdddjango-impression-clientto your requirements file to ensure it’s installed in
the environment. Configure yoursettings.py:EMAIL_BACKEND="impression_client.backends.RemoteEmailBackend"IMPRESSION_DEFAULT_TARGET="https://impression.example.org/api/send_message/"IMPRESSION_DEFAULT_TOKEN="my_api_auth_token_here"If you want to store your credentials in the database rather than statically in your
projectsettings.pyfile, includeimpression_clientin yourINSTALLED_APPS,
then run database migrations. Finally, remove theIMPRESSION_DEFAULT_TARGETandIMPRESSION_DEFAULT_TOKENfrom your projectsettings.py, and go into the Django
admin UI to add impression servers.Tests$pythonmanage.pytest
Package: django-improved-inlines
Django improved inlines is a version of the inlines app fromdjango-basic-appsthat has a few specific features that I needed:filter=”” instead of just ids= and id=template=”” instead of just inlines/<app>_<model>.htmlSupport for non-<inline> tags by prefixing “data-inline-” to type, ids, id, filterThanks to nathanborror for the initial code.DependanciesBeautifulSoupis required to use the inlines app.UsageInstall in INSTALLED_APPS so the templates can be found“improved_inlines”Inlines is a template filter that can be used in
conjunction with inline markup to insert content objects
into other pieces of content. An example would be inserting
a photo into a blog post body.Drop-in replacement for django-basic-inlines/inlinesAn example of the markup is::<inline type=”calendar.event” filter=”date__gte=datetime.date.today()” template=”calendar/event_inline.html” />other attribute options are::<inline type=”app.model” id=”<some pk>”  class=”some_class_passed_to_template”/>
<inline type=”app.model” ids=”<some pk>,<some other pk>” />examples with other tags::<div data-inline-type=”app.model” data-inline-id=”<some pk>”></div>
<ul data-inline-type=”app.model” data-inline-ids=”<some pk>,<some other pk>”></ul>
<p data-inline-type=”app.model” data-inline-filter=”title__containts=’title-string’”></p>The type attribute is app_name.model_name and the id is
the object id. Pretty simple.In your template you would say::{% load inlines %}
{{ post.body|render_inlines }}
Package: django-improved-permissions
# Django Improved Permissions[![Coverage Status](https://coveralls.io/repos/github/s-sys/django-improved-permissions/badge.svg?branch=master)](https://coveralls.io/github/s-sys/django-improved-permissions?branch=master)
[![Build Status](https://travis-ci.org/s-sys/django-improved-permissions.svg?branch=master)](https://travis-ci.org/s-sys/django-improved-permissions)
[![Documentation Status](https://readthedocs.org/projects/django-improved-permissions/badge/?version=latest)](http://django-improved-permissions.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/django-improved-permissions.svg)](https://badge.fury.io/py/django-improved-permissions)Django Improved Permissions (DIP) is a django application made to make django’s default permission system more robust. Here are some highlights:Object-level PermissionsRole AssignmentPermissions InheritanceCacheCustomizable Permissions per User Instance## DocumentationThe full documentation is available in our page in Read the Docs.http://django-improved-permissions.readthedocs.io/en/latest/## ContributingFeel free to create new issues if you have suggestions or find some bugs.## Commercial SupportThis project is used in products of SSYS clients.We are always looking for exciting work, so if you need any commercial support, feel free to get in touch:contato@ssys.com.br
Package: django-improved-user
This project provides a custom user model that improves on Django’s
default by making a few modern and international changes.Uses email as the username to simplify login for usersReplacefirst_nameandlast_namewith international
friendlyshort_nameandfull_namefieldsThe project also provides mix-in classes to make building custom User
models easier.For an explanation of why and how the project was built, please see theProject Rationale.For information about getting started, please refer to thequickstart
documentation.For information about how to help with the project, please see thecontributing documentation.
Package: django-inactive_user_workflow
This package provides some extensions and overrides to django.contrib.auth and
django-registration to streamline the experience for new users registering for
your site.Independent components are provided for the following tweaks:Let inactive users log in to your django siteLog in the new user automatically after initial site registrationRedirect inactive users to a page of your choice when they try to
access “restricted” contentThey can be wired up semi-independently.You must have ‘django.contrib.auth’ in your INSTALLED_APPS.You must have ‘registration’ in your INSTALLED_APPS.To install, add ‘inactive_user_workflow’ to your INSTALLED_APPS. No models are defined,
so you don’t need to re-run syncdb.Using itThe simplest way to use it is to include a URLconf pattern like(r’^accounts/’, include(‘inactive_user_workflow.urls’))in your root URLconf. This will register its own views and also the
non-overridden views from django-registration and django.contrib.auth
but will not register the inactive-user-catching middleware (see below).
But if you’re using Django permission checks properly, the middleware
will be optional, because django.contrib.auth always returns False
for permission checks on inactive users.The detailsTwo views are provided:inactive_user_workflow.views.registration.registerThis overrides django-registration’s registration_register view with
one behavioral change: it logs in the user automatically after initial
account creation.inactive_user_workflow.views.login.loginThis overrides django.contrib.auth’s auth_login view with one behavioral
change: it allows inactive users to log in to your site.One middleware is provided:inactive_user_workflow.middleware.CatchInactiveUsersMiddlewareIf activated, this middleware intercepts requests by logged-in inactive
users and redirects them to a view named ‘inactive-user’.A simple direct-to-template ‘inactive-user’ view is also provided; it
is published at the URL /accounts/inactive/ (assuming you mount the
package’s URLs at /account/). (So I lied earlier; three views are provided.)
You will likely want to override the provided template registration/inactive_user.html,
or even override the view with your own custom view.You can define a list of URL paths that inactive usersshouldbe allowed
to access without being kicked over to the ‘inactive-user’ view. To do this,
add a list of URL prefixes to your settings.py named ANONYMOUS_PATHS, like so:ANONYMOUS_PATHS = (‘/accounts/’, ‘/site_media/’, ‘/publicview/’)
Package: django-inapp-survey
## django-inapp-survey
In App Survey/Announcement for Django ApplicationInapp-Survey is a simple Django app to conduct Web-based In-App survey. For each question, user answers are saved. You can set the constraints by which the announcement/survey questionnarie is shown on specific page or specific users.Quick startInstallation`shell $ pip installdjango-inapp-survey`Addinapp_surveyto yourINSTALLED_APPSsettings like this:```py
INSTALLED_APPS = [
    ...
    'inapp_survey',
]
```Include theinapp_surveyURLconf in your projecturls.pylike this:```py
url(r'^inapp_survey/', include('inapp_survey.urls')),
```Runpython manage.py migrate inapp_surveyto create the campaign models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a survey (you’ll need the Admin app enabled).UsageThere are two types ofcampaignyou can run -Announcement- Plain informative announcmentSurvey- It allows survey questionnaire, and expects each step as questionTODO: Markdown usageTODO: Example screenshotsTODO: Howscustom_paramsworksTODO: Explain model fields for Campaign
Package: django-inbound-rules
Django Inbound RulesDescriptionDjango Inbound Rules is an app to allow or restrict group of users on specified url(s) based on CIDR blocks(now IPv4 only) excluding user with superuser permissions.Installationpip install django-inbound-rulesQuick startAdd "inbound" to your INSTALLED_APPS in settings.py like this::INSTALLED_APPS = [
    ...
    'inbound',
    ...
]Add "inbound.middleware.restrict_user_middleware" to your MIDDLEWARE in settings.py like this::MIDDLEWARE = [
    ...
    'inbound.middleware.restrict_user_middleware',
    ...
]Runpython manage.py migrateto implement django-inbound-rules.Start the development server and visithttp://127.0.0.1:8000/admin/to create your Inbound Rules.For working logic, see documentation.LicenceCopyright (c) 2020 Nilesh Kumar DubeyThis repository is licensed under the MIT license.
See LICENSE for details
Package: django-inbox
# Django InboxA non live messaging system that simulates an email inbox :mailbox_with_mail:.## Quick start1. Add `inbox` to your INSTALLED_APPS settings:```INSTALLED_APPS = [...'inbox']```2. Include the inbox URLconf in your project urls.py file:```path('inbox/', include('inbox.urls'))```3. Run `python manage.py migrate` to create the models.4. Add the templates needed to run the app:```inbox/inboxes.htmlinbox/inbox-new.htmlinbox/inboxes.html```4. Start the development server and visit http://127.0.0.1:8000/admin/to create an inbox (you'll need the Admin app enabled).5. Visit http://127.0.0.1:8000/inbox/ to see the main page.## ExtrasThis app has a template tag to get the number of unread messages per inbox. To use it just add:```{% load core_tags %}...{% for inbox in inboxes %}{% get_unread_messages inbox request.user as unread_messages %}{% endfor %}```## DemoA demo can be find [here](https://gitlab.com/polrodoreda/django-inbox-demo)### How to contributeBefore push new code to the repository, be sure all the tests passed, coding style has no errors and coverage is good:```bash$ python manage.py test$ flake8$ coverage run --source='core/' manage.py test```
Package: django-include
ORM extensions for performance-conscious perfectionists.Django-include providesselect_relatedfunctionality for Many-to-X relations.RequirementsPython 2.7 or 3.5+, Django 1.9+, and any SQL server with support for JSON aggregations.Currently tested against Postgres 9.6. May work with SQLite with the JSON1 extension.Installationpip install django-includeUsageAddincludetoINSTALLED_APPS.AttachIncludeManagerto a model:fromincludeimportIncludeManagerclassBlogPost(models.Model):objects=IncludeManager()SubclassIncludeQuerySet:fromincludeimportIncludeQuerySetclassCustomQuerySet(IncludeQuerySet):defcustom_method(self):passclassBlogPost(models.Model):objects=CustomQuerySet.as_manager()What/Why?Consider the following:Given the following models.classEmail(Model):name=CharField()user=ForeignKey('User')classUser(Model):emails=...classContributor(Model):role=CharField()user=ForeignKey('User')project=ForeignKey('Project')classProject(Model):contributors=...There is an endpoint that returns all the users that contributed to a project, their roles, and their email addresses.If this endpoint were to be implemented using just Django’s ORM, it would end up looking something like this:project=Project.objects.get(pk=id)# 1 Queryforcontributorinproject.contributors.select_related('users'):# 1 Query[xforxincontributor.user.emails.all()]# N * M Queries!# Some serialization codeAt first this solution seems fine, but what happens when a project has an entire college of people, each with a couple email addresses?
Now, there are certainly other tricks that could be done here to reduce the number of queries and runtime.
For instance, dropping down into raw SQL with a couple joins and/or subselects.Or you could just use.include, do a single query, and not have to explain all theneatthings you did.project=Project.objects.include('contributors__user__emails')# 1 Queryforcontributorinproject.contributors.all():# Already loaded[xforxincontributor.user.emails.all()]# Already loaded# Some serialization codeHow?Django Include abuses JSON aggregations and Django’sextra/annotatefunctions to embed related data.LicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: django-includefilefinder
### Include file finderThis is static file finder for Django which will allow you to specify certain files instead of whole directories like FileSystemFinder do.### 1. SetupTo install it just copy this folder into your project as an app and include it in your INSTALLED_APPSinclude it in STATICFILES_FINDERSSTATICFILES_FINDERS = [...'includefilefinder.finder.IncludeFileFinder',...]and add this extra STATICFILES list into your settings.py which will include all files which should be included using collectstaticSTATICFILES = [# Bootstrap('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/css/bootstrap.min.css'))),('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/css/bootstrap-theme.min.css'))),('js', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/js/bootstrap.min.js'))),# Font Awesome('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/css/font-awesome.min.css'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.eot'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.svg'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.ttf'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.woff'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.woff2'))),('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/FontAwesome.otf'))),# JQuery('js', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/jquery/dist/jquery.min.js'))),]Remember to use this patternSTATICFILES = [...('folder', 'path/to/the/required.file'),...]in order to achieve following file structure/django_app/app/local/folder/required.file### License------------The MIT License (MIT)
Package: django-includes
Experimental software. There is no tests, no documentation, use it are your own risks (or don’t).Currently testing that with django 2 and python 3.5+ only, which will be the only supported target.InstallAdd ‘django_includes’ to INSTALLED_APPS.Add DjangoIncludesExtension to Jinja2 environment.fromdjango_includes.jinja2importDjangoIncludesExtensiondefenvironment(**options):env=Environment(**options)# your logic hereenv.add_extension(DjangoIncludesExtension)returnenvUse{{ render_sync(request, ‘mused.views.MusicGroupListView’, musicgenre=object) }}in templates.Now, that’s only the “synchronous render”,Install hincludeIf you wanna use hinclude (a simple javascript that loads asynchronously some part of your page):Add hinclude url to your project:fromdjango_includes.viewsimportinclude_viewurlpatterns+=[path('hinclude/<token>',include_view,kwargs={'via':'hinclude'},name='hinclude')]Add hinclude to your layout<htmllang="en"xmlns:hx="http://purl.org/NET/hinclude"><head><scriptsrc="{{ static('hinclude.js') }}"></script>Use{{ render_hinclude(request, ‘mused.views.MusicGroupListView’, musicgenre=object) }}in templates.Note that this will use json web tokens to encode the parameters, using your django secret as a “seed” for encryption.