Saravanan666/pypi-org huggingface dataset:
Package: django-neurobank
django-neurobankThis is a Django application that provides name resolution services toneurobank* using an HTTP API.The data management strategy behindneurobankis simple: every resource gets a unique identifier. As long as you use the correct identifier, you can unambiguously locate the resource. Resources includesources, which are used to control an experiment, anddata, which result from running the experiment. Identifiers can be pretty much anything that's encodable in a URL and isn't too long. You can use manually-assigned identifiers likest32_1_2_1or let the API generate short, memorable codes likeheengei8To use this strategy, you need to be able to do two things: register each resource you create somewhere, and then resolve resource names to locations so that you can access your data. Being able to attach searchable metadata to your resources is pretty handy, too. This software provides a backend for these tasks. You'll also needneurobankor some other client software to take care of storing your files.This software is licensed for you to use under the BSD License. See COPYING for detailsQuick startRequires Python 3.8+ and Django 4.0+Install the package:pip install django-neurobankAddneurobankto your INSTALLED_APPS setting like this:INSTALLED_APPS=(...'nbank_registry',)You'll also need to addrest_frameworkanddjango_filters.
Sinceneurobankusesdjango-sendfile2to efficiently serve large files, you will need to setsettings.SENDFILE_BACKENDand possibly other keys, depending on which reverse proxy you are using. Consultthe documentation for django-sendfile2for details.Include the neurobank URLconf in your project urls.py like this::url(r'^neurobank/',include(nbank_registry.urls')),Runpython manage.py migrateto create the database tables.Start the development server and point your browser tohttp://127.0.0.1:8000/neurobank/to view records and inspect the API.Using the registryDocumentation is still in progress. We need a list of endpoints and supported verbs. However, the interface can be accessed through a browser.Deleting is not supported in the HTTP API. A fundamental concept behind a registry is that resources have unique identifiers, which are never re-used or changed. You can edit locations, metadata, and other attributes using PUT. If you desperately need to change a name or delete an identifier, you'll have to use the Django database admin or directly access the backing database.This application is still under development, and you should probably only allow access from trusted networks. Authentication is required to modify or add resources, archives, or data types. Authentication uses the django user app, and credentials are sent in plain text. Your site should only be deployed as a reverse proxy behind an encrpyting https-enabled web server like nginx.
Package: django-never-cache-post
A simple middleware to work around a bug in iOS 6 that caches the results of
$.ajax POST requests inappropriately. (See [“Is Safari on iOS 6 caching $.ajax results?”](http://stackoverflow.com/q/12506897/400691) on Stack Overflow.)This solution is inspired by [Meilo’s answer to “Fighting client-side caching in Django”](http://stackoverflow.com/a/5882033/400691), also on Stack Overflow.InstallationInstall from pypi.pip install django-never-cache-postIn your settings:Add‘never_cache_post’toINSTALLED_APPS.Add‘never_cache_post.middleware.NeverCachePostMiddleware’toMIDDLEWARE_CLASSES.
Package: django-newauth
django-newauthSee the docs at:http://django-newauth.rtfd.io/Run tests using tox:$ toxLinksPyPIDocumentationRepositoryLICENSEBSD License.ChangeLogRelease 0.42 (Unreleased)Release 0.41 (2022-08-16)Fixed: django.conf.urls.url() is deprecated. Also, path() is more concise than re_path(). Change to use path().Fixed: django.shortcuts.render_to_response() is deprecated, change to use django.shortcuts.render().Fixed: django.utils.translation.ugettext_lazy() is deprecated, change to use django.utils.translation.gettext_lazy().Fixed: django.utils.encoding.force_text() is deprecated, change to use django.utils.encoding.force_str().Fixed: Deprecated assertEquals() in unittest used by Django, changed to assertEqual().Release 0.40 (2021-12-28)Support Django-3.2Support Python-3.7, 3.8, 3.9, 3.10Drop Django-1.11, 3.1Drop Python-2.7Release 0.39 (2020-04-30)Fixed: If login_required is used with Python3, login authentication after the second time fails.Support Django-2.2Drop Django-1.10Release 0.38 (2018-09-20)Add missing classifiers: py36, dj versions.provide universal wheelAdd feature: send logged in signal & logged out signalSecurity: masking sensitive post parameterSecurity: safe redirect url for open redirect possibilitySecurity: strict safety check for redirect urlRelease 0.37 (2017-05-15)Support Python-3.6Support Django-1.11Drop Django-1.9Release 0.36 (2016-12-14)Fixed: issue #7 Exception Type: AttributeError at /logout/Release 0.35 (2016-11-30)‘newauth.middleware.AuthMiddleware’ supportssettings.MIDDLEWAREsince django-1.10Release 0.34 (2016-11-25)Support Django-1.10Drop Django-1.7 or earlierProvide documentation on ReadTheDocs:http://django-newauth.rtfd.io/Release 0.33 (2016-02-01)More support Django-1.8 & 1.9Release 0.32 (2016-01-19)Support Django-1.8 & 1.9
Package: django-new-cart
NOTICEThis frameworks is a fork of another with the same name... Some improvement were made with the target in mind that increase the capabilities of the django-cartINSTALATIONpip3 install django-new-cartUSAGEThe target of this module is to allow programmers to handle easily the cart of his/her shop web app...Update urls.py with this urlurlpatterns+=[path("cart/add/<id>/",add,name="cart_add"),path("cart/add/<id>/<quantity>/",add_quant,name="cart_add_quantity"),path("cart/remove/<id>/",remove,name="cart_remove"),path("cart/remove/<id>/<quantity>/",remove_quant,name="cart_remove_quantity"),path("cart/clear/",cart_clear,name="cart_clear"),path("cart/pop/",cart_pop,name="cart_pop"),path("cart/clear/<id>/",item_clear,name="cart_clear_id"),path("cart/details/<id>/",cart_detail,name="cart_details"),path("cart/update/",update_cart,name="cart_update"),]Adding an element@require_POSTdefadd(request:HttpRequest,id:int):cart=Cart(request)cart.add(product=Products.objects.filter(id=id).first())returnJsonResponse({"result":"ok","amount":cart.session[CART_SESSION_ID].get(id,{"quantity":0})["quantity"]}Get details of the cart@require_POSTdefcart_detail(request:HttpRequest,id:int):returnJsonResponse({"result":Cart(request).get_item(id)})Cleaning the cart@require_POSTdefcart_clear(request:HttpRequest):Cart(request).clear()returnJsonResponse({"result":"ok","amount":0})Remove all elements of a type from cart@require_POSTdefitem_clear(request:HttpRequest,id:int):cart=Cart(request)cart.remove(product=Products.objects.filter(id=id).first())returnJsonResponse({"result":"ok","amount":cart.get_sum_of("quantity")})Removing N elements from cart@require_POSTdefremove_quant(request:HttpRequest,id:int,quantity:int):Cart(request).add(product=Products.objects.filter(id=id).first(),quantity=quantity,action="remove")returnJsonResponse({"result":"ok"})Remove element@require_POSTdefremove(request:HttpRequest,id:int):Cart(request).decrement(product=Products.objects.filter(id=id).first())returnJsonResponse({"result":"ok"})Pop last element@require_POSTdefcart_pop(request:HttpRequest,):cart=Cart(request)cart.pop()returnJsonResponse({"result":"ok","amount":cart.get_sum_of("quantity")})Adding N elements to cart@require_POSTdefadd_quant(request:HttpRequest,id:int,quantity:int):cart=Cart(request)cart.add(Producsts.objects.filter(id=id).first(),quantity)returnJsonResponse({"result":"ok","amount":cart.session[CART_SESSION_ID].get(id,{"quantity":quantity})["quantity"]})
Package: django-newrelic-extensions
This package provides a Django middleware class that attaches custom attributes
to the stack trace that the New Relic agent sends to your console.  For
example, if a server error occurs you may wish to know the username of the user
who received it.InstallationInstall via pip:$ pip install django-newrelic-extensionsOr from Github:$ pip install -e git://github.com/sheepdoginc/django-newrelic-extensions.git#egg=django-newrelic-extensionsAdd the middleware class to yourMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'newrelicextensions.middleware.NewRelicMiddleware',
)And then add your settings.SettingsNEW_RELIC_EXTENSIONS_ENABLED: This allows you to disable the extensions
during development. (Default:False)NEW_RELIC_EXTENSIONS_DEBUG: This enables the extensions but instead of
sending trace backs to New Relic, it prints them out to the console.
(Default:True)NEW_RELIC_EXTENSIONS_ATTRIBUTES: This is how you specify what attributes
of the DjangoHttpRequestinstance you care about.  This should be adict.
Please see below for examples.ExamplesNEW_RELIC_EXTENSIONS_ATTRIBUTES = {
    'user': {
        'username': 'Django username',
        'is_superuser': 'Django super user'
    },
    'is_secure': 'Django secure conneciton',
    'something random': 'Name'
}This will log the user’s username under the key ofDjango usernameand so
on.  If a variable is callable (likeis_secureabove), it will be called.
If it doesn’t exist, it will silently die (unless you have debug on).For a list of examples attributes that you can log, see theHttpRequest docs.To learn more about New Relic’s Python integration, please see theirPython
tips and trickspage.LicenseBSD, short and sweet.
Package: django-newrelic-plugin-agent
Django New Relic Plugin AgentPublish arbitrary metrics to New Relic without having to build plugins with the New Relic SDK (Java, .NET)https://docs.newrelic.com/docs/plugins/plugin-developer-resources/developer-reference/plugin-api-specificationInstallationTo install the latest release, type:pip install django-newrelic-plugin-agentTo install the latest code directly from source, type:pip install git+git://github.com/ambitioninc/django-newrelic-plugin-agent.gitDocumentationFull documentation is available athttp://django-newrelic-plugin-agent.readthedocs.orgLicenseMIT License (see LICENSE)
Package: django-news
RSS feed aggregation with Django, including support for infinite-depth
categorization and per-category keyword whitelists.To install, run the following command inside this directory:python setup.py installOr if you’d prefer you can simply place the includednewsdirectory somewhere on your Python path, or symlink to it from
somewhere on your Python path.Addnewsto your project’ssettings.pyfile.Dependenciesfeedparserhttp://www.feedparser.org/Check it outhttp://www.charlesleifer.com/news/
Package: django-newsletter2go
An email backend for Django that uses Newsletter2Go transactional emailsDocumentationThe full documentation is athttps://django-newsletter2go.readthedocs.org.QuickstartInstall django-newsletter2go:pip install django-newsletter2goUse it in a project by adding this to your settings:INSTALLED_APPS += ('newsletter2go', )
NEWSLETTER2GO_API_KEY = 'asdf'  # Your API key
EMAIL_BACKEND='newsletter2go.backends.Newsletter2GoEmailBackend'Then you can use it as normal with the Django mail module:https://docs.djangoproject.com/en/1.8/topics/email/FeaturesTODOHistory0.2.0 (2015-10-01)Linktracking and Opentracking are now configurable.0.1.0 (2015-05-27)First release on PyPI.
Package: django-newsletters
# django-newslettersWARNING: This app is in early development (pre-alpha) and may not work as intended, change rapidly or break something. Please wait for a stable release or at least for an alpha or beta release.Template for reusable django applications.All following sections are just dummies and may not work as excepted.## Key features* Reusable template for new reusable django applications* ...## InstallationIf you want to install the latest stable release from PyPi:$ pip install django-newslettersIf you want to install the latest development version from GitHub:$ pip install -e git://github.com/byteweaver/django-newsletters#egg=django-newslettersAdd `newsletters` to your `INSTALLED_APPS`:INSTALLED_APPS = (...'newsletters',...)Hook this app into your ``urls.py``:urlpatterns = patterns('',...url(r'^your-url/$', include('newsletters.urls', namespace='newsletters')),...)
Package: django-newsletter-subscription
Another newsletter subscription app.Subscription flowUser enters his/her email address on/newsletter/.A mail is sent to the given address containing a link of the form/newsletter/s/<signed_email_address>/.Upon visiting the link the user is immediately subscribed for the newsletter.
Optionally, a form asking the user for additional data is shown.Unsubscription flowThe user enters his/her email address on/newsletter/and is immediately
unsubscribed.An email is sent to the user informing him/her that the unsubscription took
place. A link is provided to immediately subscribe again in case the
unsubscription was not meant to take place. The link is of the form/newsletter/r/<signed_email_address>/.Subscription modelThe minimal set of database fields is as follows:email(EmailField, unique)is_active(BooleanField, defaults toFalse)UsageThis example assumes you are using at least Django 1.4.Installdjango-newsletter-subscriptionusing pip.Add a concrete model inheritingnewsletter_subscription.models.SubscriptionBasewith optionally
additional fields about the subscription. You should be prepared to work
without those additional fields – their presence is not enforced as per
the subscription flow description above. A full example:fromdjango.dbimportmodelsfromdjango.utils.translationimportugettext_lazyas_fromnewsletter_subscription.modelsimportSubscriptionBaseclassSubscription(SubscriptionBase):full_name=models.CharField(_('full name'),max_length=100,blank=True)Add the URLconf entry:from.newsletter.modelsimportSubscriptionfromnewsletter_subscription.backendimportModelBackendfromnewsletter_subscription.urlsimportnewsletter_subscriptions_urlpatternsurlpatterns+=patterns('',url(r'^newsletter/',include(newsletter_subscriptions_urlpatterns(backend=ModelBackend(Subscription),)),),)Register your own subscription model withdjango.contrib.admin.Addnewsletter_subscriptiontoINSTALLED_APPSif you want to use
the bundled templates. The templates requireTowel’stowel_form_tagstemplate tag library.Ensure that Django’smessages frameworkis activated and that the messages are included in your templates, otherwise
the notifications fromdjango-newsletter-subscriptionswill not be shown to the
users.
Package: django-newswall
This is my version of a Tumblelog. Why, you might ask? Because I can.Installation and usageAddnewswalltoINSTALLED_APPSRun./manage.py migrate newswall(orsyncdb, if you prefer to work
without South)Add the following line to yoururls.py:url(r'^news/', include('newswall.urls')),Add news providers by create a fewSourceobjects through Django’s
admin panelCreate a cronjob running./manage.py update_newswallperiodically (i.e.
every hour)Providersnewswallhas a few bundled providers, those being:ElephantblogAdds news entries for every active entry in a elephantblog installation on the
same website. No additional configuration required (or possible). Add the
following JSON configuration to theSourceentry:{"provider": "newswall.providers.elephantblog"}Facebook Graph FeedThis provider adds news entries for every wall post on a Facebook page. The
wall posts are accessed through the Graph API; you’ll need a copy of the Python
Facebook SDK somewhere on your Python path. You’ll need an access token withoffline_accesspermission for this provider. Required configuration
follows:{"provider": "newswall.providers.fb_graph_feed",
"object": "FEINHEIT",      // used to construct the Graph request URL
"from_id": "239846135569", // used to filter stories created by the
                           // object referenced above, ignores stories
                           // sent by others
"access_token": "..."
}We suggest to use App Access Tokens to query the Facebook Page feed, because they don’t expire.
To get an App Access Token, simply open this URL with your browser, after
filling in the required fields (the all caps words):https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentialsMore infos according the App Access Tokens can be found on the official Facebook documentation:
<https://developers.facebook.com/docs/opengraph/using-app-tokens/>To obtain the “from_id” configuration parameter, you can query the Facebook Open Graph
API Backend with your Browser:https://graph.facebook.com/OBJECTf.e.:
<https://graph.facebook.com/FEINHEIT>RSS FeedThe RSS feed provider can take any RSS or Atom feed (in fact anything parseable
byfeedparserand turn the stories into news entries:{
"provider": "newswall.providers.feed",
"source": "http://twitter.com/statuses/user_timeline/unsocialrider.rss"
}Twitter API FeedRequired: tweepyUsage:Create a twitter app.
You’ll find the consumer_key/secret on the detail page.
Because this is a read-only application, you can create
your oauth_token/secret directly on the bottom of the app detail page.Required configuration keys:{
"provider": "newswall.providers.twitter",
"user": "feinheit",
"consumer_key": "...",
"consumer_secret": "...",
"oauth_token": "...",
"oauth_secret": "..."
}
Package: django-nexmo
# django-nexmo`django-nexmo` is a tiny Django app to send sms using the Nexmo provider.## InstallationInstallation using pip is simple:$ pip install django-nexmoAdd the `nexmo` app to your installed applications:INSTALLED_APPS = (…'nexmo',…)## ConfigurationYou need to add a few lines in your `settings.py` file for django-nexmo to work:NEXMO_USERNAME = 'username'NEXMO_PASSWORD = 'password'NEXMO_FROM = 'Name or phone'Did I mention that you need a [Nexmo account](https://www.nexmo.com/)?Seems quite obvious to me.## Basic usageThe `nexmo` apps gives you access to a shortcut to send text messages easily.from nexmo import send_messagesend_message('+33612345678', 'My sms message body')Is that all? Yes… for now.## Advanced usage`django-nexmo` embeds [libpynexmo by Marco Londero](https://github.com/marcuz/libpynexmo).Therefore, you can import and use the `NexmoMessage` class to manually forgerequests to the Nexmo API.from nexmo.libpynexmo.nexmomessage import NexmoMessageparams = {'api_key': settings.NEXMO_USERNAME,'api_secret': settings.NEXMO_PASSWORD,'type': 'unicode','from': settings.NEXMO_FROM,'to': to,'text': message.encode('utf-8'),}sms = NexmoMessage(params)response = sms.send_request()## Handling callbacksNexmo can call one of your urls to send further details about a text message processing.`django-nexmo` provides a very basic callback handler that does nothing but loggingNexmo calls.In your main `urls.py` file:urlpatterns = patterns('',…url(r'^nexmo/', include('nexmo.urls')),…)This will declare a callback view accessible through thehttp://your-site.url/nexmo/callback/ url.Copy this url and paste it in the "Callback URL" section of your "API settings"section of your Nexmo.com account.
Package: django-nextjs-i18
This is a django implementation of next js exported i18next files. The package helps you use exported next js i18next multilanguage files without writing any url or views with django on its backend. Useage is simple.Implement next js i18next multilanguage with static props. For example we are using 'en', 'ru', 'es', 'it','fr','ar' and 'ar' languages in i18next.Export next js file in a banch inside backend project then direct django staticfiles directory to out folder.Import the package and write the languages that you exported in nextjs-i18 as written below.# urls.pyfromdjango-nextjs-i18importi18_language_listi18=i18_language_list(default='en',others=['ru','es','it','fr','ar'])template_path=i18.template_pathapp_name='home'urlpatterns=[# Hometemplate_path('','.html',name='home'),# FAQtemplate_path('faq/','/faq.html',name='faq'),# Terms And Conditionstemplate_path('termsandconditions/','/termsandconditions.html',name='terms_and_conditions'),# Abouttemplate_path('about','/about.html',name='about'),]urlpatterns=i18.urlpatterns(urlpatterns)This code generates 6 urls for each template_path that you write in urlpatterns. So you can enter 127.0.0.1:8000 for default('en' in this example) language. Then 127.0.0.1:8000/ru for 'ru' - Russian version and 127.0.0.1:8000/es for 'es' - Spanish version. and etc.You can also use method_path for more custom viewsdefmyfunctionview(request,static_path):print(static_path)# It will create 6 views and urls in our case(en, ru es,'it','fr','ar') but you can create as many as you wantreturnrender(request,static_path+'/home.html')method_path=i18.template_pathurlpatterns=[# Homemethod_path('',myfunctionview,name='home'),]
Package: django-nextpage
Django NextPagedjango-nextpageis modified from django-pagination, but only previous and next page is provided.Since SQL COUNT statement on large table has poor performance, lots of website turns to show just next  and previous page link or button.How it works?django-nextpageonly execute one SQL statement, no count, no next page determine query.For example:If you want to pagiante by 20, django-nextpage will query for 21 items, if queryset length is 21, then we have next page; if queryset length is 20 or less, then we don't have next page.InstallationAddnextpagetoINSTALLED_APPS, like:INSTALLED_APPS=(# ...'nextpage',)andTEMPLATE_CONTEXT_PROCESSORSshould havedjango.core.context_processors.request, like:("django.core.context_processors.auth","django.core.context_processors.debug","django.core.context_processors.i18n","django.core.context_processors.media","django.core.context_processors.request")UsageJust likedjango-pagination, in fact it designed as a drop-in replacement. just loadnextpagetemplatetag{%loadnextpage%}{%autopaginateobject_list20%}{%paginate%}or you can assign with different pagination template intemplates/nextpagefolder by{% paginate "your_own_pagination.html" %}
Package: django-next-prev
Circle CIcodecovLatest VersionPurposedjango-next-prev provides utilities to get the next or previous item
within an ordered, filtered queryset. For example, you could display a
link to the next featured post on a post detail page, or show
chronological next and previous links for all published posts.InstallationDownload the source fromhttps://pypi.python.org/pypi/django-next-prev/and runpython setup.py install, or:> pip install django-next-prevDjango 1.8 or higher is required.Quick startGiven this models.py:fromdjango.dbimportmodelsclassCategory(models.Model):title=models.CharField(max_length=100)classPost(models.Model):title=models.CharField(max_length=100)category=models.ForeignKey(Category,on_delete=models.CASCADE)created=models.DateField()featured=models.BooleanField(default=False)text=models.TextField()classMeta:# order on primary key to make sure it's uniqueordering=('created','title','pk')You can do the followingfromnext_previmportnext_in_order,prev_in_orderfrom.modelsimportPost# default orderingfirst=Post.objects.first()second=next_in_order(first)prev_in_order(second)==first# Truelast=prev_in_order(first,loop=True)# custom orderingqs=Post.objects.all().order_by('-created','-pk')newest=qs.first()second_newest=next_in_order(newest,qs=qs)oldest=prev_in_order(newest,qs=qs,loop=True)# filteredqs=Post.objects.filter(featured=True)first_featured=qs.first()second_featured=next_in_order(first_featured,qs=qs)Ordering considerationsOrder fields must be non-nullable.If results are inconsistent with the order of your queryset, you’re
probably ordering on a non-unique combination of fields. For example,ordering = ('sort_order', )with the duplicatesort_ordervalues. To resolve this, add a unique field to your ordering, i.e.ordering = ('sort_order', 'pk')