Saravanan666/pypi-org huggingface dataset:
Package: django-conversation
A reusable Django app that provides threaded conversations between users.InstallationTo get the latest stable release from PyPi$pipinstalldjango-conversationTo get the latest commit from GitHub$pipinstall-egit+git://github.com/bitmazk/django-conversation.git#egg=conversationTODO: Describe further installation steps (edit / remove the examples below):Addconversationto yourINSTALLED_APPSINSTALLED_APPS=(...,'conversation','django_libs',)Add theconversationURLs to yoururls.pyurlpatterns=patterns('',...url(r'^conversation/',include('conversation.urls')),)Don’t forget to migrate your database./manage.pymigrateconversationUsagePlease add the following files to your base.html<linkrel="stylesheet"href="{% static "conversation/css/conversation.css"%}"><scriptsrc="{% static "conversation/js/conversation.js"%}"></script>The conversations in this app are threaded, that means a conversation is
related to one object. In this case the object is a user. So ifuser1starts a conversation withuser2all messages between those users are
stored in one conversation (you know it, if your are e.g. a Facebook user).This app allows another relation, so you can also add a content object to a
conversation between two users. Let’s say you built a sports app.user1wants to talk withuser2about a fight calledKlitschko vs. Tyson. They
can now start a conversation, which is also related to that fight. But, they
can also start a new conversation about other fights or talk to each other
without another relation, for sure.If you have executed the tasks written above, the app is ready to work.
Note: The templates are based on Twitter Bootstrap (http://getbootstrap.com/).
If you don’t use it, simply overwrite them.In almost every case you want to customize stuff, add jQuery/JavaScript, add
CSS, your own templates and so on, so this app is kept very simple.SettingsCONVERSATION_MESSAGE_FORMDefault: NoneIf you want to use your own message form, you can define it here.CONVERSATION_MESSAGE_FORM='my_app.forms.MyMessageForm'CONVERSATION_ENABLE_DIGESTDefault: TrueYou can enable digests of unread messages by running./manage.py send_message_digest.If you want to disable the digest you can set the setting toFalse.CONVERSATION_ENABLE_DIGEST=FalseCONVERSATION_ENABLE_NOTIFICATIONSDefault: TrueYou can enable instant email notification, which are sent each time a new
message has arrived.If you want to disable notifications you can set the setting toFalse.CONVERSATION_ENABLE_NOTIFICATIONS=FalseUser specific notification settingsYou can also disable notifications for single users by adding an attribute to
your user model. Name itdisable_conversation_notifications.ContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your forkmkvirtualenv-ppython2.7django-conversationmakedevelopgitco-bfeature_branchmaster# Implement your feature and testsgitadd.&&gitcommitgitpush-uoriginfeature_branch# Send us a pull request for your feature branchIn order to run the tests, simply executetox. This will install two new
environments (for Django 1.8 and Django 1.9) and run the tests against both
environments.
Package: django-conversejs
This app aims to make easier to integrateConverse.jsinto Django.Currentlydjango-conversejsprovides:A minified distribution of converse.jsTemplate tags to help you to include converse.js on your Django projectA database model to store the XMPP user and password for each userConverse.js configurations through settings.pySingle-sign-on (SSO) like experienceInstalling and configuringInstall SleekXMPP fromTracyWebTech/fix-geventbranch:pip install git+https://github.com/TracyWebTech/SleekXMPP@fix-geventInstall django-conversejs:pip install git+https://github.com/TracyWebTech/django-conversejsAddconversejsto installed apps in your settings.py:INSTALLED_APPS={...'conversejs',...}Configure the BOSH service URL in your settings.py:CONVERSEJS_BOSH_SERVICE_URL='https://my-bosh-service.com'Load the static files in your templates using django-conversejs custom tags:{%loadconversejs%}...<head>...{%conversejs_static%}...</head>Load the chat panel and the Javascript initilizalizer also using our custom tags:{%loadconversejs%}...{%conversejs_chatpanel%}{%conversejs_initialize%}</body>Update database schema:python manage.py syncdb
python manage.py migrate # optionalAdding an XMPP accountLog in the Django AdminAdd an XMPP account by clicking in the ‘+ Add’ buttonChoose the user from the select box and them type the JabberID and password for the accountNow everytime the select user your logs in your site he will be automatically logged in the XMPP
server using the credentials you provided.Enabling XMPP auto registrationBy enabling auto registrationdjango-conversejswill attempt to create a new
XMPP account for every user that doesn’t have one as soon as they login in your site.To enable you just need to add theCONVERSEJS_AUTO_REGISTERoption to your
settings.py setting it to the domain of your XMPP service. Notice that the XMPP
server and the BOSH service URL are two different things.For example:CONVERSEJS_BOSH_SERVICE_URL='https://my-bosh-service.com'CONVERSEJS_AUTO_REGISTER='xmpp.mycompany.com'In the example above Django will get the username fromrequest.user.usernameand
try to register under the xmpp domainxmpp.mycompany.com, so if an user john logs in it would try to registerjohn@xmpp.mycompany.com.If registration fails for any reasondjango-conversejswill attempt again on every request. That’s something to be improved.FormsIf you want to create custom forms to keep the look and feel of your site you can use
conversejs.forms as a start point.Converse.js VersionWe currently ship Converse.jsv0.6.4 (patched).If you need a newer version, please open an issue or a pull request.TODOWrite testsAllow user reset XMPP account password. That’s useful to allow the use of other xmpp clients.Allow user to set avatarAuto update XMPP name and email when those are updated in django (using signals)
Package: django-cookiebanner
Django-CookiebannerInstallationpip install django-cookiebannerUsageAddcookiebannerto yourINSTALLED_APPSin your settings (settings.py) specify the different Cookie Groups:fromdjango.utils.translationimportgettext_lazyas_COOKIEBANNER={"title":_("Cookie settings"),"header_text":_("We are using cookies on this website. A few are essential, others are not."),"footer_text":_("Please accept our cookies"),"footer_links":[{"title":_("Imprint"),"href":"/imprint"},{"title":_("Privacy"),"href":"/privacy"},],"groups":[{"id":"essential","name":_("Essential"),"description":_("Essential cookies allow this page to work."),"cookies":[{"pattern":"cookiebanner","description":_("Meta cookie for the cookies that are set."),},{"pattern":"csrftoken","description":_("This cookie prevents Cross-Site-Request-Forgery attacks."),},{"pattern":"sessionid","description":_("This cookie is necessary to allow logging in, for example."),},],},{"id":"analytics","name":_("Analytics"),"optional":True,"cookies":[{"pattern":"_pk_.*","description":_("Matomo cookie for website analysis."),},],},],}In your base template add the banner and the conditionals:{% load cookiebanner %}
...
<body>
{% cookiebanner_modal 'vanilla' %}
...

<button onclick="document.querySelector('#cookiebannerModal').classList.remove('hidden')">change cookie preferences</button>

{% cookie_accepted 'analytics' as cookie_analytics %}
{% if cookie_analytics %}
<script>... javascript for matomo ...</script>
{% endif %}
</body>Custom TemplateYou can create a custom template and use that instead of the default one.Create a foldercookiebanner/and a file in one of yourtemplates/-folders, e.g.:templates/cookiebanner/mytemplate.htmlUse{% cookiebanner_modal 'mytemplate' %}
Package: django-cookie-consent
Django cookie consentManage cookie information and let visitors give or reject consent for them.Featurescookies and cookie groups are stored in models for easy management
through Django admin interfacesupport for both opt-in and opt-out cookie consent schemesremoving declined cookies (or non accepted when opt-in scheme is used)logging user actions when they accept and decline various cookieseasy adding new cookies and seamlessly re-asking for consent for new cookiesDocumentationThe documentation is hosted onreadthedocsand contains all instructions
to get started.Alternatively, if the documentation is not available, you can consult or build the docs
from thedocsdirectory in this repository.
Package: django-cookie-consent-anm
Django cookie consentdjango-cookie-consent is a reusable application for managing various
cookies and visitors consent for their use in Django project.support ranges from django 1.9 to 3.0 and python 2.7 to 3.7Features:cookies and cookie groups are stored in models for easy management
through Django admin interfacesupport for both opt-in and opt-out cookie consent schemesremoving declined cookies (or non accepted when opt-in scheme is used)logging user actions when they accept and decline various cookieseasy adding new cookies and seamlessly re-asking for consent for new cookiesDocumentationhttps://django-cookie-consent.readthedocs.org/en/latest/ConfigurationAddcookie_consentto yourINSTALLED_APPS.Adddjango.template.context_processors.requesttoTEMPLATE_CONTEXT_PROCESSORSif it is not already added.Include django-cookie-consent urls inurls.py::url(r'^cookies/', include('cookie_consent.urls'))Runmigratedjango management command.Example app::cd tests && ./manage.py runserverUsername and password for admin are 'administrator', 'password'.
Package: django-cookie-consent-gutsh
Cookie consentCookie consent is a Django app to show consent component for web-cookies.Quick startAdd "cookie_consent" to yourINSTALLED_APPSsetting like this:INSTALLED_APPS = [
        "cookie_consent",
        ...,
    ]Include the cookie_consent URLconf in your project urls.py like this:path("cookie_consent/", include("cookie_consent.urls")),Runpython manage.py migrateto create the models.Include consent template in your web-site templates.For example, I've included that text near the and of my base template:{% block cookie_consent %}
  <link rel="stylesheet" href="{% static 'cookie_consent/css/index.css' %}">
  {% include 'cookie_consent/includes/consent.html' with consent_text='We use cookies to understand your interactions with this web-site.' %}
  {# the default for `consent_text` is 'We are using cookies to make this website fully functional.' #}
  <script defer src="{% static 'cookie_consent/js/main.js' %}"></script>
{% endblock %}Don't forget to serve that script and css files! You can find them in distribution, css and js are in both source and compiled forms and are fine (as long as you runcollectstaticcommand).Start the development server and visit necessary pages.Coming up nextImprove naming moreTests (front-end too!)
Package: django-cookie-consent-pax
Django cookie consentdjango-cookie-consent is a reusable application for managing various
cookies and visitors consent for their use in Django project.support ranges from django 1.9 to 3.0 and python 2.7 to 3.7Features:cookies and cookie groups are stored in models for easy management
through Django admin interfacesupport for both opt-in and opt-out cookie consent schemesremoving declined cookies (or non accepted when opt-in scheme is used)logging user actions when they accept and decline various cookieseasy adding new cookies and seamlessly re-asking for consent for new cookiesDocumentationhttps://django-cookie-consent.readthedocs.org/en/latest/ConfigurationAddcookie_consentto yourINSTALLED_APPS.Adddjango.template.context_processors.requesttoTEMPLATE_CONTEXT_PROCESSORSif it is not already added.Include django-cookie-consent urls inurls.py::url(r'^cookies/', include('cookie_consent.urls'))Runmigratedjango management command.Example app::cd tests && ./manage.py runserverUsername and password for admin are 'administrator', 'password'.
Package: django-cookie-control
django-cookie-controlA Django plugin to integrate the Civic UK Cookie Control (https://www.civicuk.com/cookie-control)The plugin is compatible with Django, DjangoCMS and Django/CMS multisite.Updates2023-03-13 Remove deprecated NullBooleanField2020-08-21 Version 4.x + Updated to use Cookie Control version 9.xTo installInstall the application via pip:pip install django-cookie-controlAdd 'django_cookie_control' to installed apps:INSTALLED_APPS = [ ... 'django_cookie_control', ...]Add/Edit the following tosettings.pyif required with required cookies:# DEFAULT if missing:
COOKIE_CONTROL_REQUIRED_COOKIES = ['csrftoken','django_language','sessionid','django_privacy_mgmt_preferences','AWSALB']Run or make migrations:python.exe manage.py migrateTo configureFor a full list of configuration settings see the Civic UK site, here:https://www.civicuk.com/cookie-control/documentationPlugin configuration overview:Add a new configuration:Configure Main Settings:Site nameAPI keyCookie Control product version: Community, Pro, Pro MultisiteSettings:https://www.civicuk.com/cookie-control/documentation#configuration-optionsconsentCookieExpirystatementlogConsentencodeCookiesubDomainsIAB/CCPA Frameworks:https://www.civicuk.com/cookie-control/documentation#iabmodepublisherCCiabCMPiabConfigiabTextccpaConfigAppearance and Behaviour:https://www.civicuk.com/cookie-control/documentation#customisingAll other settingsAccessibility:https://www.civicuk.com/cookie-control/documentation#accessibility-objectDetermines the accessibility helpers available, such as the accesskey and keyboard focus style.Cookies:https://www.civicuk.com/cookie-control/documentation#purpose-objectNecessary CookiesA simple list of cookie names, including wildcards that are necessary for the siteA default list for Django, DjangoCMS, and AWS are already included.Optional CookiesAdd an optional cookie or package of cookies that can be turned off for the siteUsing separate functions On Accept or for On Revoke the cookies can be customised to be disable or enabled.
Package: django-cookie-cutter-polls
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-cookiefilter
Djangomiddleware which removes all unwanted cookies - useful for improving cache hit ratios when
analytics cookies interfere with caching.InstallationUsingpip:$pipinstalldjango-cookiefilterEdit your Django project’s settings module, and add the middleware to the start ofMIDDLEWARE:MIDDLEWARE=["cookiefilter.middleware.CookieFilterMiddleware",# ...]NoteThe middleware should be added beforeUpdateCacheMiddleware, as it uses the value of
HTTP_COOKIES which needs to be modified.ConfigurationOut of the box the standard Django cookie names will work without any other configuration. However
if your project uses different or additional cookie names, editCOOKIEFILTER_ALLOWEDin your
project’s settings module:COOKIEFILTER_ALLOWED=["analytics","csrftoken","django_language","messages","sessionid",]
Package: django-cookie-law-nl
Django cookie law=================This is a Django application that makes it easy to implement cookies compliant with Dutch law, as far as I am ableto tell. I'm not a lawyer, so use at your own risk.Updating========From 0.1.6 to 0.2 or higher-------------------The model has changed, run South migrations. Multilingual support has been added. Optional title and close fieldsadded.From 0.1.4 to 0.1.5--------------------If you're updating from 0.1.4 to 0.1.5 take note that the CookieBar model has changed,you should run the South migrations.Requirements============- jQuery>=1.5.1Usage=====- Add the cookie_law app to your INSTALLED_APPS.- Add 'url(r'^cookies/', include('cookie_law.urls')),' to your main urls.py, without the ''.- Run the cookie_law migrations or syncdb if you don't use South, but you should.- Load the cookie_bar template tags and include {% show_cookie_bar %} under the <body> tag in your base template.- Create a cookie bar in the admin (if you do not a default bar will be created, you should edit this asap).- Surround your cookies with {% if request.COOKIES.allow_cookies == '1' %} <cookie> {% endif %}Cookie Bar Details------------------- Optional title:This title can be displayed as a title for your text- Optional link cookie policy page:If you want a page explaining what kind of cookies you use and why place the full url here.- Optional display name of the link:This will be displayed after the display text. For instance:"This site uses cookies, read about it <link_display_name>"- Title of the allow cookie button:This will be the text shown in the cookie bar button.- Text:The text displayed in the cookie bar.- "This cookie bar is displayed":Check this if you want this particular cookie bar to be shown.Cookie bars without this boolean will not be shown.- Optional "Show a close (dismiss) button for this cookie bar" boolean:The close field is used when you want to give visitors the option to hide the cookie barwhile not accepting cookies. This is turned off by default.- Optional Language:You can create a cookie bar for multiple languages, read more about this in the Multilingual support section.Each of these cookie bars will need the "This cookie bar is displayed" boolean set to True.Multilingual Support--------------------If you want multilingual support add the languages you want to your settings file.LANGUAGES = (('nl','Nederlands'), ('en','English'))Every time the cookie bar template tag is called it will check if a cookie bar exists for each language,if not; one will be created. It is up to you to translate these into the right language.You can do this via the admin.The multilingual support works by checking for a LANGUAGE_CODE in the request.Localization middleware should handle this. If this doesn't exist the default Dutch cookie bar will be used.
Package: django-cookie-message
A simple middleware that uses the django messages framework to add a notification regarding the EU cookie directive.If it can’t detect a cookie about cookies, sets it and displays a message.InstallationInstall from pypi.pip install django-cookie-messageIn your settings:* Ensure the django messages framework is installed.
* Add ``'cookie_message'`` to ``INSTALLED_APPS``.
* Add ``'cookie_message.middleware.CookieMessageMiddleware'`` to ``MIDDLEWARE_CLASSES``.ConfigurationThe messagecan be changed by overriding thecookies/message.pytemplate.The cookiecan be changed by definingCOOKIE_MESSAGE_KWARGSin yoursettings.py. The default is:COOKIE_MESSAGE_KWARGS = {
    'key': 'cookie_message',
    'value': '',
    'max_age': 365 * 24 * 60 * 60, # One year.
    'expires': None,
    'path': '/',
    'domain': None,
    'secure': None,
    'httponly': False,
}These are the arguments sent toset_cookie().
Package: django-cookiesession
This package contains a drop-in replacement middleware fordjango.contrib.sessions.middleware.SessionMiddlewareto store all session data in a browser cookie instead of the database. The code is based ona snippet from Christopher Lenz.To prevent user tampering the session dictionary goes through the following encoding steps:The session dictionary is converted intoJSONASHA1hash is made with theJSONand the site’sSECRET_KEYTheJSONandSHA1hash are concatenated, gzipped and base64 encoded.Upon decoding:The cookie isbase64decoded and ungzippedThe data is split into theSHA1hash and theJSONdataTheSHA1hash is regenerated from the receivedJSONdata and the site’sSECRET_KEYIf the hashes don’t match, aSuspiciousOperationexception is raised. If the hashes match, theJSONdata is converted into a python object and returned.InstallPlace thecookiesessionapp into yourINSTALLED_APPS.
Next, put thecookiesession.middleware.CookieSessionMiddlewaremiddleware into yourMIDDLEWARE_CLASSES.
This middleware is designed as a replacement todjango.contrib.sessions.middleware.SessionMiddlewareManagement CommandsTwo management commands are included to make debugging things easier.decode_session_cookieCalled as./manage.py decode_session_cookie <session_cookie_string>and prints the keys and values of the session dictionary.encode_session_cookieEncodes key=val arguments into a cookie for manual insertion into your browser for testing purposes.
You must call the command as./manage.py encode_cookie key1=value key2=value. Prints out the encoded cookie string
Package: django-cookie-sessions
This is a session backend which uses Django’s secure cookie encoding and
decoding functionality to store the whole session in the cookie, instead of
talking to some database or cache instance.InstallationSet this in your settings:SESSION_ENGINE = ‘cookiesessions.engine’Why would I want this?With all of the other Django session backends every request from a user results
in a request to some backend service, whether it be a database, memcached, or
something else.  Wouldn’t it be better if we could store that information with
the client itself, and save ourselves the extra requests and latency?Prior to Django 1.4, it was not possible, because you couldn’t trust the user’s
cookie.  Someone could have set their user_id in the cookie to someone else’s,
and suddenly be logged in as that other user.  Thankfully Django 1.4 supports
securely signed cookies, meaning that we can ensure that the cookie was set by
us, and only us.Given that, it’s now possible to save ourselves these extra requests and
latency, as well as retain the strong security that we have come to expect
from web services built on Django.
Package: django-cookies-samesite
This repository contains a middleware which automatically sets SameSite attribute for session and csrf cookies in legacy versions of Django e.g. 1.11.x, 2.2.x or 3.0.x.This module is not needed for Django 3.1.x which introduces full support of SameSite flag for session and csrf cookie.QuickstartInstall django-cookies-samesite:pip install django-cookies-samesiteAdd the middleware to the top ofMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES=('django_cookies_samesite.middleware.CookiesSameSite',...)ImportantIf you’re planning to use this middleware together with the newer version of Django (>3.0.x), and you want to e.g.
set the SameSite attribute tonone, then you have to addDCS_prefix to alldjango-cookies-samesitesettings (see examples below).It will help you to avoid bugs caused by the conflicting settings names.Related bug:https://github.com/jotes/django-cookies-samesite/issues/19Set your preferred SameSite policy insettings.py:SESSION_COOKIE_SAMESITE='lax'# orDCS_SESSION_COOKIE_SAMESITE='Lax'This can be ‘Lax’, ‘None’, ‘Strict’, or None to disable the flag.
Also, you can set this flag in your custom cookies:SESSION_COOKIE_SAMESITE_KEYS={'my-custom-cookies'}# orDCS_SESSION_COOKIE_SAMESITE_KEYS={'my-custom-cookies'}After that you should be able to see the SameSite flag set for session and csrf cookies.You can set the SameSite flag on all cookies (even on those coming from third-party Django apps):SESSION_COOKIE_SAMESITE_FORCE_ALL=True# orDCS_SESSION_COOKIE_SAMESITE_FORCE_ALL=TrueThesessionidandcsrftokencookies are automatically handled by the middleware. This behavior can be disabled with:SESSION_COOKIE_SAMESITE_FORCE_CORE=False# orDCS_SESSION_COOKIE_SAMESITE_FORCE_CORE=FalseRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageContributorsAbdul Rafiu <rafiu.rahim@gmail.com>Code Hugger (Matthew Jones) <jonespm@umich.edu>Jarosław Śmiejczak <poke@jotes.work>Jørn Lomax <northlomax@gmail.com>Liuyang Wan <noreply@github.com>Mykolas Kvieska <noreply@github.com>Tim McCormack <tmccormack@edx.org>