Saravanan666/pypi-org huggingface dataset:
Package: django-next-url-mixin
Next url mixin which is safe to phishing attacksNaive implementation of the next URL mechanism is vulnerable to phishing attacks.
This implementation aims toraise awareness of thatprovide safe implementation (possibly seen by more eyes)The mixin does it’s work in form_valid() function, so it can be used for offspring of FormView or simillar view classes.DocumentationThe full documentation is athttps://django-next-url-mixin.readthedocs.io.QuickstartInstall Django next url mixin:pip install django-next-url-mixinUse it in your views:fromdjango.views.generic.editimportFormViewfromnext_url_mixinimportNextUrlMixinclassMyView(NextUrlMixin,FormView):# If you are overriding form_valid(), don't forgot to return the super value with the redirect to the new urldefform_valid(self,*args,**kwargs):return_value=super().form_valid(*args,**kwargs)returnreturn_valueRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.4.0 (2022-08-22)Added support for Django 4.10.3.0 (2022-03-11)Split mixin into GetNextPageMixin to allow usage of only get_next_page()0.2.0 (2020-06-22)Fix saving POST form0.1.0 (2020-06-12)First release on PyPI.
Package: django-next-view
Installation$[sudo]pipinstalldjango-next-viewExamplesfromdjango_next_view.viewsimportNextViewMixinclassMyView(NextViewMixin,...):defpost(self,request,*args,**kwargs):...returnself.next()addnextarg to forms/links<formaction="..."method="POST"><inputtype="hidden"name="next"value="url"/></form><ahref="{% url 'view_name' %}?next=url">GET</a>readme42.com
Package: django-nginx-ssi
Seehttp://wiki.nginx.org/HttpSsiModule{% load nginxssi_tags %}
hello
{% nginxssi %}
    <b> okidoki </b> {%now "jS F Y H:i"%} Hello {{foo}}
{% endnginxssi %}
worldRenders inline as:hello
<!--# include virtual="/nginxssi/a3e5fa678243e0bab620fbca75f6601d/" -->
worldA request to/nginxssi/a3e5fa678243e0bab620fbca75f6601d/renders:<b> okidoki </b> 25th January 2011 13:26 Hello barNginx will stitch these two together to form:hello
<b> okidoki </b> 25th January 2011 13:26 Hello bar
worldHow it worksThe template is cached in its raw unrendered formThe template string’s md5 hash is used as a cache keyThe template’s context is stored with the cache key as a prefixA request to the SSI url looks up the template and the context
in the cache, renders it and returns the HttpResponse
Package: django-nh3
Django integration with for nh3, Python binding to Ammonia HTML sanitizer Rust crate.nh3 docsRequirementsPython 3.10 to 3.12 supported.Django 3.2 to 5.0 supported.ContributingThe project is in it’s infancy, setup because ofbleach becoming deprecated.It is setup with pre-commit to maintain code quality. This includes black for formatting, ruff for linting & checks.
This is much like django, so currently referring to django’s ownstyle docswill be most helpfulTo contribute, fork the repo and clone your fork to your machine. Then setup a virtual environment however you prefer to do this.
Then run the following setup the basics:python-mpipinstallpre-committoxpre-commitinstallTox is used to run tests locally and on github. The test requirements are generated using pip-tools viarequirements/compile.py.
Package: django-niceadmin-ds
django-niceadmin_dsdjango-niceadmin_ds 는 niceadmin-pro v2.4.0을 장고에 맞게 포팅한 장고앱이다.프로젝트에 설치하기niceadmin은 틀을 제공하는 앱이며 각 메뉴에 맞는 앱을 설치하여 추가해야한다. 여기서는 mytesterapp이라고 가정한다.settings.py에 다음 설정을 추가한다.importosINSTALLED_APPS=[...'niceadmin','mytesterapp',...]...# static 파일을 _static 폴더에 저장하도록 설정STATICFILES_DIRS=[os.path.join(BASE_DIR,'_static/'),]프로젝트의 urls.py에 다음을 추가한다.fromdjango.urlsimportpath,includeurlpatterns=[...path('mytesterapp/',include('mytesterapp.urls')),# niceadmin이 제일 밑이어야 한다.path('',include('niceadmin.urls')),]데이터 베이스를 생성한다.python manage.py makemigrations niceadmin mytesterapp
    python manage.py migrate
    python manage.py createsuperuser프로젝트의 구조를 생성한다._data 폴더를 생성하고 contents.py내에 데이터를 형식에 맞게 입력한다.
_static 폴더를 생성하고 각종 이미지 등을 형식에 맞게 저장한다.개별앱에 공통으로 맞춰야 할 것 - ex) mytesterapp에서각 앱에서는 niceadmin의 example을 참고하여 css 태그를 사용한다.contents.py의 sidebar 항목을 앱의 이름과 템플릿 파일에 맞춘다."sidebar_small":{"타이틀":[("서브타이틀","링크(mytesterapp:pages)"),]},"sidebar_big":{"타이틀":[('서브타이틀',"링크(mytesterapp:pages)",'아이콘(bi-person)'),('서브타이틀',"링크(mytesterapp:pages)",'아이콘(bi-envelope)'),],},앱의 urls.py의 구조를 설정한다.app_name='mytesterapp'urlpatterns=[path(f'pages/',views.pages,name='pages'),]앱의 views.py의 구조를 설정한다.defpages(request):c=contents.contextc['breadcrumb']={"title":apps.get_app_config('mytesterapp').verbose_name,"subtitle":"subtitle",}returnrender(request,f'mytesterapp/subtitle.html',c)contents.py의 예시context={}base={# static에 logo.png 파일이 있어야 True 가능."use_logo":True,"seo":{"company_name":"StockAnalyser","url":"","small_title":"주식분석테스트","desc":"","keywords":""},"show_examples":True,"use_profile":True,}context.update(base)sidebar={"sidebar_small":{"title_small":[("subtitle1","mytesterapp:pages"),]},"sidebar_big":{"title_big":[('subtitle2',"mytesterapp:pages",'bi-person'),('subtitle3',"mytesterapp:pages",'bi-envelope'),],},}context.update(sidebar)
Package: django-nicedit
NicEdit widget for django with image upload feature.NicEdit home:http://nicedit.com/Blog post:NicEdit widget for DjangoVersions0.23 - use with Django<1.60.24 - use with Django==1.61.1 - use with Django>=1.7InstallationTo get the latest stable release from PyPi$pipinstalldjango-niceditTo get the latest commit from GitHub$pipinstall-egit+git://github.com/nanvel/django-nicedit.git#egg=niceditAddniceditto yourINSTALLED_APPSINSTALLED_APPS=(...'nicedit',)Add theniceditURLs to yoururls.pyurlpatterns=patterns('',...url(r'^nicedit/',include('nicedit.urls')),)Don’t forget to migrate your databasepythonmanage.pymigrateniceditMEDIA_ROOT should be specified, example:MEDIA_ROOT=os.path.join(os.path.dirname('__file__'),'../media')MEDIA_URL='/media/'Add to urls configuration:fromdjango.conf.urls.staticimportstaticfromdjango.confimportsettingsifsettings.DEBUG:urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)Usageforms.py:fromdjangoimportformsfromnicedit.widgetsimportNicEditWidgetclassMessageForm(forms.Form):message=forms.CharField(widget=NicEditWidget(attrs={'style':'width: 800px;'}))views.py:fromdjango.shortcutsimportrenderfrom.formsimportMessageFormdefhome(request):form=MessageForm()returnrender(request,'home.html',{'form':form})template:<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><title>NicEdit widget</title>{{ form.media }}</head><body><formaction='.'method='post'>{% csrf_token %}
      {{ form.message }}<buttontype="submit">Submit</button></form></body></html>Seetestprojectfor example.Usage in admin:# -*- coding: utf-8 -*-fromdjangoimportformsfromdjango.contribimportadminfromnicedit.widgetsimportNicEditAdminWidgetfrom.modelsimportItemclassItemAdminForm(forms.ModelForm):classMeta:model=Itemwidgets={'text':NicEditAdminWidget(attrs={'style':'width: 610px;'},js_options={"buttonList":['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize',# 'fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor','xhtml']})}classItemAdmin(admin.ModelAdmin):form=ItemAdminFormContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your fork$virtualenv.env--no-site-packages$source.env/bin/activate$pythonsetup.pyinstall$pipinstall-rtest_requirements.txt$gitco-bfeature_branchmaster# Implement your feature and tests$gitadd.&&gitcommit$gitpush-uoriginfeature_branch# Send us a pull request for your feature branch
Package: django-nicha
Nicha is a django package that automates the process of creating the commune web pages,
as well as the main features in any django web application.
Named after mythological girl that knows all the answers and holds the keys to finding purpose on life.Quick Start:Add Nicha to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
        ...
        'nicha',
]Include the nicha URLconf in your project urls.py like this::path(‘nicha/’, include(‘nicha.urls’)),Runpython3 manage.py migrateto create the nicha models.
Package: django-nico
Polls is a Django app to conduct Web-based polls. For each question,
visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'polls',
]Include the polls URLconf in your project urls.py like this:path('polls/', include('polls.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/polls/to participate in the poll.
Package: django-nimble
Jack be nimble, jack be quick.The goal of this project is to provide an open-source tool to facilitate
the management of agile projects in large organisations.InstallationRunpip installdjango-nimbleRunning testssetup.py testConfigurationAuthenticationThe nimble module requires user-authentication. How this is established
is not restricted. All that is required by nimble is that the following
named views are provided: - login - logoutInstalled AppsAdd the following to your INSTALLED_APPS setting:INSTALLED_APPS = (
    ...
    'nimble.apps.NimbleConfig',
    'rest_framework',
    'bootstrap3',
    'markdownx',
    'reversion',
)Since nimble overrides the view of rest_framework API it must appear
above the rest_framework in the list.MiddlewareNimble using django-reversion to track changes to it’s objects. To
utilise this the django-reversion middleware must be included.MIDDLEWARE = [
    ...
    'reversion.middleware.RevisionMiddleware',
]
Package: django-nimbus-api
A Python Extended for Django.Supports Python 2.7, 3.4 or 3.5+Free software: Apache License 2.0On thePython Package Index (PyPI)Python Package Index (PyPI):https://pypi.python.org/pypi/django_nimbus_api/InstallEasiest installation is viapippip install django_nimbus_apiQuick UsageCopyright and LicenseCopyright (c) 2001-2017william.ren@live.cnAll rights reserved.This software is licensed under the Apache License, Version 2.0. The
Apache License is a well-established open source license, enabling
collaborative open source software development.See the “LICENSE” file for the full text of the license terms.
Package: django-nimda
A light weight attempt at spicing up the django admin.IdeaWe wanted to make the admin look more up-to-date without making sacrifices.
These are the main goals and guidelines:Attractive designUpgrading Django version should cause no problemsDrop in replacement, no python coding requiredCompatible with third-party admin widgets and appsKeep most UX patterns from django admin, diversion should need good motivationEdit css first, templates when css is insufficientKeep it very stable, no fast moves, it must workInstallationINSTALLED_APPS = (
    ...
    'nimda',
    ...
    'django.contrib.admin',
    ....
)DevelopmentIf you want to contriute and develop make sure to edit the scss files in the
root of the project. You then need to compile them to css files, this process
can be automatized using node and gulp. First runnpm installin thedjango-nimdadirectory, then rungulpto keep a watcher compiling
scss on the fly outputing css to the correct locations. If you want to
compile manually runnpm build.
Package: django-nine
django-nine- version checking library for Django.PrerequisitesPython 3.7, 3.8, 3.9 and 3.10.Django 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2, 3.0, 3.1, 3.2,
4.0 and 4.1.DocumentationDocumentation is available onRead the Docs.InstallationInstall latest stable version from PyPI:pipinstalldjango-nineOr latest stable version from GitHub:pipinstallhttps://github.com/barseghyanartur/django-nine/archive/stable.zipUsageGet Django versionsIn codeFor example, if Django version installed in your environment is 1.7.4, then
the following would be true.fromdjango_nineimportversionsversions.DJANGO_1_7# Trueversions.DJANGO_LTE_1_7# Trueversions.DJANGO_GTE_1_7# Trueversions.DJANGO_GTE_1_8# Falseversions.DJANGO_GTE_1_4# Trueversions.DJANGO_LTE_1_6# FalseIn templatesWith use of context processorsAddnine.context_processors.versionsto your context processors.TEMPLATES[0]['OPTIONS']['context_processors']+=\['django_nine.context_processors.versions']Or if you are using an old version of Django:TEMPLATE_CONTEXT_PROCESSORS+=['django_nine.context_processors.versions']TestingSimply type:./runtests.pyOr use tox:toxOr use tox to check specific env:tox-epy37Or run Django tests:./manage.pytestnine--settings=settings.testingLicenseGPL-2.0-only OR LGPL-2.1-or-laterSupportFor any security issues contact me at the e-mail given in theAuthorsection.
For overall issues, go toGitHub.AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: django-ninja
^ Please read ^Fast to learn, fast to code, fast to runDjango Ninja - Fast Django REST Frameworkv1.0 What's newRead more details here -https://django-ninja.dev/whatsnew_v1/Or Watch here:Django Ninjais a web framework for building APIs withDjangoand Python 3.6+type hints.Key features:Easy: Designed to be easy to use and intuitive.FAST execution: Very high performance thanks toPydanticandasync support.Fast to code: Type hints and automatic docs lets you focus only on business logic.Standards-based: Based on the open standards for APIs:OpenAPI(previously known as Swagger) andJSON Schema.Django friendly: (obviously) has good integration with the Django core and ORM.Production ready: Used by multiple companies on live projects (If you use django-ninja and would like to publish your feedback, please emailppr.vitaly@gmail.com).Documentation:https://django-ninja.devInstallationpip install django-ninjaUsageIn your django project next to urls.py create newapi.pyfile:fromninjaimportNinjaAPIapi=NinjaAPI()@api.get("/add")defadd(request,a:int,b:int):return{"result":a+b}Now go tourls.pyand add the following:...from.apiimportapiurlpatterns=[path("admin/",admin.site.urls),path("api/",api.urls),# <---------- !]That's it !Now you've just created an API that:receives an HTTP GET request at/api/addtakes, validates and type-casts GET parametersaandbdecodes the result to JSONgenerates an OpenAPI schema for defined operationInteractive API docsNow go tohttp://127.0.0.1:8000/api/docsYou will see the automatic interactive API documentation (provided bySwagger UIorRedoc):What next?Read the full documentation here -https://django-ninja.devTo support this project, please give star it on Github.Share itvia TwitterIf you already using django-ninja, please share your feedback toppr.vitaly@gmail.com
Package: django-ninja-apikey
Django Ninja APIKeyEasy to use API key authentication for Django Ninja REST FrameworkThis is an unofficialDjangoapp which makes iteasyto manage API keys for theDjango Ninja REST Framework.Key Features:Easyintegration in your projectsWell integrated in theadmin interfaceSecureAPI keys due to hashingWorks with thestandarduser modelInstallationpip install django-ninja-apikeyUsageAddninja_apikeyto your installed apps in your django project:# settings.pyINSTALLED_APPS=[# ..."ninja_apikey",]Run the included migrations:python manage.py migrateSecure an api endpoint with the API keys:# api.pyfromninjaimportNinjaAPIfromninja_apikey.securityimportAPIKeyAuth#  ...auth=APIKeyAuth()api=NinjaAPI()# ...@api.get("/secure_endpoint",auth=auth)defsecure_endpoint(request):returnf"Hello,{request.user}!"Or secure your whole api (or a specificrouter) with the API keys:# api.pyfromninjaimportNinjaAPIfromninja_apikey.securityimportAPIKeyAuth#  ...api=NinjaAPI(auth=APIKeyAuth())# ...@api.get("/secure_endpoint")defsecure_endpoint(request):returnf"Hello,{request.user}!"You can create now API keys from django's admin interface.LicenseThis project is licensed under the terms of the MIT license.
Package: django-ninja-auth
Django Ninja Auth: Use Django authentication infrastructure with Django NinjaDjango Ninja Auth is a small python package that leverages the funcionalities ofdjango.contrib.authtoDjangoprojects that use on the exceptionalDjango Ninja. It is only intended to provide cookie-based authentication for front-end web applications.Installpip install django-ninja-auth.Add the router to yourNinjaAPI. Assuming you created a project according toDjango Ninja's tutorialjust follow this template inapi.py:fromninjaimportNinjaAPIfromninja_auth.apiimportrouterasauth_routerapi=NinjaAPI()api.add_router('/auth/',auth_router)Build the front-end infrastructure to interact withyour-api.com/api/auth/🚀.DocumentationIf you followed the steps above, everything should be documented in your OpenAPI/Swagger UI underyour-api.com/api/docs. No unnecessary documentation here 😎.CSRFUnfortunately, Django Ninja willforce you to use CSRF protection. It is your responsibility to build a front-end that takes care of this, adding it in the API's schema does not make sense.If you ask me, I'd just useSESSION_COOKIE_SAMESITE = 'strict'andSESSION_COOKIE_HTTPONLY = True(default) and forget about CSRF attacks. "But there are old browsers that... 😭😭"   - If your cookies get stolen because you use Internet Explorer it's not my fault.Password Reset EmailWhen you call/api/auth/request_password_reset/you only need to provide an email address. If the address corresponds to an actual user, Django will send an email to that address with a token to reset the password of the user (of course, you need to configure email sending in yoursettings.py). By default, the email is built using ahorrendous templateprovided by thedjango.contrib.adminapp. If you are not using such app, Django will complain because the template does not exist. My recommendation is to build your own beautiful template and place it inregistration/password_reset_email.htmlunder some of yourtemplates directories. To build that template you can use the following variables:protocol: usuallyhttporhttps.domain: whatever was before/api/auth/request_password_reset/when the request was made.uid: the user's id in base64.user: an object containing data of the user. You can retrieve the username via{{ user.get_username }}.site_name: your site's name.token: the reset token
Package: django-ninja-extra
Django Ninja ExtraDjango Ninja Extrapackage offers aclass-basedapproach plus extra functionalities that will speed up your RESTful API development withDjango NinjaKey features:AllDjango-Ninjafeatures :Easy: Designed to be easy to use and intuitive.FAST execution: Very high performance thanks toPydanticandasync support.Fast to code: Type hints and automatic docs lets you focus only on business logic.Standards-based: Based on the open standards for APIs:OpenAPI(previously known as Swagger) andJSON Schema.Django friendly: (obviously) has good integration with the Django core and ORM.PlusExtra:Class Based: Design your APIs in a class based fashion.Permissions: Protect endpoint(s) at ease with defined permissions and authorizations at route level or controller level.Dependency Injection: Controller classes supports dependency injection with pythonInjectorordjango_injector. Giving you the ability to inject API dependable services to APIController class and utilizing them where neededRequirementsPython >= 3.6django >= 2.1pydantic >= 1.6Django-Ninja >= 0.16.1Full documentation,visit.ExampleCheckout this sample project:https://github.com/eadwinCode/bookstoreapiInstallationpip install django-ninja-extraAfter installation, addninja_extrato yourINSTALLED_APPSINSTALLED_APPS=[...,'ninja_extra',]UsageIn your django project next to urls.py create newapi.pyfile:fromninja_extraimportNinjaExtraAPI,api_controller,http_getapi=NinjaExtraAPI()# function based definition@api.get("/add",tags=['Math'])defadd(request,a:int,b:int):return{"result":a+b}#class based definition@api_controllerclassMathAPI:@http_get('/subtract',)defsubtract(self,a:int,b:int):"""Subtracts a from b"""return{"result":a-b}@http_get('/divide',)defdivide(self,a:int,b:int):"""Divides a by b"""return{"result":a/b}@http_get('/multiple',)defmultiple(self,a:int,b:int):"""Multiples a with b"""return{"result":a*b}api.register_controllers(MathAPI)Now go tourls.pyand add the following:...fromdjango.urlsimportpathfrom.apiimportapiurlpatterns=[path("admin/",admin.site.urls),path("api/",api.urls),# <---------- !]Interactive API docsNow go tohttp://127.0.0.1:8000/api/docsYou will see the automatic interactive API documentation (provided bySwagger UI):Tutorialsdjango-ninja - Permissions, Controllers & Throttling with django-ninja-extra!- Learn how to use permissions, controllers and throttling with django-ninja-extra
Package: django-ninja-extra-easy
Django Ninja ExtraDjango Ninja Extrais a complete class-based fashion of building and setting up APIs at incredible speed with incredible performance.
It utilizesDjango Ninjacore features without compromising speed.Key features:AllDjango-Ninjafeatures :Easy: Designed to be easy to use and intuitive.FAST execution: Very high performance thanks toPydanticandasync support.Fast to code: Type hints and automatic docs lets you focus only on business logic.Standards-based: Based on the open standards for APIs:OpenAPI(previously known as Swagger) andJSON Schema.Django friendly: (obviously) has good integration with the Django core and ORM.PlusExtra:Class Based: Design your APIs in a class based fashion.Permissions: Protect endpoint(s) at ease with defined permissions and authorizations at route level or controller level.Dependency Injection: Controller classes supports dependency injection with pythonInjectorordjango_injector. Giving you the ability to inject API dependable services to APIController class and utilizing them where neededRequirementsPython >= 3.6django >= 2.1pydantic >= 1.6Django-Ninja >= 0.16.1Django-Ninja BenchmarkDjango-Ninja-ExtrausesDjango-Ninjaunder the hood, it can be assumed that Django-Ninja-Extra has the same benchmark with Django-NinjaFull documentation,visit.ExampleCheckout this sample project:https://github.com/eadwinCode/bookstoreapiInstallationpip install django-ninja-extraAfter installation, addninja_extrato yourINSTALLED_APPSINSTALLED_APPS=[...,'ninja_extra',]UsageIn your django project next to urls.py create newapi.pyfile:fromninja_extraimportNinjaExtraAPI,api_controller,http_getapi=NinjaExtraAPI()# function based definition@api.get("/add",tags=['Math'])defadd(request,a:int,b:int):return{"result":a+b}#class based definition@api_controllerclassMathAPI:@http_get('/subtract',)defsubtract(self,a:int,b:int):"""Subtracts a from b"""return{"result":a-b}@http_get('/divide',)defdivide(self,a:int,b:int):"""Divides a by b"""return{"result":a/b}@http_get('/multiple',)defmultiple(self,a:int,b:int):"""Multiples a with b"""return{"result":a*b}api.register_controllers(MathAPI)Now go tourls.pyand add the following:...fromdjango.urlsimportpathfrom.apiimportapiurlpatterns=[path("admin/",admin.site.urls),path("api/",api.urls),# <---------- !]Interactive API docsNow go tohttp://127.0.0.1:8000/api/docsYou will see the automatic interactive API documentation (provided bySwagger UI):What next?To support this project, please give star it on Github