Saravanan666/pypi-org huggingface dataset:
Package: django-redis-sessions
django-redis-sessionsRedis database backend for your sessionsInstallationAvailable SettingsChangelogInstallationRunpip installdjango-redis-sessionsor alternatively download
the tarball and runpython setup.py install,For Django < 1.4 runpip installdjango-redis-sessions==0.3Setredis_sessions.sessionas your session engine, like so:SESSION_ENGINE='redis_sessions.session'Available SettingsSESSION_REDIS={'host':'localhost','port':6379,'db':0,'password':'password','prefix':'session','socket_timeout':1,'retry_on_timeout':False}If you prefer domain socket connection, you can just add this line
instead of HOST and PORT.SESSION_REDIS={'unix_domain_socket_path':'/var/run/redis/redis.sock','db':0,'password':'password','prefix':'session','socket_timeout':1,'retry_on_timeout':False}Redis SentinelSESSION_REDIS_SENTINEL_LIST=[(host,port),(host,port),(host,port)]SESSION_REDIS_SENTINEL_MASTER_ALIAS='sentinel-master'Redis Pool (Horizontal partitioning)Splits sessions between Redis instances based on the session key. You
can configure the connection type for each Redis instance in the pool
(host/port, unix socket, redis url).SESSION_REDIS={'prefix':'session','socket_timeout':1'retry_on_timeout':False,'pool':[{'host':'localhost3','port':6379,'db':0,'password':None,'unix_domain_socket_path':None,'url':None,'weight':1},{'host':'localhost2','port':6379,'db':0,'password':None,'unix_domain_socket_path':None,'url':None,'weight':1},{'host':'localhost1','port':6379,'db':0,'password':None,'unix_domain_socket_path':None,'url':None,'weight':1}]}Tests$pipinstall-rdev_requirements.txt# Make sure you have redis running on localhost:6379$nosetests-vChangelog
Package: django-redis-sessions-fork
info:Redis Session Backend For DjangoFeaturesFast NoSQL Django sessions backendInvalidation viaTTLEasy migrations fromdjango.contrib.sessionsFastest session serializersBackward migrations todjango.contrib.sessionsInstallationrunpip installdjango-redis-sessions-forkor alternatively download the tarball and runpython setup.py installsetredis_sessions_fork.sessionas your session engine, like soSESSION_ENGINE='redis_sessions_fork.session'Configuration# all these options are defaults, you can skip anyoneSESSION_REDIS_HOST='127.0.0.1'SESSION_REDIS_PORT=6379SESSION_REDIS_DB=0SESSION_REDIS_PASSWORD=NoneSESSION_REDIS_PREFIX=None# if you prefer domain socket connection# you can just add this line instead of SESSION_REDIS_HOST and SESSION_REDIS_PORTSESSION_REDIS_UNIX_DOMAIN_SOCKET_PATH='/var/run/redis/redis.sock'# you can also use redis from urlSESSION_REDIS_URL='redis://127.0.0.1:6379/0'# also available setup connection via redis.ConnectionPool likeSESSION_REDIS_CONNECTION_POOL='random.app.redis_connection_pool'if you one of happyheroku.comusersyou can skip redis configuration at alldjango-redis-sessions-forkalready have prefiguration for redis cloudsSerializer’sDjango>=1.5.3supportsdifferent session serializers, such asdjango.contrib.sessions.serializers.PickleSerializeranddjango.contrib.sessions.serializers.JSONSerializeralternative you can useujsonserializer, which is more faster then defaultpip install ujsonthenSESSION_SERIALIZER='redis_sessions_fork.serializers.UjsonSerializer'in addition it is possible to configureujsonencoding, likeSESSION_REDIS_JSON_ENCODING='utf8'# default is 'latin-1'Sessions migrationaddredis_sessions_forkto yourINSTALLED_APPS#copyormsessionstoredispython manage.py migrate_sessions_to_redis#copyredissessionstoormpython manage.py migrate_sessions_to_orm#flushredissessionspython manage.py flush_redis_sessions#flushormsessionspython manage.py flush_orm_sessionsTestspip install tox
tox
Package: django-redis-session-store
Django Redis Session StoreDjango Redis Session is a Django session backend that uses Redis as its session store. This package allows multiple Django applications to share user sessions by using the same Redis database as a common session store.InstallationYou can install Django Redis Session with pip:pipinstalldjango_redis_session_storeConfigurationTo use Django Redis Session, you need to configure several settings in your Django project's settings.py file:SESSION_ENGINE='django_redis_session_store.session_store'SESSION_REDIS_HOST='localhost'SESSION_REDIS_PORT=6379SESSION_REDIS_DB=0SESSION_REDIS_PASSWORD='password'SESSION_REDIS_USER='user'SESSION_REDIS_PREFIX='session'SESSION_REDIS_SOCKET_TIMEOUT=1800SESSION_REDIS_TLS=FalsePlease replace the above settings with the actual configuration details of your Redis server.UsageOnce Django Redis Session is installed and configured, you can use Django sessions as you would normally. The session data is stored in Redis and can be shared between multiple Django applications.Use CaseImagine that you have two Django applications, App1 and App2, both of which require user authentication. When a user logs into App1, a new session is created and stored in the Redis server. Later, the same user tries to access App2. Since App2 uses the same Redis server for session storage, it recognizes the user's session and does not require the user to log in again.This shared session feature is particularly useful in microservices architectures, where you might have multiple services that each require user authentication.LicenseThis project is licensed under the MIT license. For more details, see the LICENSE file.
Package: django-redis-status
#Overview
This app is a clone of [django-memcache-status](https://github.com/bartTC/django-memcache-status) modified to work with Redis. This app displays some statistics for your redis instance in the index view of your Django admin section.#Notes
This app requires a redis cache backend. I recommend [django-redis-cache](https://github.com/sebleier/django-redis-cache).#Usage
Add redis_status to your installed apps.
Package: django-redmine-models
Using django-redmine-modelsDefine the database parameters as usual in theDATABASESsetting then add:REDMINE_DATABASE = "the-redmine-db-key-in-DATABASES"and define (or add) the database router:DATABASE_ROUTERS = ["redmine_models.routers.DatabaseRouter"]By default, it is supposed that an external redmine service is being accessed,
and thus the models are unmanaged.  If that’s not desired, e.g. for testing you
want the test tables to be created automatically, use the following setting:REDMINE_MODELS_MANAGED = TrueThen use the models:from redmine_models.models import Project
print Project.objects.all()
# etc...
Package: django-rednoise
RedNoiseDjango as a framework is great, but file handling within any setup has never been particularly fun to configure. WhiteNoise (https://whitenoise.readthedocs.org/) makes this, to borrow its own term, “radically simplified”, and for the most part I’ve found it to be an ideal solution - though there are a few things I found myself wanting from time to time.RedNoise is a different take on the DjangoWhiteNoise module from WhiteNoise. It aims to be (and as of writing, should be) completely compatible with the existing WhiteNoise API, but takes a different approach on a few things. I consider this an opinionated third-party addon to the WhiteNoise project, however I hope it goes without saying that anything here is up for grabs as a pull request or merge.Getting Startedpip installdjango-rednoiseFollow the WhiteNoise configuration guidelines - they all should work.Modify your wsgi file as follows:fromdjango.core.wsgiimportget_wsgi_applicationfromrednoiseimportDjangoRedNoiseapplication=get_wsgi_application()application=DjangoRedNoise(application)…and that’s it. You can read on for additional configuration options if you think you need them, but the defaults are more or less sane. DjangoRedNoise is the only Class in this package; existing guides/documentation for WhiteNoise should still suffice.Differences from WhiteNoiseRedNoise allows you to serve user-uploaded mediaNote that it performs no gzipping of content or anything; the use case this satisfied (for me, at least) was that users within a CMS
needed to be able to upload images as part of a site; configuring storages and some S3 setup just got annoying to deal with.RedNoise respects Django’s DEBUG flagWhen DEBUG is True, RedNoise will mimic the native Django static files handling routine. With this change, RedNoise can be used while
in development (provided you’re developing with uwsgi) so your environment can simulate a production server. I’ve found this to be
faster than using Django’s static serving in urls.py solution, YMMV.When DEBUG is false, RedNoise mimics WhiteNoise’s original behavior…with two exceptions. One, being that Media can also be served, and two - whereas WhiteNoise scans all static files on startup,
RedNoise will look for the file upon user request. If found, it will cache it much like WhiteNoise does - the advantage of this
approach is that one can add static file(s) as necessary after the fact without requiring a restart of the process.RedNoise 404s directly at the uwsgi level, rather than through the Django applicationPersonally speaking, I don’t see why Django should bother processing a 404 for an image that we know doesn’t exist. This is, of
course, a personal opinion of mine.LicenseMIT LicensedContactQuestions, concerns? ryan [at] venodesigns dot net
Package: django-redux
A re-usable bridge between Django channels and Redux.Quickstart$ pip install django_redux
$ npm install django-channels django_reduxCreate a file calledengine.pyfor your project:from django_redux import action, AsyncReduxConsumer


class MyConsumer(AsyncReduxConsumer):

    async def connect(self, message):
        if message.user.is_authenticated:
            await self.send_json({
                'type': 'SET_USER',
                'user': {
                    'username': self.message.user.username,
                }
            })

    # This method will be called when the `INCREMENT_COUNTER` action gets
    # fired from the JS via the reduxBridge (see below).
    @action('INCREMENT_COUNTER')
    async def incr_counter(self, message):
        await self.send_json({'type': 'INCREMENTED_COUNTER', 'incrementBy': message['incrementBy']})In your js entry point:// app.js

import React from 'react';

import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, } from 'redux';

import reducer from '../reducers';
import Root from '../containers/Root.react';

import { WebSocketBridge } from 'django-channels';
import { eventToAction } from 'django_redux';

const store = createStore(
  reducer,
);


export const reduxBridge = new WebSocketBridge();
reduxBridge.connect("ws://localhost:8000/ws/");
reduxBridge.addEventListener("message", eventToAction(store));

render(
  <Provider store={store}>
    <Root />
  </Provider>,
  document.getElementById('root')
);To send an action from redux:import { createAction } from 'redux-actions';

import ActionTypes from './constants';
import { reduxBridge } from './app';


export const incrementCounter = createAction(ActionTypes.INCREMENT_COUNTER, (incrementBy) => {
  reduxBridge.send({
    type: ActionTypes.INCREMENT_COUNTER,
    incrementBy
  });
});To send an action from the backend:from django_redux import send_action

await send_action('mygroup', {
    'type': 'ACTION_NAME',
    'payload': {'any': 'thing'},
})GroupsAll clients are automatically added to a group called“broadcast”.Authenticated users are automatically added to a group called“user.{user.pk}”so you they can be conveniently addressed.TODO:Testssend_actionData bindingDocsMultiplexingCreditsMost of this code is adapted fromjohnpaulett/channel_chat.
Package: django-referer
django-refererdjango-refereris a Django app fordisplaying different referer details based on a customizable query parameterandkeeping this query parameter while user navigates in the site. It provides sales, partners and affiliates custom links to send out in order to get private traffic.
It gives sales, partners and affiliates their opportunity to convert every contact detail on the website to their own.
It thus encourages sales, partners and affiliates to promote the website and the business.
In addition, with the help of analytics scripts, traffic data can be easily distinguished and analyzed.Demo. URL with referer parametere.g.https://zhujia.com.au/?refer=14(The chosen query parameter is kept by django-referer’s middleware while user navigates between links). URL without referer parameter (falls back to the default referer)e.g.https://zhujia.com.auInstallationUse the package managerpipto install django-referer.pipinstalldjango-refererUsageStep 1. Add referer middleware (in settings.py file)MIDDLEWARE=['referer.middleware.referer.RefererMiddleware',# here'django.middleware.security.SecurityMiddleware','...']Step 2. Add referer context processor (in settings.py file)TEMPLATES=[{'OPTIONS':{'context_processors':['...','django.contrib.messages.context_processors.messages','referer.context_processors.referer',# here],},},]Step 3. Customize referer settings (in settings.py file) (optional)The defaults are:REFERER_LINK_PARAMETER='referer'REFERER_DEFAULT_ID=1# -> ?referer=1REFERER_MODEL_FROM='django.contrib.auth.models'REFERER_MODEL_IMPORT='User'# -> from REFERER_MODEL_FROM import REFERER_MODEL_IMPORTREFERER_IGNORED_LINKS=[]Step 4. Display referer information (in .html file)<ahref="mailto:{{ referer.email }}">Email</a><p>{{ referer.first_name }} {{ referer.last_name }}</p>ContributingIssues and pull requests are welcomed.LicenseMIT©Yifan Ai
Package: django-referer-csrf
django_referer_csrfThis project has 2 goals:Simplifiy django's CSRF protection so that developers don't need to worry about the tokenMake it easier for view code to invoke CSRF protection dynamicallyThe token isn't neededhttps://security.stackexchange.com/a/197269On https sites, django's csrf protection requires that the request's referer header matches the request's host header. This check makes the entire CSRF token redundant. The token check provides no extra security on top of the referer check.Django skips the referer check on non-https sites, which is somewhat advantageous (it means that users who configure their web browsers not submit a referer header can still submit forms).Our validator actually looks for a valid origin header or referer header. Modern browsers follow the (newish) spec, which is to send an origin header with every request other than head/get. This means that if users have the referer header disabled, they can still pass our CSRF check.Usagepip install django_referer_csrfin yourMIDDLEWAREsetting, replacedjango.middleware.csrf.CsrfViewMiddlewarewithdjango_referer_csrf.MiddlewareWith this middleware, you can still use Djangos's csrf_exempt decorators.If you want to apply the CSRF protection based on dynamic conditions in view code, just check to see what the Middleware.process_view() does and replicate that.
Package: django-referral
# django-referral![build status](https://travis-ci.org/byteweaver/django-referral.png)A small django application for marketing using referral links## What is this app good for?Imagine you got a nice website running and you want to make some marketing in order to gain more users.This can be achieved by spreading links/banners over the internet pointing to your website.Now in order to find out how your banners performed you need to know how many users registeredafter clicking on one of your banners. To tell them apart you add some unique GET parameter toeach link. This app will detect those referral parameters and store for each user what referrerlead him to your website.## Key Features* Manual and automatic referrer generation.* Referrer organisation in campaigns.* Automatic associating of referrers with campaigns using patterns.* Referrers will be cached in sessions, so when a user first browses your site and does notimmediately register the referrer will be cached and assigned when the user finally decidesto register. That way you can link to any site and not necessarily a register page.* Very easy integration.* Completely configurable to your needs.* django 1.7 migrations + legacy south support* No dependencies* 100% Test coverage* Supports django 1.4 - 1.7* supports python 2 + 3## Download### using pippip install django-referral### githubhttps://github.com/byteweaver/django-referral## Integration### 1. Add referral to your INSTALLED_APPSINSTALLED_APPS = (...'referral',...)### 2. Add ReferrerMiddleware to your MIDDLEWARE_CLASSESSince django-referral uses django's session middleware make sure you add it after SessionMiddlewareMIDDLEWARE_CLASSES = (...'django.contrib.sessions.middleware.SessionMiddleware','referral.middleware.ReferrerMiddleware',...)### 3. Trigger the referrer association after user creationfrom referral.models import UserReferrer...def my_user_creation_view(request):...UserReferrer.objects.apply_referrer(user, request)## Settings###REFERRAL_GET_PARAMETERThe name of the GET parameter used.Default: "ref"###REFERRAL_SESSION_KEYThe name of the session key that will hold the detected referrerDefault: "referrer"###REFERRAL_AUTO_CREATEDefines whether unknown referrers shall be autocreatedDefault: True###REFERRAL_AUTO_ASSOCIATEDefines whether referrers should be associated to campaigns automatically using patternsDefault: True###REFERRAL_CASE_SENSITIVEDefines whether or referrer names are case-sensitive or not.Default: False## TestingJust run the makefile to set up a virtual environment for testingmakeFor simple testmake testFor coverage reportmake coverageFor full test in all supported environment (requires tox)tox## Changelog### V1.0.0* add django 1.7 support* add pyton3 support* additional test cases* code cleanup* some pep8 fixes
Package: django-refinery
Allows users to filter down a queryset based on a model’s fields, similar to
the Django admin’slist_filterinterface.  AFilterToolhelper class
is provided, which will (by default) map filters to model fields and create
a form for queryset manipulation.  The helper class supports an interface
which will feel familiar to anyone who’s used a DjangoModelForm.Author:Jacob RadfordLicence:BSDExample usageGiven aProductmodel you could create aFilterToolfor it with:import refinery

class ProductFilterTool(refinery.FilterTool):
    class Meta:
        model = Product
        fields = ['name', 'price']And then in your view you could do:def product_list(request):
    filtertool = ProductFilterTool(request.GET or None)
    return render_to_response('product/product_list.html',
        {'filtertool': filtertool})And then in your template:<form action="" method="get">
    {{ filtertool.form.as_p }}
    <input type="submit" />
</form>
<h2>Products</h2>
<ul>
  {% for obj in filtertool %}
      <li>{{ obj.name }} - ${{ obj.price }}</li>
  {% endfor %}
</ul>For more complex usage or custom needs, refer to the project documentation.RequirementsPython 2.5+Django 1.3+Installationpip install-Udjango-refineryAddrefineryto yourINSTALLED_APPSTo install thein-development versionof django-refinery, runpip installdjango-refinery==dev.DocumentationSee thedocsfolder orread it on readthedocsfor expanded
information on:Usage examplesContributingIntegration with other appsProject backgroundLow-level APICreating custom filtersBugsIf you want to help out with the development of django-refinery, by
posting detailed bug reports, proposing new features, or suggesting
documentation improvements, use theissue tracker.  If you want to
fix it yourself, thank you!Fork the project, make changes andsend a pull request.  Please do create an issue to discuss your plans.BackgroundDjango-refinery is based ondjango-filter, an application created
byAlex Gaynor.  For a complete project history and list of contributors,
see the project documentation.RoadmapOverhaul and expand documentationOverhaul and expand test suiteRefactor generic class view (look into pagination of ListView)Allow integration of django-floppyformsAllow integration of django-crispy-formsAllow filters on non-required fields with choices to provide
option of filtering the records that are unset. (i.e. FK is null)Allow abstraction of ordering values used to avoid passing internal
information in GET params (i.e.user__username)Look into adaptingLinkWidgetand overall behavior to support
filtering likedjango-easyfiltersor maybe drop the widget?ResourcesDocumentationBug TrackerCodeContinuous Integration
Package: django_reform
Control of widgets in templates sans BS.InstallationWe are at the cheeseshop:pip install django_reformUsageTo use django_reform in a project:Include it in INSTALLED_APPS in your settings file.Render your forms like so:{% load reform %}
{{ reform form }}Open reform/templates/reform/field.html - by default rendering HTML5 input types. Go ahead and tweak:{% load widget_tweaks reform %}
{% with field_type=field|get_form_field_type %}
    {% if field_type == 'DateField' %}
        {% render_field field type="date" %}
    {% elif field_type == 'EmailField' %}
        {% render_field field type="email" %}
    {% elif field_type == 'URLField' %}
        {% render_field field type="url" %}
    {% else %}
        {{ field }}
    {% endif %}
{% endwith %}Advanced usage - controlling which fields to include, order of the fields as well as number of columns in which the form is rendered. The code below will render a form with the given fields, bootstrap vertical layout, no float and using 3-columns:{% reform form 'email, number, url, time' 'vertical,false,3' %}Sans BS as promised :)History0.1.0 (2013-11-25)First release on PyPI.0.1.1 (2013-11-25)Basic documentation.0.2.0 (2013-12-8)Added replacement for bootstrap_toolkit’s as_bootstrap template filter. The reform template tag passed the original template context to the form templates enabling checks for instance for permissions etc.0.2.1 (2013-12-8)Added bootstrp CDN.0.3.0 (2013-12-10)Added bootstrp for field inclusions and orderings as well a multi-column layouts.
Package: django-reg
A fork of django-registration that works with Django 1.5 and Python 3.3django-registration is a very useful package, and django-reg is a fork intended for complete compatibility with Django 1.5+ and Python 3.3. As formal django-registration releases are made on PyPI, django-reg will match them also on PyPI.INSTALLATIONTo install this application into your virtualenv:$ pip install django-regUSAGEFull documentation is also available online athttps://django-registration.readthedocs.org/. The only difference is the installation is for django-reg, not django-registration.ThanksJames Bennett for the original django-registration package.Alex Clark for stuff.
Package: django-regex
Fields and utilities to work with regular expression in DjangoThe Django regex field provides custom fields and utilities for a Django model that stores a regex.
This provides the ability to easily store regex patterns and access them as compiled regular
expressions from your models.Patterns can be expressed in perl syntax to set regex flags.ComponentsRegexFieldDjango fields to store regular expressionsclassDemoModel(models.Model):regex=RegexField(flags=re.I)o=DemoModel.objects.create(regex='^1$')o.regex.match('1')RegexFlagsFieldAs RegexField but allows to set compilation flags (see:https://docs.python.org/2/howto/regex.html#compilation-flags)
It is rendered with proper widgetfromdjango_regex.validatorsimportcompressimportreclassDemoModel(models.Model):regex=RegexFlagsField()o=DemoModel.objects.create(regex=compress(['aa',re.I]))o.regex.match('AA')o=DemoModel.objects.create(regex=compress(['aa','i']))# use human shortcutso.regex.match('AA')RegexFlagsField stores pattern and flags in the same db column as string in the format<regex.pattern><separator><regex.flags>separator ischr(0)can be customized using settingsDJANGO_REGEX_SEPARATORor per each field usingflags_separatorargument.fromdjango_regex.validatorsimportcompressimportreclassDemoModel(models.Model):regex=RegexFlagsField(flags_separator='/')o=DemoModel.objects.create(regex='aa/i')o.regex.match('AA')RegexListlist that matches content against valid regular expressionsrules=RegexList(['\d*'])1inrules# True'1'inrules# True'a'inrules# FalseLinksStableDevelopmentProject home page:https://github.com/saxix/django-regexIssue tracker:https://github.com/saxix/django-regex/issues?sortDownload:http://pypi.python.org/pypi/django-regex/