Saravanan666/pypi-org huggingface dataset:
Package: dj-dynamic-forms
django-dynamic-formslets you create your forms through the Django admin.
You can add and remove form fields as you need them. That makes it perfect
for creating survey or application forms.INSTALLATIONAdd'dynamic_forms'to theINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'dynamic_forms',
    ...
)Add'dynamic_forms.middlewares.FormModelMiddleware'to theMIDDLEWARE_CLASSES(probably at the end):MIDDLEWARE_CLASSES = (
    ...
    'dynamic_forms.middlewares.FormModelMiddleware'
)You can setDYNAMIC_FORMS_EMAIL_RECIPIENTSin your settings to a list of
e-mail addresses. Forms being send via e-mail will then be send to those
addresses instead of those defined insettings.ADMINS. Each recipient will
seeallother recipients. Seesend_mailin the officiall documentation.ExampleChange into theexample/directoryRun./manage.py runserverTheadminis available athttp://127.0.0.1:8000/admin/.Username:adminPassword:passwordYou can find an example form athttp://127.0.0.1:8000/example-form/.Running the testsChange into thetests/directoryRun./runtests.sh
Package: dj-dynamic-settings
Django Dynamic SettingsDjango Dynamic Settings allows you to create & use dynamic settings backed by a database.InstallationInstallation using pip:pip install dj-dynamic-settingsdj_dynamic_settingsapp has to be added toINSTALLED_APPSandmigratecommand has to be run.INSTALLED_APPS=(# other apps here..."dj_dynamic_settings",)dj_dynamic_settings.urlsmust be included to a desired url path.urlpatterns=[...,url(r"^api/v1/",include("dj_dynamic_settings.urls")),]Setting class must be defined & registered. Please make sure that this class' module
runs whenever the application runs.fromdj_dynamic_settings.registryimportBaseSetting,registryfromdj_dynamic_settings.validatorsimportTypeValidator@registry.registerclassFeatureActive(BaseSetting):key="FEATURE_ACTIVE"validators=[TypeValidator(bool)]default=Falsedescription="Flag for Feature X"CreateSettinginstance using view.importrequestsrequests.post(url="https://your-app.com/api/v1/dynamic_settings/",headers={"Authorization":"Token <secret-login-token>",},json={"key":"FEATURE_ACTIVE","value":True,"is_active":True,})Access this setting as indjango.conf.settingsfromdj_dynamic_settings.confimportsettingssettings.FEATURE_ACTIVE# TrueCreate / Update TriggersTo fire a callback method when a specific setting value updated or created, you can implementpost_save_actionsinBaseSettinginherited classFollowing example shows how to implementpost_save_actionsmethod.The callback method will be called with following kwargs:key=instance.key
value=instance.value
created=created # is create operationNote:post_save_actionsreturns an array, so you can add multiple callback methods. These callback methods will be called synchronously.classPostUpdateTestConfiguration(BaseSetting):key="X_FEATURE_POST_UPDATE"validators=[...]@classmethoddefpost_save_actions(cls):return[on_data_updated,]defon_data_updated(*args,**kwargs):passTesting Toolsoverride_settings()You can override a setting for a test method or test class.fromdj_dynamic_settings.utilsimportoverride_settingsfromdjango.testimportTestCase@override_settings(SOME_SETTING="some_setting")classFeatureTestCase(TestCase):@override_settings(SOME_OTHER_SETTING="SOME_OTHER_SETTING")deftest_feature(self):# Some stuffpassdeftest_feature_x(self):withoverride_settings(SOME_OTHER_SETTING="SOME_OTHER_SETTING"):# Some stuffpass
Package: dj_dynamic_templates
dj-dynamic-templatesdj-dynamic-templates package is used for controlling mail templates dynamically using django admin panel.It's designed to integrate seamlessly with Django projectsRequirementsPython 3.11+Django 5.0+django-markdownx 4.0.7+ (optional)InstallationInstall usingpip...pip install dj_dynamic_templatesAdd'dj_dynamic_templates'to yourINSTALLED_APPSsetting.INSTALLED_APPS=[...'dj_dynamic_templates',]OptionalInstalldjango-markdownxfor better experience of template editing.Open the hyperlink and follow the procedure provided in that documentNow migrate the changes into your databasepythonmanage.pymigrateNow login to django admin panel and start using this package
Package: djeasy
CompatibilityDjango 1.8+Python 3.x +Python 2.x +Support OS : Ubuntu (Debian Derivatives)Centos (not yet)You should check this package.Installationssudo apt-get install python-pip
sudo apt-get install python3-pip
sudo apt-get install virtualenvPackagepip install djeasy
#or
pip3 install djeasyConfigurationThis is important this project. Because your project doesn't match this directory doesn't work.You must addrequirements.txt# Example Project ;DjangoBlog
├── DjangoBlog
│   ├── __init__.py
│   ├── settings.py
│   └── urls.py
│   └── wsgi.py
├── Blog
│    ├── __init__.py
│    └── admin.py
│    └── apps.py
│    └── tests.py
│    └── views.py
requirements.txt ---> Add!!Example requirements.txt :https://goo.gl/0Y9yCBDo not forget to add therequirements.txtfile.Django Settings.pyALLOWED_HOSTS = []server ip or domain add.DjEasydjeasyOutput :--create                      Create a new site.
--nginx                       Nginx restartSite Publishing StepsYou must create virtualenv for your project and this package.NOT : You should know virtualenv name to use djeasy.You can follow this;cd /home/ # as you wish. My recommended in your /home/ directory.

virtualenv -p python3 DjangoEnv # example name : DjangoEnvUpload or clone your project in server directory like /home/Example :cd /home/
git clone https://github.com/AliYmn/aliyaman.org
mv aliyaman.org DjangoBlog # to change nameLet's run the package.We'll finish the process in four steps.djeasy --createYou can give any name you want for nginx and gunicorn name. But you should don't keep in mind names, because you'll use this for restart nginx and gunicorn.NOT : You can write multiple site. For example, example1.com example2.comExample;server ip or domain = 192.241.163.191 example.com blog.example.comRestart the serverCommands used ;--nginx                        Nginx restart
gunicorn_name --gunicorn       Gunicorn restartExample;djeasy --nginx
djeasy DjangoBlog --gunicornOutput;Process completed successfully.NOT : The Json file is saved in the home directory, please do not delete it.
Package: dj-easy-pdf
Django PDF rendering, easily convert html responses to pdf responsesDeveloped byWilliam Otieno.OverviewThis app makes rendering PDF files in Django really easy.
It can be used to create invoices, bills and other documents
from simple HTML markup and CSS styles. You can even embed images
and use custom fonts.The library provides both Class-Based View that is almost a drop-in
replacement for Django’sTemplateViewas well as helper functions
to render PDFs in the backend outside the request scope
(i.e. using Celery workers).QuickstartIncludedj-easy-pdf,xhtml2pdfin yourrequirements.txtfile.
If you are on Python 3 you need to install the latest version of Reportlab and the beta version of xhtml2pdf:$ pip install dj-easy-pdfAddeasy_pdftoINSTALLED_APPS.Create HTML template for PDF document and add a view that will render it:{%extends"easy_pdf/base.html"%}{%blockcontent%}<divid="content"><h1>Hithere!</h1></div>{%endblock%}fromeasy_pdf.viewsimportPDFTemplateViewclassHelloPDFView(PDFTemplateView):template_name='hello.html'You can also use a mixin to output PDF from Django generic views:classPDFUserDetailView(PDFTemplateResponseMixin,DetailView):model=get_user_model()template_name='user_detail.html'If you’re using Function Based views then:fromeasy_pdf.renderingimportrender_to_pdf_responsedefpdf_output(request):context={}returnrender_to_pdf_response(request,"output.html",context)DocumentationThe full documentation is atdj-easy-pdf.readthedocs.io.Dependenciesdj-easy-pdfdepends on:django>=3.2xhtml2pdfreportlabLicensedj-easy-pdfis released under the MIT license.Other ResourcesGitHub repository -https://github.com/WilliamOtieno/dj-easy-pdfPyPi Package site -https://pypi.python.org/pypi/dj-easy-pdfDocs -https://dj-easy-pdf.readthedocs.io/Commercial SupportThis app and many other help us build better software
and focus on delivering quality projects faster.
We would love to help you with your next project so get in touch
by dropping an email atjimmywilliamotieno@gmail.com
Package: dj-easy-xls
Dj easy xlsHelpful class and methods to import and export xls with django framework.UsageImport from xlsWe call method get_sheet_rows which converts the table into dict with column as keys.excel=OpenpyxlImport(file)rows=excel.get_sheet_rows()ifexcel.tally_header(rows[0],self.fields):forrowinrows[1:]:params=excel.row_to_dict(row)print(params)Export from xlsSimple example to export django model queryset into csv file.file_name=self.file_name+' '+datetime.datetime.today().strftime('%Y-%m-%d')or'Untitled'export=OpenpyxlExport(file_name)export.generate(self.fields,True)forobjectinself.queryset:values=[change_format(object,val)forvalinself.fields]export.generate(values)export.set_width()# sets proper width of each columnsReturn xlsx file as a responseOnce we generate the xls in an export instance we can return response asreturnexport.response()Return xlsx file as a responseSaving xlsx in a directory path.returnexport.wb.save("<path>/test.xlsx")Saving response from django as a file with axiosDjango http response can be saved as a file from an axios requestconst url = '/download'
const config = {
  baseURL: process.env.BaseURL,
  responseType: "blob", // Very important!
};
try {
  const response = await axios.get(url, config);
  const url = window.URL.createObjectURL(new Blob([response.data]));
  const link = document.createElement("a");
  link.href = url;
  link.setAttribute("download", "file.xlsx"); //or any other extension
  document.body.appendChild(link);
  link.click();
} catch (error) {
  console.log(error);
}Install from Pypi testpipinstall-ihttps://test.pypi.org/simple/dj-easy-xls
Package: djecrety
DjecretyDjecrety is a Django implementation of aWeb toolwith the same name. This package provides a command to generate a new secret key for your project and save it tosettings.py.For more detailshttps://docs.djecrety.irRequirementsTo be able to runDjecretyyou have to meet following requirements:Python >=3.6Django >=2.0InstallationSimply install usingpip:$pipinstalldjecretyDocumentationDocumentation is available onhttps://docs.djecrety.ir.
Package: djedefre
REST implementation ofDjangoauthentication
system.djoserlibrary provides a set ofDjango Rest Frameworkviews to handle basic actions such as registration, login, logout, password
reset and account activation. It works withcustom user model.Instead of reusing Django code (e.g.PasswordResetForm), we reimplemented
few things to fit better intoSingle Page Apparchitecture.Developed bySUNSCRAPERSwith passion & patience.RequirementsTo be able to rundjoseryou have to meet following requirements:Python (3.5, 3.6, 3.7, 3.8)Django (1.11, 2.2)Django REST Framework (3.9, 3.10)If you need to support other versions, please use djoser<2.InstallationSimply install usingpip:$pipinstalldjoserAnd continue with the steps described atconfigurationguide.DocumentationDocumentation is available to study athttps://djoser.readthedocs.ioand indocsdirectory.Contributing and developmentTo start developing ondjoser, clone the repository:$gitclonegit@github.com:sunscrapers/djoser.gitIf you are apipenvuser you can quickly setup testing environment by
using Make commands:$makeinit$maketestOtherwise, if you cannot use Make commands, please create virtualenv and install
requirements manually:$pipinstalldjangodjangorestframework$pipinstall-rrequirements.txt$cdtestproject$./manage.pytestIf you need to run tests against all supported Python and Django versions then invoke:$pipinstalltox$tox-pallYou can also play with test project by running following commands:$./manage.pymigrate$./manage.pyrunserverSimilar projectsList of projects related to Django, REST and authentication:django-rest-framework-simplejwtdjango-oauth-toolkitdjango-rest-authdjango-rest-framework-digestauth(not maintained)
Package: djed.static
djed.staticintegratesBowerStaticinto thePyramid Web Framework.
BowerStatic is a WSGI component that can serve static resources from
front-end packages (JavaScript, CSS) that you install through theBowerpackage manager.Dependenciespython >= 3.3pyramidbowerstaticDocumentation and SupportDocumentation can be found athttps://djedstatic.readthedocs.org/If you’ve got questions, contact thedjedproject mailling list.To report bugs, use theissue tracker.Licensedjed.staticis offered under theISC license.Changes0.5 (2015-10-06)Support Python 3.5It’s now possible to create local components before abower_componentsdirectory has been defined.Backward incompatible change: Removeversionargument ofconfig.add_bower_component(version information from thebower.jsonfile is used instead).Backward incompatible change: Rename keyword argument identifiernameofconfig.add_bower_componentsandrequest.includetocomponents_name.Add checks if components directory exists and if local components contain abower.jsonfile.0.4 (2015-05-24)Simplified creation of local componentsAdded setting optioncomponents_pathChanged to PEP 420 namespace package0.3 (2015-01-10)Support multiplebower_componentsdirectories0.2 (2015-01-09)Added documentationAdded setting options via ini file0.1 (2015-01-06)Initial release
Package: djehuty
djehutyThis Python package provides the repository system for 4TU.ResearchData.DevelopTo create a development environment, use the following snippet:python-mvenvdjehuty-env
.djehuty-env/bin/activatecd/path/to/the/repository/checkout/root
pipinstall-rrequirements.txtInteractive developmentTo get an interactive development environment, use:sed-e's/@VERSION@/0.0.1/g'pyproject.toml.in>pyproject.tomlpipinstall--editable.cpetc/djehuty/djehuty-example-config.xmldjehuty.xmldjehutyweb--config-filedjehuty.xmlKeeping your development environment up-to-dateTo update packages in the virtual environment, use the following command
inside an activated virtual environment:pipfreeze|grep-v"djehuty.git"|cut-d=-f1|xargs-n1pipinstall-UDeployPyInstallerCreate a portable executable with:pipinstallpyinstaller
pyinstaller--onefile\--hidden-import=_cffi_backend\--add-data"src/djehuty/web/resources:djehuty/web/resources"\--namedjehuty\main.pyOn Windows, use:pipinstallpyinstaller
pyinstaller--onefile\--hidden-import=_cffi_backend\--add-data="src/djehuty/web/resources;djehuty/web/resources"\--icon="src/djehuty/web/resources/static/images/favicon.ico"\--name=djehuty\main.pyTricks when building using WINEWhile no support can be provided for this, the following notes may help.
Alledgedly, using Python 3.8.6 works well.  Activating the virtual
environment works best from acmd.exe, which can be started using:winecmdBuild an AppImage with Nuitkapipinstallnuitka
nuitka3--standalone\--include-module=rdflib.plugins\--include-module=_cffi_backend\--include-package-data=djehuty\--onefile\--linux-onefile-icon="src/djehuty/web/resources/static/images/favicon.png"\main.py\-odjehuty.appimageBuild RPMsBuilding RPMs can be done via the Autotools scripts:autoreconf-vif
./configure
makedist-rpmThe RPMs will be available underrpmbuild/RPMS/noarch.RunUsing the built-in web serverdjehutyweb--config-file=config.xmlAn example of a configuration file can be found inetc/djehuty/djehuty-example-config.xml.Use themaximum-workersconfiguration option to use forking rather than threading.Usinguwsgi:On EL7, installuwsgianduwsgi-plugin-python36.uwsgi--plugins-dir/usr/lib64/uwsgi--need-pluginpython36,http--http:8080--wsgi-filesrc/djehuty/web/ui.py-H<path-to-your-virtualenv-root>--envDJEHUTY_CONFIG_FILE=config.xml--master--processes4--threads2
Package: dj-elasticsearch-flex
Elasticsearch for Django which lets you do stuff.DocumentationThe full documentation is athttps://dj-elasticsearch-flex.readthedocs.io.QuickstartInstall Django Elasticsearch Flex:pip install dj-elasticsearch-flexAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'elasticsearch_flex.apps.ElasticsearchFlexConfig',...)Add Django Elasticsearch Flex’s URL patterns:fromelasticsearch_fleximporturlsaselasticsearch_flex_urlsurlpatterns=[...url(r'^',include(elasticsearch_flex_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-12-08)First release on PyPI.
Package: djenerics
A collection of Django 1.5+ and Django Rest Framework 3.0+ utilitiesinstallationYou can use pip to install the package:$ pip install djenericsThen add it to the list of installed apps:INSTALLED_APPS = (
    'djenerics'
)model mixinsThe following mixins are available for your model classes:TimestampableProvidescreated_atandupdated_atfields.OwnerableProvides aownerfield which referencessettings.AUTH_USER_MODELview mixinsThe following mixins are available for your view classes:SelectRelatableProvides a class variableselect_relatedthat allows you to provide a
tuple or list of related models to perform a select_related on.django-rest-framework filter backendA custom filter backend that provides a generic filter query string parameter.Convert a search query into a dictionary.A search query like this one:party: stakker is akker category:"hiha hoi"Will be converted to a python dict:{
    'category': 'hiha hoi',
    'party': None,
    'search': 'stakker is akker'
}It uses a regular expression to split every token on the:separator instead of using the string.split() function. This is
important to distinguish between the following use cases:- 'party:'        => {'party': None}
- 'party:tester'  => {'party': 'tester'}
- 'party: tester' => {'search': 'party: tester'}django-rest-framework serializer mixinsThe following mixins are available for your serializer classes:ProjectableGives your api consumers the ability to control what fields are included in
the api response using a configurable query string parameter (defaults to_fields).E.g. aGET /resources?_fields=name,description,countwill only return the
specified 3 fields of theresource.OwnerableLimit the related field options to only those records owned by the current
logged in user.
Package: djenv
DjEnv: Django + EnvironmentLoad Django Settings Directly from Environmental Variablesfeaturesmodify django configuration without modifying source codeprevent hard-coding of Django settingsworks great with Dockerinstallwith pippipinstalldjenvwith pipenvpipenvinstalldjenvbasic usage# inside settings.py# import settings from environmentfromdjenv.settingsimport*Prepend Settings withDJANGO_to import them.  For example:DJANGO_DEBUG=Falsepython3manage.pyrunserverWill set DEBUG=False in the settings.pyadvanced usageYou can also replace nested settings like DATABASES by setting a JSONDJANGO_DATABASES='{ "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": "db.sqlite3" } }'python3manage.pyrunserver
Package: djet
Django Extended Testsis a set of helpers for easy testing of Django apps.Main features:easy unit testing of Django views (ViewTestCase)useful assertions provides as mixin classes:response status codes (StatusCodeAssertionsMixin)emails (EmailAssertionsMixin)messages (MessagesAssertionsMixin)model instances (InstanceAssertionsMixin)handy helpers for testing file-related code (InMemoryStorageMixinand others)smooth integration with Django REST Framework authentication mechanism (APIViewTestCase)Full documentation available onread the docs.Developed bySUNSCRAPERSwith passion & patience.RequirementsPython: 2.7 (Only Django 1.11), 3.4+Django: 1.11, 2.0+(optional)Django REST Framework: 3.7+InstallationSimply install usingpip:$pipinstalldjetDocumentationFull documentation is available to study atread the docsand indocsdirectory.
Package: djet2
Django JETwhatwheremaster testsdev testslive demohttp://demo.jet.geex-arts.com/admin/documentationhttp://jet.readthedocs.org/PyPihttps://pypi.org/project/djet2Why Django JET?New fresh lookResponsive mobile interfaceUseful admin home pageMinimal template overridingEasy integrationThemes supportAutocompletionHandy controlsScreenshotsInstallationDownload and install latest version of Django JET:pipinstalldjet2Add 'jet' application to the INSTALLED_APPS setting of your Django project
settings.py file (note it should be before 'django.contrib.admin'):INSTALLED_APPS=(...,'jet','django.contrib.admin',)Make suredjango.template.context_processors.requestcontext processor
is enabled in settings.py (Django 1.8+ way):TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','DIRS':[],'APP_DIRS':True,'OPTIONS':{'context_processors':[...,'django.template.context_processors.request',...,],},},]Add URL-pattern to the urlpatterns of your Django project urls.py file
(they are needed for related–lookups and autocompletes):urlpatterns=patterns('',path('jet/',include('jet.urls','jet')),# Django JET URLSpath('admin/',include(admin.site.urls)),...)Create database tables:pythonmanage.pymigratejetCollect static if you are in production environment:pythonmanage.pycollectstaticClear your browser cache:firefox/chrome:Cmd+Shift+R(Ctrl+Shift+R) for hard reloadDashboard installationDashboard is located into a separate application. So after a typical JET
installation it won't be active. To enable dashboard application follow these steps:Add 'jet.dashboard' application to the INSTALLED_APPS setting of your Django
project settings.py file (note it should be before 'jet'):INSTALLED_APPS=(...,'jet.dashboard','jet','django.contrib.admin',...,)Add URL-pattern to the urlpatterns of your Django project urls.py file
(they are needed for related–lookups and autocompletes):urlpatterns=patterns('',path('jet/',include('jet.urls','jet')),# Django JET URLSpath('jet/dashboard/',include('jet.dashboard.urls','jet-dashboard')),# Django JET dashboard URLSpath('admin/',include(admin.site.urls)),...,)For Google Analytics widgets onlyinstall python package:pipinstalldjet2[google_analytics]# orpipinstallgoogle-api-python-client==1.4.1Create database tables:pythonmanage.pymigratedashboardCollect static if you are in production environment:pythonmanage.pycollectstatic
Package: djeveric
djevericSimple email confirmation for django model instances withDjango Rest Framework.UsageCreate a modelCreate a model class inheriting fromConfirmableModelMixinwith aConfirmationFieldand refer to aConfirmationEmailclass like this:fromdjango.confimportsettingsfromdjango.dbimportmodelsfromdjeveric.emailsimportConfirmationEmailfromdjeveric.fieldsimportConfirmationFieldfromdjeveric.modelsimportConfirmableModelMixinclassMyModelConfirmationEmail(ConfirmationEmail):subject="Please confirm"defget_body(self,context):returnf"Use this link to confirm: http://my-frontend/confirm/{self.token}"defget_recipient(self)->str:returnself.instance.owner.emailclassMyModel(ConfirmableModelMixin,models.Model):owner=models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)is_confirmed=ConfirmationField(email_class=MyModelConfirmationEmail)When unconfirmed instances of the model are saved, djeveric sends a confirmation email to the specified address.Create a ViewSetTo actually confirm a viewset, your backend needs a view set using theConfirmModelMixin:fromrest_frameworkimportviewsetsfromdjeveric.viewsimportConfirmModelMixinclassMyModelViewSet(ConfirmModelMixin,viewsets.GenericViewSet):queryset=MyModel.objectsOn aPOST /api/my-models/{pk}/confirm/with{"token": "THE TOKEN"}as data the model instance will be confirmed.
Package: dj-experiment
Django application for organizing numerical model experiment outputDocumentationThe full documentation is athttps://dj-experiment.readthedocs.io.QuickstartInstall Experiment:pip install dj-experimentAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'dj_experiment.apps.DjExperimentConfig',...)Add Experiment’s URL patterns:fromdj_experimentimporturlsasdj_experiment_urlsurlpatterns=[...url(r'^',include(dj_experiment_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-07-31)First release on PyPI.