Saravanan666/pypi-org huggingface dataset:
Package: dj-extensions
Copyright©2016 Jahan BalasubramaniamDjango Extensionsdj-extensionsYet another Django extension with set of generic reusable, pluggable mixinsInstallationpip install dj-extensionsCurrently includes following Mixins:PermissionsRequiredMixinAjaxOnlyMixinPaginationMixinFilterMixinUsage:fromdj_extensions.viewsimportPermissionsRequiredMixin,FilterMixin,PaginationMixinclassSomeView(PermissionsRequiredMixin,FilterMixin,PaginationMixin,ListView):model=YourModelpaginate_by=10n_list=5required_permissions=('app.permission1','app.permission2',)allowed_filters={'name':'emp_name__icontains','age':'age_exact',}Source code:Find the source code atgithub repoDocumentation:Find the docs atreadthedocsFor different versions:stable releaselatest versionTo install latest version, which will not be available in pypi, run belowpip install --upgrade https://github.com/jahan01/dj-extensions/tree/masterLicense: MIT
Package: djfapi
djfapiA utility library to integrate and use fastapi with the django orm.🚧 This project is WIP and is subject to change at any timeThis project is currently in the alpha state, even though it can be used in production with some caution. Make sure to fix the version in your requirements.txt and review changes frequently.Installationpip install djfapiFeaturesSentryProvides optional sentry integration.djdantic usageSeedjdanticfor schema usage.Automatic Route GenerationDeclare routes without having to write routes using thedjfapi.routing.django.DjangoRouterSchema.TheDjangoRouterSchemawill supply a router, which just has to be included in the FastAPI app.Example for Routesfromdjfapi.routing.djangoimportDjangoRouterSchema,SecurityScopestransaction_token=JWTToken(scheme_name="Transaction Token")defcompany_objects_filter(access:Access)->Q:q=Q(tenant_id=access.tenant_id)ifaccess.scope.selector!='any':q&=Q(employees__user_id=access.user_id,employees__type__in=[models.Employee.EmployeeType.OWNER,models.Employee.EmployeeType.ADMIN])returnqrouter=DjangoRouterSchema(name='companies',model=models.Company,get=schemas.response.Company,create=schemas.request.CompanyCreate,update=schemas.request.CompanyUpdate,security=transaction_token,security_scopes=SecurityScopes(get=['business.companies.read.any','business.companies.read.own',],post=['business.companies.create',],patch=['business.companies.update.any','business.companies.update.own',],put=['business.companies.update.any','business.companies.update.own',],delete=['business.companies.delete.any','business.companies.delete.own',],),objects_filter=company_objects_filter,children=[DjangoRouterSchema(name='departments',model=models.CompanyDepartment,get=schemas.response.CompanyDepartment,create=schemas.request.CompanyDepartmentCreate,update=schemas.request.CompanyDepartmentUpdate,children=[DjangoRouterSchema(name='teams',model=models.CompanyDepartmentTeam,get=schemas.response.CompanyDepartmentTeam,create=schemas.request.CompanyDepartmentTeamCreate,update=schemas.request.CompanyDepartmentTeamUpdate,),]),DjangoRouterSchema(name='costcenters',model=models.CompanyCostcenter,get=schemas.response.CompanyCostcenter,create=schemas.request.CompanyCostcenterCreate,update=schemas.request.CompanyCostcenterUpdate,),])Info for using FastAPI and Django⚠️ Database Connection LeaksWhen using FastAPI with Django and performing django db operations from within a FastAPI Endpoint, required signals regarding request handling from django are not called.
The Django signalsdjango.core.signals.request_startedanddjango.core.signals.request_finishedneed to be called prior and after every request (which uses the django orm in it's endpoint), otherwise database connections are leaked undefinedly. Those signals must be called from thesamethread, in which the orm is used.There is a method decorator provided by djfapi indjfapi.utils.fastapi_django.request_signalling, which can be applied to any (sync) endpoints. For autogenerated endpoints or manual endpoints decorated with aDjangoRouterSchema.endpoint, this is already done.
Package: djfernet
Maintained fork of github.com/orcasgit/django-fernet-fields used by
yourlabs.io/oss/djwebdappFernetsymmetric encryption for Django model fields, using thecryptographylibrary.djfernetsupportsDjango4.0 and later on Python 3.Only PostgreSQL, SQLite, and MySQL are tested, but any Django database backend
with support forBinaryFieldshould work.!DANGER!If you have data created with djfernet < 0.8, you will need the
following setting to be able to decrypt existing data:DJFERNET_PREFIX = b'djfernet'. Make sure you use a bytestring
right there withb'..'!!Getting HelpDocumentation for djfernet is available athttps://djfernet.readthedocs.org/This app is available onPyPIand can be installed withpip install djfernet.
Package: djfiler
Django File Upload HandlerAn Easy Way To Upload Files To Django✨ FeaturesUpload Any File With Any Size In Any FormatSaves Files Secure and Denied Foreign RequestsSimple Import and UsageHost Files Safely With Simple Key📦 Install$pip3installdjfiler🔨 Usage# Import Django Filerfromdjfilerimportdjfiler# Initial Django Filerdjs=djfiler.Filer('/dir/of/uploades',True)''' djs can be any name you like '''Handle Upload Files In Any Formatdefhome(request):ifrequest.method=="POST":callback=djs.upload(file=request.FILES['file name uploaded'],name="Optional")print(callback)# Its Returns {status:ok | fail,name: name of file ( Its Key Of File ),type: type of file }Return Any File With A Simple Key (Key Is The String That We Return To You When Uploaded file)urls.pypath('images/<slug:key>',sendfile)''' path name can be anything you like we just need the key parameters '''views.pydefsendfile(request,key):callback=djs.find(key)ifcallback!=None:data=json.loads(callback)ifdata['find']:withopen(data['uri'],"rb")asf:returnHttpResponse(f.read(),content_type='*/*')else:returnHttpResponse('ERROR TO SEND FILE')else:returnHttpResponse('File Not Found')Thats All
Package: djfim
djfimLicenseApache License Version 2.0Usagea) declare concrete datamodel:# app/models.pyfromdjango.dbimportmodelsfromdjfim.modelsimportBlob,Entity,GenerationclassMyBlob(Blob):classMeta:abstract=FalseclassMyEntity(Entity):generation=models.ForeignKey('MyGeneration',on_delete=models.CASCADE,null=False)blob=models.ForeignKey('MyBlob',on_delete=models.CASCADE,null=False)classMeta:abstract=FalseclassMyGeneration(Generation):l_anchor=models.ForeignKey('self',on_delete=models.SET_NULL,null=True,related_name='l_subtree')r_anchor=models.ForeignKey('self',on_delete=models.SET_NULL,null=True,related_name='r_subtree')classMeta:abstract=Falseb) migrate datamodel:pythonmanage.pymakemigrations
pythnomanage.pymigratec) setup datamodel reference:# project/settings.pyDJFIM={'MODLE':{'BLOB':{'app_name':'app','app_label':'MyBlob',},}}d) invoke management command:pythonmanage.pyfim[action]
Package: dj-fine-search
Django Fine Searchhttps://github.com/bellomusodiq/dj-fine-searchhttps://pypi.org/project/dj-fine-search/Django fine search is package that performs search based on keywords. It allows word flexibility
for performing filter in a queryset.
e.g. The native Model.object.filter(title__icontains='hello world') will return queryset of
objects that contains substring "hello world", if the "world" comes before the "hello", the
objects would not be found. Django fine search improves that, Django fine search will include
all objects that has substring "hello world".class MyModel(models.Model):    
    title = models.Charfield(max_length=200)
    text = models.TextField()
    ...perform_search takes in the model, search_text and fieldsmodel: Model class, the model to perform filter onsearch_text: string, the query that will be used for the filteringfields: list or tuple of the fields of the models that the search will be performed on e.g. title and text aboveperform_search function returns a list of model objects>> pip install dj-fine-searchfrom fine_search.fine_search import perform_search
# model based search
queryset = perform_search(model=MyModel, search_text='hello world', fields=["title", "text"])# assume we have the queryset below are result of MyModel.objects.all()
queryset = [{"id": 1, "title": "some title", "text": "hello world, how are you"},
            {"id": 2, "title": "some title2", "text": "the world is good"}, 
            {"id": 3, "title": "some title3", "text": "world hello there, hello"}] 
# if we run perform_search on the MyModel with search_text='hello world' and fields=['title', 'fields']

# it will return all the queriesit is also possible to perform search on queryset. e.g. queryset that has been filter initialyfrom fine_search.fine_search import perform_search_queryset

q = MyModel.objects.all()

queryset = perform_serach_queryset(queryset=q, search_text='hello world', fields=["title", "text"])
Package: dj-fiobank-payments
Retrieve payments from Fio bank API (through fiobank package) and parse them into Payment objects.DocumentationThe full documentation is athttps://dj-fiobank-payments.readthedocs.io.QuickstartInstall Django Fio bank payments:pip install dj-fiobank-paymentsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'dj_fiobank_payments.apps.DjFiobankPaymentsConfig',...)Point it to yourOrdersmodel (should be derived fromdj_fiobank_payments.models.AbstractOrder:FIOBANK_PAYMENTS_ORDER_MODEL='tests.Order'FeaturesCreates Payments from Fio statements and pair them with your custom Order model.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2019-05-20)First release on PyPI.
Package: djfirebirdsql
Django firebirdhttps://firebirdsql.org/database backend.I referrerd django-firebird database backendhttps://github.com/maxirobaina/django-firebird.RequirementsDjango 3.1Firebird 4.0 beta1 (Firebird 3.0 minimum version required)pyfirebirdsql (https://github.com/nakagami/pyfirebirdsql) recently released.Installation$ pip install firebirdsql djfirebirdsql django==3.1Database settings exampleDATABASES = {
    'default': {
        'ENGINE': 'djfirebirdsql',
        'NAME': '/path/to/database.fdb',
        'HOST': ...,
        'USER': ...,
        'PASSWORD': ...,
    }
}
Package: djform-navigation
Insallationpip install djform_navigationAddform_navigationin installed apps insettings.pyof django project
INSTALLED_APPS = [
'form_navigation',
# ...
] (at top)DescriptionIt show the preview of every image field in every admin change_form (add/edit) for all models and appsInstructions to run the sample usagegit clone https://github.com/humblesami/djform_navigation.gitcd djform_navigation/sample_usagepip install -r requirements.txtNot requiredbut if you want to reset the database, you can do this
3.1.python manage.py initsql.pypython manage.py runseverOpen following url in your browser and login with given username and passwordhttp://127.0.0.1:8000/admin/login/?next=/admin/loginusername
sa
password
123Go tohttp://127.0.0.1:8000/admin/form_navigation/model1/add/Add image to check previewMake you own pip packageSeehttps://github.com/humblesami/djform_navigation/blob/master/docs/make_pip.mdto make/build/test and uploadyour own pip package
Package: dj-generator
dj-generatorA lot of our time we spend on creating CURD in django. This project aims to generate boilerplate code to reduce our valuable time.The django templating system is pretty powerful. We can make use of the power of templating tool to generate basic CURD given a model.AssumptionsThis project assumes that you follow certain folder structure. That makes this project to stay as simple as possible.UsagePattern -python manage.py generate app.Model --template powerFor example if you run following command -python manage.py generate testapp.Task --template powerIt will create -CRUD python files undertestapp/taskfolder.CRUD template files undertestapp/templates/testapp/taskfolder.
Package: djgeneric
InstallationInstall withpip install djgeneric"or add"djgeneric"directory to your Python path.Add"djgeneric"to theINSTALLED_APPStuple found in your settings
file.Runmanage.py syncdbto create the new tablesUsername and email loginTo allow login with username or email, add to settings:AUTHENTICATION_BACKENDS += ('djgeneric.auth.EmailAuthBackend',)Optionally you can use the form in djgeneric.auth.CustomAuthenticationForm.Google AnaliticsTo use the google analitics code, add to settings:GOOGLE_ANALYTICS_PROPERTY_ID = 'UA-14845987-3'
GOOGLE_ANALYTICS_DOMAIN = 'mydomain.com'

TEMPLATE_CONTEXT_PROCESSORS += ('djgeneric.contect_processors.google_analitics',)And then in your base template add:{% include 'djgeneric/ga.html' %}Login required middlewareTo use the login required middleware, add to settings:LOGIN_REQUIRED_URLS = (
    r'/topsecret/(.*)$',
)
LOGIN_REQUIRED_URLS_EXCEPTIONS = (
    r'/topsecret/login(.*)$',
    r'/topsecret/logout(.*)$',
)

MIDDLEWARE_CLASSES += ('djgeneric.middleware.RequireLoginMiddleware',)
Package: djgentelella
This application is a set of utilities that will make developing applications with django and bootstrap 5 easier, as it provides a set of Javascript libraries such as select2, icheck, datatables and more nicely integrated as widgets or utilities that simplify application creation.This app helps you to integrate Django apps withGentelellabuilding extra widgets for forms and speciall methods to render forms in templates.DocumentationSeeDocumentationInstallationInstalling from pypipipinstalldjgentelellaConfigure your settingsINSTALLED_APPS=[..'djgentelella','rest_framework','markitup',]MARKITUP_FILTER=('markdown.markdown',{'safe_mode':True})MARKITUP_SET='markitup/sets/markdown/'JQUERY_URL=NoneRun migrationspythonmanage.pymigrateCreate statics files downloading from internet (you need to install requests for this step).pipinstallrequestspythonmanage.pyloaddevstaticAdd djgentelella urls in your project urls.py filefromdjgentelella.urlsimporturlpatternsasdjgentelellaurlsurlpatterns=djgentelellaurls+[...]UsageIn formsfromdjgentelella.forms.formsimportGTFormfromdjgentelella.widgetsimportcoreasgenwidgetsclassmyform(GTForm,forms.ModelForm):classMeta:model=MyObjectfields='__all__'widgets={'name':genwidgets.TextInput,'borddate':genwidgets.DateInput,'email':genwidgets.EmailMaskInput}In templates working with forms{{ form.as_plain }}
{{ form.as_inline }}
{{ form.as_horizontal }}In templates using base template{% extends 'gentelella/base.html' %}Take a look this file to note the template block that you can overwriteTestTo run the all test use:cddemopythonmanage.pytestTo run the responsive test use:cddemopythonmanage.pytestdemoapp.tests.selenium.responsiveRun the democddemopythonmanage.pymigratepythonmanage.pycreatedemopythonmanage.pydemomenuAnd More see demo app.Notes for developmentbase.jsis autogenerated so you need to callpythonmanage.pycreatebasejsRemember update the package version before make deploy it on server.sudo apt install node-babel-cli npm webpackTranslationTo add a new translation for a word there are two options:django-adminmakemessages--allThis command adds words that are inside django templates tolocale/es/LC_MESSAGES/django.po, there these words can be translated.To add a word you can use the following syntax.{% trans "new_word" %}For words used in JavaScript files, the following command must be executed.django-adminmakemessages-ddjangojs-les--ignore*.min.jsThis command adds words that are inside thegettextjs function, tolocale/es/LC_MESSAGES/djangojs.po, there these words can be translated.Here is an example ofgettextimplementation:alert(gettext("new_word"))
Package: dj-geocoding
Django features for simple geocoding. Current support for the Geocodio geocoding serviceRead the full docs onRead the Docs.InstallingInstall dj-geocoding:pip install dj-geocodingThen use it in a project:import dj-geocodingAdd your geocoding service API credentials to yoursettings.pyfile:GEOCODIO_API_KEY="SOMEAPIKEY"ModelUse the optional model mixin to your model if you aren’t using PostGIS:from dj_geocoding.models import GeoBase

class MyModel(GeoBase, models.Model):
    passThis adds the followng fields:latitude = models.DecimalField(decimal_places=15, max_digits=18, null=True,
        blank=True)
longitude = models.DecimalField(decimal_places=15, max_digits=18, null=True,
        blank=True)Adds a geocode method:def geocode(self, \*args, \**kwargs):
    return geocode()You should extend this in your model, providing the field(s) from which the
address will be pulled:def geocode(self):
    return super(MyModel, self).geocode('address')You can choose the separator for providing a single address, too:def geocode(self):
    return super(MyModel, self).geocode('street_address', 'city', 'state',
            seperator=", ")And additional property attributes for thepointattribute.Bulk geocodingThebulk_geocodefunction takes a queryset and geocodes its member objects.NoteThe modelmustimplement a point-type field that behaves like a
Point field.Example:geocoded_qs = bulk_geocode(MyModel.objects.all())Specifying the field name:geocoded_qs = bulk_geocode(MyModel.objects.all(), field='point')ManagerThe manager class implements a subclassedQuerySetwith ageocodemethod:MyModel.objects.all().geocode()This returns a queryset of the objects updated (or not) that fit within the
limits of the geocoding service. It is a convenient interface tot hebulk_geocodefunction.Admin siteTheGeocodedFilterfilter can be used to filter locations in the admin based
on whether they have been geolocated or not.TheGeolocateMixinclass can be added to yourModelAdmindefinition to add
thegeocode_addressadmin action. This adds the “geocode address” action to
the admin actions dropdown menu and then will allow you to geocode an entire
queryset from the admin.History0.2.1 (2014-12-02)Removes reliance on querysetgeocodemethod in admin actionAdds docs0.2.0 (2014-09-08)Revisehas_geolocationmethod, remove property statusAdded list filter classGeocodedFilter0.1.1 (2014-08-26)Bug fix for handling single None value in _set_point0.1.0 (2014-08-26)First release on PyPI.
Package: dj-geocomplete-address
Django AddressesAn app that allow manage addresses.InstallationTo get the latest stable release from PyPi.. code-block:: bashpip install dj-geocomplete-addressesTo get the latest commit from GitHub.. code-block:: bashpip install -e git+git@github.com:amgcorp-tech/dj-addresses.git#egg=addressesConfigurationAddaddressesto yourINSTALLED_APPS.. code-block:: pythonINSTALLED_APPS = (
    ...,
    'addresses',
)You can either store your Google API key in an environment variable as GOOGLE_API_KEY or you can specify the key in settings.py.Adddj-addressesconfiguration variables in yoursettings.py.. code-block:: pythonGOOGLE_API_KEY = 'AIzaSyD--your-google-maps-key-SjQBE'Or export into yourenvironment.. code-block:: pythonexport GOOGLE_API_KEY=<your-api-key>Add theaddressesURLs to yoururls.py.. code-block:: pythonurlpatterns = [
    path('addresses/', include('addresses.urls')),
]Include a menu items in your template:.. code-block:: python{% load addresses_tags %}
{% render_addresses_menu %}If you need to modify the template, update the menu template found in.. code-block:: python/templates/addresses/inc/sidebar_menu.htmlDon't forget to migrate your database.. code-block:: bash./manage.py migrate addressesRun server and preview your app in the browser.. code-block:: bash./manage.py runserverUsageThe rationale behind the model structure is centered on trying to make it easy to enter addresses that may be poorly defined.
The model field included uses Google Maps API v3 (via the nicely done geocomplete jquery plugin) to determine a proper address where possible.
However if this isn't possible the raw address is used and the user is responsible for breaking the address down into components.It's currently assumed any address is represent-able using four components: country, state, locality and street address.
In addition, country code, state code and postal code may be stored, if they exist.AddressFieldTo simplify storage and access of addresses, a subclass of ForeignKey named AddressField has been created.
It provides an easy method for setting new addresses.ON_DELETE behavior of Address FieldBy default, if you delete an Address that is related to another object, Django's cascade behavior is used.
This means the related object will also be deleted.
You may also choose to set null=True when defining an address field to have the address set to Null instead of deleting the related object.The model:.. code-block:: bashfrom addresses.models import AddressField

class Person(models.Model):
    address1 = AddressField()
    address2 = AddressField(on_delete=models.CASCADE)
    address3 = AddressField(related_name='+', blank=True, null=True)The form:.. code-block:: bashfrom addresses.forms import AddressField

class PersonForm(forms.Form):
  address = AddressField()The template:.. code-block:: bash<head>
    {{ form.media }} <!-- needed for JS/GoogleMaps lookup -->
</head>
<body>
    {{ form }}
</body>
Package: dj-git
django-gitis a simple Django app to:show all the Git projects stored in a local directorygive a detail view of each project (dashboard)
* number of commits
* number of days since the last commit
* number of hours spent on the project
* when the commits were madeTable of contentsInstallationQuick startContributeTestsLicenseInstallationInstall with pip:pip install dj-gitRequirements:Python 3Django 1.9pygit2pygalpytzQuick startIn settings.py, add ‘git’ to your INSTALLED_APPS like this:INSTALLED_APPS = [
    ...
    'git',
]and specify the path to your Git repositories:PROJECTS_DIR = "path/to/git_repositories"If necessary, set your database configuration. For example, for PostgreSQL:DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '<dbname>',
        'USER': '<username>',
        'HOST': '<host>'
    }
}In urls.py, include the git URLconf in your project this:from django.conf.urls import url, include

urlpatterns = [
    ...
    url(r'^git/', include('git.urls')),
]Run the following command to create the git models:python manage.py migrateUpdate the Git projects:python manage.py updategitprojectsStart the development server:python manage.py runservserand visithttp://127.0.0.1:8000/admin/Visithttp://127.0.0.1:8000/gitto see your Git projectsTestsRun the tests with:python runtests.pyContributeThe project is still in its early stage. There are probably many aspects to
improve and bugs to fix.
Feel free to send pull requests.LicenseMIT. See LICENSE for more details.