Saravanan666/pypi-org huggingface dataset:
Package: django-angular
django-angularLet Django play well with AngularJSDeprecation Warning:AngularJS is deadSince AngularJS is deprecated now, this library shall not be used for new projects anymore.
Instead please proceed with my follow-up projectdjango-formset.
All the useful features for Django Form validation have been reimplemented indjango-formset, this time
in vanilla TypeScript and without depending on any third party package.What does it offer?Add AngularJS directives to Django Forms. This allows to handle client side form validation using
the constraints provided by the server side Form declaration.For more information, please visit thedemo site.How to rungit clone https://github.com/jrief/django-angular.git django-angular.git
cd django-angular.git
docker build -t django-angular.git .
docker run -d -it -p 9002:9002 django-angular.gitOpen the application athttp://{docker-host's-ip}:9002/Backward IncompatibilityTo be compliant with other libraries such asdjangorestframework,  server-side responses on
rejected forms use error code 422, rather than 200. If you use your own form controllers, adopt
them accordingly. The JSON format used to communicate errors downstream has changed slightly.New FeaturesFor a smoother transition path,django-angularadded two directives in version 2.0:<form djng-endpoint="/path/to/endpoint">...</form>, which can be used to upload form
data to the server. It also populates the error fields, in case the server rejected some data.<djng-forms-set endpoint="/path/to/endpoint"><form ...>...</form>...</djng-forms-set>Similar to the above directive, but rather than validating one single form, it validates a
set of forms using one shared endpoint.A promise chain has been introduced. Buttons used to submit form data and then proceed with
something else, now can be written as:<button ng-click="do(update()).then(redirectTo('/path/to/other/page'))">Label</button>DocumentationDetailed documentation onReadTheDocs.Demoon how to combine Django with Angular's form validation.Please drop me a line, if and where you use this project.FeaturesSeamless integration of Django forms with AngularJS controllers.Client side form validation for Django forms using AngularJS.Let an AngularJS controller call methods in a Django view - kind of Javascript RPCs.Manage Django URLs for static controller files.Three way data binding to connect AngularJS models with a server side message queue.Perform basic CRUD operations.ExamplesImplement Filter On Single Page Application using Django & Angular JShttps://shriniket.home.blog/2019/09/22/integrate-angular-js-with-django-filter-application/LicenseCopyright © 2019MIT licensed
Package: django-angular-dynamic-forms
This repo provides Django mixins and Angular library for rapid
development of create/edit dialogs for django rest framework.
It depends on Django 2, Angular 6 and Material UI.Note: support for Angular 5 and Django<2 is not actively developed - use
release/angular5 branch or 1.1.* versions of packages if you need that.On django side, extend yourViewsetto useAngularFormMixinand optionally configure the mixin by providing either layout
information or field defaults (such as css classes). See demos
for details.classCityViewSet(AngularFormMixin,viewsets.ModelViewSet):"""
    API for cities
    """queryset=City.objects.all()serializer_class=CitySerializerOn angular side, useDjangoFormDialogServiceto display a dialog:constructor(privatedialog:DjangoFormDialogService){}createCity(){this.dialog.open('/api/1.0/cities/').subscribe(result=>{console.log('City created, result from server is:',result);});}You can also display the form inside your own component via<django-inpage-form>tag.<django-inpage-formdjango_url="/api/1.0/cities/"(submit)="submit($event)"(cancel)="cancel($event)"></django-inpage-form>Demo and sample source filesSee demos athttp://mesemus.no-ip.org:12569With a bit of work on your side, foreign keys and many-to-many relationships are supported as well (see the demos for details)InstallationDjango side:pipinstalldjango-angular-dynamic-formsAngular side:npminstall--savedjango-angular-dynamic-forms@ng-dynamic-forms/core@ng-dynamic-forms/ui-materialTo render forms, this library useshttps://github.com/udos86/ng-dynamic-forms- do not forget
to add it to your package.json.and addDjangoFormModuleto imports. You will need to provide your own ErrorService for showing
communication errors back to the user. See thedemo/angular/src/app/mat-error.service.tsfor
an example implementation.import{DjangoFormModule,ErrorService}from'django-angular-dynamic-forms';@NgModule({declarations:[...],imports:[BrowserAnimationsModule,DynamicFormsCoreModule.forRoot(),DynamicFormsMaterialUIModule,DjangoFormModule,HttpClientModule,...],providers:[{provide:ErrorService,useClass:MatErrorService},],bootstrap:[AppComponent]})exportclassAppModule{}ConfigurationIf your angular and django server are on the same host/port (seehttps://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.mdfor development tips),
no configuration is necessary.If angular and django are on different hosts/ports, set django settingANGULAR_FORM_ABSOLUTE_URLS=True(
thanks @sssolid for pointing this out).
Package: django-angular-library
# Django Angular Library### Requirements[Django](https://www.djangoproject.com/) 1.3 or later### Installation```$ pip install django-angular-library```### SetupJust add ```'django.contrib.staticfiles'``` and ```'angular'``` toINSTALLED_APPS in yoursettings.py```INSTALLED_APPS = (# ...'django.contrib.staticfiles','angular',# ...)```Refer to Django [static files](https://docs.djangoproject.com/en/dev/howto/static-files/)documentation to configure and deploy static files.### UsageYou can refer to angular in your template with:```{{ STATIC_URL }}js/angular.js```
Package: django-annotator
2.1.0Django implementation ofannotatorjs Storage.Implements most of the methods as per theCore Storage/Search APIdocumentation (root,index,create,read,update,deleteandsearch).To see a working demo:virtualenvannotatorjscdannotatorjssourcebin/activategitclonehttps://github.com/PsypherPunk/django-annotator.gitcddjango-annotator./demo.pyThis will run the tests, after which a demo. page will be available at/demo.InstallationThe package can be installed viapip:pip install django-annotatorFollowing installation it can be added to any Django project by updating theINSTALLED_APPS:INSTALLED_APPS = (
    ...
    "annotator",
    ...
)Then runmigrateto include the new tables fromdjango-annotator:./manage.py migrateAnnotatorThe package relies onAnnotatorbeing installed in your project—see thedocumentationfor details of its inclusion.SettingsAs per Annotator’s documentation, therootendpoint will return information in the format:{
    "name": "django-annotator-store",
    "version": "2.1.0"
}Thenamereturned can be configured by settingANNOTATOR_NAMEin yoursettings(defaulting to the above).django-cors-headersIf you have any issues withCross-origin resource sharing (CORS), consider installing thedjango-cors-headerspackage.
Package: django-announcements
Some sites need the ability to broadcast an announcement to all of their
users. django-announcements was created precisely for this reason. How you
present the announcement is up to you as the site-developer. When working with
announcements that are presented on the website one feature is that they are
only viewed once. A session variable will hold which announcements an user has
viewed and exclude that from their display. announcements supports two
different types of filtering of announcements:site-wide (this can be presented to anonymous users)non site-wide (these can be used a strictly a mailing if so desired)members only (announcements are filtered based on the value ofrequest.user)
Package: django-annoying
Features:render_to decorator - Reduce typing in django views.signals decorator - Allow using signals as decorators.ajax_request decorator - Returns JsonResponse with dict as content.autostrip decorator - Strip form text fields before validation.get_object_or_None function - Similar to get_object_or_404, but returns None if the object is not found.get_config function - Get settings from django.conf if exists, return a default value otherwise.AutoOneToOne field - Creates related object on first call if it doesn’t exist yet.HttpResponseReload - Reload and stay on same page from where request was made.StaticServer middleware - Instead of configuring urls.py, just add this middleware and it will serve you static files.JSONField - A field that stores a Python object as JSON and retrieves it as a Python object.Installation instructions:Copy the “annoying” directory to your Django project or put it in your PYTHONPATH.You can also run “python setup.py install”, “easy_install django-annoying”, or “pip install django-annoying”.Download:git clone git://github.com/skorokithakis/django-annoying.githg clonehttp://bitbucket.org/Stavros/django-annoying/
Package: django-anon
django-anonwill help you anonymize your production database so it can be
shared among developers, helping to reproduce bugs and make performance improvements
in a production-like environment.Features🚀Really fastdata anonymization and database operations using bulk updates to operate over huge tables🍰Flexibleto use your own anonymization functions or external libraries likeFaker🐩Elegantsolution following consolidated patterns from projects likeDjangoandFactory Boy🔨Powerful. It can be used on any projects, not only Django, not only Python. Really!Table of ContentsInstallationSupported versionsLicenseUsageBuilt-in functionsLazy attributesThe clean methodDefining a custom QuerySetHigh-quality fake dataChangelogContributingInstallationpip install django-anonSupported versionsPython (2.7, 3.7)Django (1.8, 1.11, 2.2, 3.0)LicenseMITUsageUseanon.BaseAnonymizerto define your anonymizer classes:importanonfromyour_app.modelsimportPersonclassPersonAnonymizer(anon.BaseAnonymizer):email=anon.fake_email# You can use static values instead of callablesis_admin=FalseclassMeta:model=Person# run anonymizer: be cautious, this will affect your current database!PersonAnonymizer().run()Built-in functionsimportanonanon.fake_word(min_size=_min_word_size,max_size=20)anon.fake_text(max_size=255,max_diff_allowed=5,separator=' ')anon.fake_small_text(max_size=50)anon.fake_name(max_size=15)anon.fake_username(max_size=10,separator='')anon.fake_email(max_size=40,suffix='@example.com')anon.fake_url(max_size=50,scheme='http://',suffix='.com')anon.fake_phone_number(format='999-999-9999')Lazy attributesLazy attributes can be defined as inline lambdas or methods, as shown below,
using theanon.lazy_attributefunction/decorator.importanonfromyour_app.modelsimportPersonclassPersonAnonymizer(anon.BaseAnonymizer):name=anon.lazy_attribute(lambdao:'x'*len(o.name))@lazy_attributedefdate_of_birth(self):# keep year and monthreturnself.date_of_birth.replace(day=1)classMeta:model=PersonThe clean methodimportanonclassUserAnonymizer(anon.BaseAnonymizer):classMeta:model=Userdefclean(self,obj):obj.set_password('test')obj.save()Defining a custom QuerySetA custom QuerySet can be used to select the rows that should be anonymized:importanonfromyour_app.modelsimportPersonclassPersonAnonymizer(anon.BaseAnonymizer):email=anon.fake_emailclassMeta:model=Persondefget_queryset(self):# keep admins unmodifiedreturnPerson.objects.exclude(is_admin=True)High-quality fake dataIn order to be really fast,django-anonuses it’s own algorithm to generate fake data. It is
really fast, but the generated data is not pretty. If you need something prettier in terms of data,
we suggest usingFaker, which can be used
out-of-the-box as the below:importanonfromfakerimportFakerfromyour_app.modelsimportAddressfaker=Faker()classPersonAnonymizer(anon.BaseAnonymizer):postalcode=faker.postalcodeclassMeta:model=AddressChangelogCheck outCHANGELOG.rstfor release notesContributingCheck outCONTRIBUTING.rstfor information about getting involvedIconmade byEucalypfromwww.flaticon.com
Package: django-anon-lockout
Django Anonymous LockoutDjango anonymous lockout is a simple django module for keeping track of failed loging attemps to an endpoint that is protected by some password, but does not require authentication with an authentication backend.It works by fetching the IP of the one making the attempt. If the attempt is successful, it stores this and the resource can be shown. If the attempt fails, the session connected to the attempt get's it'sfailed_in_rowfield incremented. If this counter exceeds the threshold (default 100), the IP address is locked out forLOCKOUT_DURATIONtime (default 1 day). The only time the counter is reset, is after this lockout has expired.InstallationDjano anonymous lockout can be installed with pip:pipinstalldjango-anon-lockoutThen addanon_lockouttoINSTALLED_APPS. It can go in any order.INSTALLED_APPS=[...,anon_lockout,]Finally migrate the models:pythonmanage.pymigrateUsageDjango Anonymous Lockout operates without signals, which means that you will specifically have to call the handler for it to work. The handler is specified inhandlers.py(handle_attempt). It takes in the ip, wheter the attempt was failed or not and which resource was attempted accessed.In your code, you would typically check if the password is correct and then callhandle_attemptwith the correct arguments.handle_attemptwill returnTrueif the attempt leads to a lockout, or the user (ip and resource) is already locked out. This means that even though a user might have "authenticated" correctly, if the ip is locked out, it will still not allow the user to see the resource.To get the IP of an request, you can for instance use this snippet:defget_ip(request:HttpRequest):"""Returns the ip (hashed) of the given request."""user_ip:str=request.META.get("HTTP_X_FORWARDED_FOR")ip:str=""ifuser_ip:ip=user_ip.split(",")[0]else:ip=request.META.get("REMOTE_ADDR")returnhashlib.sha256(ip.encode("utf-8")).hexdigest()This snippet is also included inutils.py.ExampleAssuming you have a simple form with the field "password".views.py:defmy_endpoint(request,resource_id):ifrequest.method=="POST":form=MyForm(request.POST)ifform.is_valid():password=form.cleaned_data["password"]ifcorrect_password(password):locked=handle_attempt(get_ip(request),failed=False,resource="resource")ifnotlocked:returnredirect(request,"see-resource")else:locked=handle_attempt(get_ip(request),failed=True,resource="resource")# do more handling hereiflocked:form.add_error("password","Locked out")else:form=MyForm()context={"form":form,}returnrender(request,"anon_login.html",context)A working, but very simple example is intests/views.py.ConfigurationThere are 2 settings that you can override:LOCKOUT_DURATION: Decides how long a user is locked out for. Default is 1 day.LOCKOUT_THRESHOLD: Decides how many attemptsin a rowthat has to fail for a lockout to occur. Default is 100 attempts.TestsThere are a few tests that makes sure the basic funtionality works. These can be run by:pythonmanage.pytesttests.testsNote: for this to work you would have to clone this repo. It does not work if it is included inINSTALLED_APPS.
Package: django-anonymizable-model
Your project description goes hereDocumentationThe full documentation is athttps://django-anonymizable-model.readthedocs.io.QuickstartInstall django-anonymizable-model:pip install django-anonymizable-modelAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'anonymizable_model',
    ...
)Use on your models like this:@anonymizable(
    db_label_prefix="pa_",
    anonymizable_fields=["first_name", "last_name", "phone_number"]
)
class ExampleGDPRModel(models.Model):
    objects = ExampleGDPRModelManager.from_queryset(ExampleGDPRModelQuerySet)()

    first_name = models.CharField("First name", max_length=255)
    last_name = models.CharField("Last name", max_length=255)
    phone_number = models.CharField("Phone number", max_length=255, blank=True, default="")
    description = models.TextField("Description", blank=True, default="")It is possible to change db_label_prefix with your own label
and assign anonymizable fields from the model for export and visualization features.And then run migrations:$ python manage.py makemigrations
$ python manage.py migrateFor the admin visualization use AnonymizableAdminMixin class:@admin.register(ExampleGDPRModel)
class ExampleGDPRModelAdmin(AnonymizableAdminMixin, admin.ModelAdmin):
    list_display = (
        "__str__",
        "first_name",
        "last_name",
        "phone_number",
        "description",
    )

    fieldsets = (
        (None, {"fields": (
            ("first_name", "last_name"),
            ("phone_number", "description"),
        )}),
    )The admin can view all anonymized data in fields. If a staff user does not have can_view_anonymized_fields permission
all the data in anonymizable_fields will be substituted with “…”.Anonymize DATABASEIt is possible to anonymize data directly in database using:$ python manage.py anonymize_databaseFeaturesRemove or override __str__ method to display “…” if user does not have permissionRunning 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.7 (2021-10-11)First release on PyPI.0.1.8 (2021-10-12)Updated version for github actions
Package: django-anonymized-activity-log
This django app intended for writing highly detailed anonymized HTTP logs to databaseFeatures:DB router for writing logs to another database.Filters for ignoring some queries by URL, HTTP methods and response codes.Saving anonymous activity as fake user.More:https://github.com/dave-leblanc/django-anonymous-activity-logBased largely on:https://github.com/scailer/django-user-activity-log
Package: django-anonymous
django-anonymousSimple Django module to anonymize production data for safe usage on non-production environments.Installationpip install django-anonymousUsageIn your app create a fileanon.py:fromdjango_anonymousimportAnonymizer,Faker,registerfrom.modelimportYourModel@register(YourModel)classYourModelAnonymizer(Anonymizer):# You can give any callable, Faker is a small wrapper around the `faker` library.email=Faker("email",unique=True)# You can also use any static valuefirst_name="Anon"Run the anonymizerpython manage.py anonymizeCustom QuerySetYou can set a custom QuerySet to filter out some objectsfromdjango_anonymousimportAnonymizer,Faker,registerfrom.modelimportYourModel@register(YourModel)classYourModelAnonymizer(Anonymizer):email=Faker("email",unique=True)defget_queryset(self):returnsuper().get_queryset().filter(is_staff=True)Faker seedDefault it will use the object id as seed, to generate the same data for every run.
You can disable this by overriding theget_object_seedand return falsy value.fromdjango_anonymousimportAnonymizer,Faker,registerfrom.modelimportYourModel@register(YourModel)classYourModelAnonymizer(Anonymizer):email=Faker("email",unique=True)defget_object_seed(self,obj):returnNoneSettings for AnonymizerPer Anonymizer you can set the select chunk size and update batch size.
Default it will not anonymize a field that has no value.fromdjango_anonymousimportAnonymizer,Faker,registerfrom.modelimportYourModel@register(YourModel)classYourModelAnonymizer(Anonymizer):SELECT_CHUNK_SIZE=100UPDATE_BATCH_SIZE=25ANONYMIZE_EMPTY_FIELD=Falseemail=Faker("email",unique=True)Inspired byhttps://github.com/Tesorio/django-anonhttps://github.com/FactoryBoy/factory_boy
Package: django-anonymoususer-permissions
Small backend to grant permission to Anonymous users using django admin interfaceLinksStableDevelopmentProject home page:https://github.com/saxix/django-anonymoususer-permissionsIssue tracker:https://github.com/saxix/django-anonymoususer-permissions/issues?sortDownload:http://pypi.python.org/pypi/django-anonymoususer-permissions/Documentation:https://django-anonymoususer-permissions.readthedocs.org/en/latest/
Package: django-anorganization
Anorganization uses membership, and organization models to group users.
Support for Ariadne graphQL with pre-defined types and basic resolvers.RequirementsPython 3.10+django 4.0+pillow 9.4.0+SettingsStore uploaded file with tokenize file name, default to FalseANORGANIZATION_USE_TOKEN_FILENAME = TrueDjango admin mixinsUse predefined mixins to construct the admin class.OrganizationAdminMixinMembershipAdminMixinfromdjango.contribimportadminfromanorganization.modelsimportOrganizationfromanorganization.mixinsimportOrganizationAdminMixin@admin.register(Organization)classOrganizationAdmin(OrganizationAdminMixin,ModelAdmin):...Ariadne types and resolversIntegrate predefined types and resolvers to scheme.Requirementsariadne 0.16.0+ariadne-relay 0.1.0a8+schemafromanorganization.graphqlsimportanorganization_schemaanarticle/graphqls/article.graphqlanarticle/graphqls/tag.graphqltypesfromanorganization.graphqlsimportanorganization_bindablesanorganizationanorganization_membershipresolversAsync versionfromanorganization.graphqlsimportresolve_anorganization_instance,\resolve_anorganization_member_connection,resolve_anorganizationsanorganization.set_instance_resolver(resolve_anorganization_instance)anorganization.set_connection('members',resolve_anorganization_member_connection)query.set_field('organizations',resolve_anorganizations)resolve_anorganization_instanceresolve_anorganization_member_connectionresolve_anorganization_membership_instanceresolve_anorganizationsresolve_anorganization_membershipsSync versionresolve_anorganization_instance_syncresolve_anorganization_member_connection_syncresolve_anorganization_membership_instance_syncresolve_anorganizations_syncresolve_anorganization_memberships_syncLicensedjango-anarticle is released under the terms ofApache license. Full details in LICENSE file.
Package: django-anss-archive
LinksDocs:palewi.re/docs/django-anss-archive/Code:github.com/datadesk/django-anss-archiveIssues:github.com/datadesk/django-anss-archive/issuesPackaging:pypi.python.org/pypi/django-anss-archiveTesting:github.com/datadesk/django-anss-archive/actions
Package: django-answerdiff
Checking Submissions the Boss Way using Celery and DRFDocumentationThe full documentation is athttps://django-answerdiff.readthedocs.org.QuickstartInstall answerdiff:pip install django-answerdiffThen use it in a project:import answerdiffFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-text.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-pypackageHistory0.1.0 (2015-10-02)First release on PyPI.