Saravanan666/pypi-org huggingface dataset:
Package: django-readers-debug
django-readers-debugSTATUS: EXPERIMENTALA pretty-printer for debuggingdjango-readersqueryset functions.InstallationInstall from PyPIpip install django-readers-debugUsageWithoutdjango-readers-debug:>>>fromdjango_readersimportqs>>>prepare=qs.pipe(...qs.include_fields("name"),...qs.auto_prefetch_relationship("author",qs.include_fields("name")),...qs.filter(publication_year__gte=2021),...)>>>print(prepare)<function pipe.<locals>.piped at 0x10ce2a670>>>>Withdjango-readers-debug:>>>fromdjango_readers_debugimportdebug_print>>>debug_print(prepare)qs.pipe(qs.include_fields("name"),qs.auto_prefetch_relationship("author", prepare_related_queryset=qs.include_fields("name")),qs.filter(publication_year__gte=2021),)Known limitationsBest-effort printing ofQobjects andPrefetchobjects only.Code of conductFor guidelines regarding the code of conduct when contributing to this repository please reviewhttps://www.dabapps.com/open-source/code-of-conduct/
Package: django-read-log
Simple app to log every time an object is displayed, can be used in combination with django-simple-history for a full audit solution.
Currently the standard generic class based views:DetailView,UpdateView,DeleteView,ListVieware are supported out of the box, since the views deal with displaying objects as part of the functionality.
For DeleteView and UpdateView in most cases you want to display the object (GET request)
before you allow the user to delete/update the object.Other custom views can most likely be supported seeUsing django-read-log in combination with unsupported viewsFor each view the following data is stored in the audit model (ReadLog):user:Who view the item, can be an anonymous user.content_object:A reference to the viewed object using a generic foreign key, if you delete an object the log entry will still be present.operation:What operation triggered the the log entry to be written(detail, list, update, delete).logged_at:When was the object viewed.UsageEasy to use just in 3 simple stepsadd the app ‘read_log’ to INSTALLED_APPS in settings.pyrun the migration: python manage.py migrate read_logimport and use the mixinfromread_log.view_mixinsimportReadLogMixinfromtest_read_log.modelsimportTestModelclassTestDetailView(ReadLogMixin,DetailView):model=TestModelCustomizing logged operationsBy default the following views maps to the following operations.DetailView:detailUpdateView:updateListView:listDelete:deleteThis can be changed by setting thelog_operationsattribute to a string of you choicefromread_log.view_mixinsimportReadLogMixinfromtest_read_log.modelsimportTestModelclassTestDetailView(ReadLogMixin,DetailView):log_operation='my_choice'model=TestModelUsing django-read-log in combination with unsupported viewsBecause the view mixin hooks into theget_context_dataview function it should be possible to add the mixin to
unsupported views as long as they either implement or inherit the get_context_data function
(eg. from SingleObjectMixin or MultipleObjectMixin) and define the class attribute‘log_operation’to the string
you want to have logged as the operations field.Presentation not includedWhen audit is needed you normally want to limit the expose of data hench forth no presentation of the ReadLog
is included and if you need a way to display the Readlog it is up to you to implement it.fromdjango.contribimportadminfromread_log.modelsimportReadLogadmin.site.register(ReadLog)
Package: django-readonly
Put your website into read-only mode for maintanance. It blocks any POST requests and signs users out.
It doesn’t lock any database transactions (check outhttps://github.com/streeter/django-db-readonlyfor that).http://pypi.python.org/pypi/django-readonly/https://bitbucket.org/zalew/django-readonly/https://github.com/zalew/django-readonly/(mirror)Usagepip installdjango-readonlysettings.py: add'readonly.middleware.ReadOnlyMiddleware',toMIDDLEWARE_CLASSESsettings.py: READ_ONLY = Truetemplate:{% if request.read_only%}<p>Websiteis currently inread-onlymode.</p>{%endif %}
Package: django-read-only-admin
django-read-only-admin is a Django reusable application that fully implement read only adminContentsInstallationConfigurationSettingsUsageContributingLicensingContactsInstallationObtain your copy of source code from the git repository:$ git clonehttps://github.com/vint21h/django-read-only-admin.git. Or download the latest release fromhttps://github.com/vint21h/django-read-only-admin/tags/.Run$ python ./setup.py installfrom the repository source tree or the unpacked archive. Or use pip:$ pip installdjango-read-only-admin.ConfigurationAdd"read_only_admin"tosettings.INSTALLED_APPS.# settings.pyINSTALLED_APPS+=["read_only_admin",]Run$ python ./manage.py migrate.Then adduser/groupchange/delete/add/readonlymodel permissions.SettingsREAD_ONLY_ADMIN_PERMISSION_PREFIXRead-only permission prefix. Defaults to:"readonly".READ_ONLY_ADMIN_PERMISSION_NAME_PREFIXRead-only permission name prefix. Defaults to:"Read only".READ_ONLY_ADMIN_EMPTY_ACTIONSEmpty admin actions list (exclude superusers) or just remove delete selected action. Defaults to:True.UsageJust inherit your custom Django admin class fromread_only_admin.admin.ReadonlyAdmin.# admin.pyfromread_only_admin.adminimportReadonlyAdminclassMyCustomAdmin(ReadonlyAdmin):...Also tabular and stacked inlines are supported.# admin.pyfromread_only_admin.adminimport(ReadonlyStackedInline,ReadonlyTabularInline,)classMyCustomTabularInline(ReadonlyTabularInline):model:Type[Model]=MyModelextra:int=0classMyCustomStackedInline(ReadonlyStackedInline):model:Type[Model]=MyModelextra:int=0If you uselist_editablein your custom admin classes, copyread_only_admin/templates/admin/pagination.htmlto your projecttemplates/admindirectory.ContributingFork itInstallGNU MakeInstall and configurepyenvandpyenv-virtualenv pluginInstall and configuredirenvCreate environment config from examplecp.env.example.envInstall development dependencies:makeinstallCreate your fix/feature branch:gitcheckout-bmy-new-fix-or-featureCheck code style and moreover:makecheckRun tests:maketestPush to the branch:gitpushoriginmy-new-fix-or-featureCreate a new Pull RequestLicensingdjango-read-only-admin uses the MIT license. Please check the MIT-LICENSE file for more details.Some part of code fairly stolen from teh internets with reference to the source. So, if you author of this code, please contact me.ContactsProject Website:https://github.com/vint21h/django-read-only-admin/Author: Alexei Andrushievich <vint21h@vint21h.pp.ua>For other authors list see AUTHORS file.
Package: django-readonly-field
Make some Django model fields readonly. In other words, it lets you tell Django to
read some fields from your database, but never try to write those back. It can be
useful if your fields are populated by triggers or something.RequirementsPostgresql onlyDjango, tested from 2.2 to 4.2With Python, tested from 3.7 to 3.11DocumentationThe full documentation is athttps://django-readonly-field.readthedocs.org.QuickstartInstall Django Readonly Field:pip install django-readonly-fieldIn yoursettings.py:INSTALLED_APPS=[# ..."django_readonly_field",]In the model where you want some fields to be read-only:classSpaceship(models.Model):name=models.CharField(max_length=100)color=models.CharField(max_length=16)classReadonlyMeta:readonly=["color"]That’s it. Now, Django won’t try to write thecolorfield on the database.WarningDjango won’t try to write those fields. Consequence is that your Databasemustbe ok with Django not writing those fields. They should either
be nullable or have a database default or be filled by a trigger, otherwise
you will get anIntegrityError.Don’t forget that Django model field defaults won’t become database defaults.
You might have to write an SQL migration for this.Running TestsYou will need a usable Postgresql database in order to test the project.source <YOURVIRTUALENV>/bin/activate
export DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/NAME
(myenv) $ pip install -r requirements.txtRun tests for a specific version(myenv) $ pytestRun tests for all versions (if tox is installed globally, you don’t need a
virtual environment)$ toxCreditsThis repository was once available atpeopledoc/django-readonly-field.Tools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: django-readonly-model
django-readonly-modelThe easiest way to create read-only modelsInstallationInstall usingpip:pip install django-readonly-modelAdd'readonly_model'to yourINSTALLED_APPSsetting:INSTALLED_APPS = [
    ...
    'readonly_model',
]ExampleDeclare a model to read:fromdjango.dbimportmodelsclassDirectory(models.Model):classMeta:read_only_model=TrueWe can read data from the model but we cannot write:>>>fromapp.modelsimportDirectory>>>Directory.objects.count()0>>>Directory.objects.create(name='kg')...readonly_model.exceptions.ReadOnlyModel:Model'app.models.Directory'isread-onlyYou cannot write but you can load data from fixtures:$python3manage.pyloaddatafixtures/directory.json>>>fromapp.modelsimportDirectory>>>Directory.objects.count()3When is it needed?When you want to protect the model from accidental recording.When you have some data that cannot be changed programmatically (for example, various directories).When you need to use a read-only model from a database that you cannot write to it.
Package: django-reaktion-banner
BannerReaktion's banner plugin for DjangoSetupProject requirements.txtThe following need to be installed in the environment & be in the requirements.txt:pytzdjangorestframeworkpillowicecreamProject SettingsAdd "banner" to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
          ...
   
        'banner',
   
      ]Add the following context processors to your OPTIONS in TEMPLATE settings and add a banner endpoint variable:'OPTIONS': {
        'context_processors': [
            ...
            'banner.processors.banner_endpoint',
            'banner.processors.banner_sidebar_right',
            'banner.processors.banner_sidebar_left',
            'banner.processors.banner_content',
            'banner.processors.banner_bottom',
            'banner.processors.banner_top'
        ]
    }

BANNERS_ENDPOINT = os.environ['BANNERS_ENDPOINT']Include the banner URL conf in your project urls.py like this::path('banner/', include('banner.urls')),
    path('api/', include('banner.api_urls', namespace='banner-api')),Project css/scssDefine the css styles in styles.scss.sticky-top-alt {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.label-over-ad {
  position: absolute;
  top: 0;
  left: 0;
  font-weight: 700;
  font-size: 10px;
  padding: 3px 10px 3px 10px;
  background: #135776;
  border-radius: 0 1px 1px 0;
  opacity: 0.80;
  color: white;
  border-bottom: 0;
  font-family: "Raleway";
}

.panorama-ad-div {
  width: 100vw;
  height:auto;
  max-height: 240px;
  object-fit: cover;
  background: #135776;
  &:hover {
    cursor: pointer;
  }
}

.panorama-ad-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  aspect-ratio: 0;
}

.leaderboard-ad-div {
  width: 100vw;
  height:auto;
  max-height: 90px;
  object-fit: contain;
  &:hover {
    cursor: pointer;
  }
}

.leaderboard-ad-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  aspect-ratio: 0;
}

.skyscraper-ad-left-div {
  max-width: 160px;
  &:hover {
    cursor: pointer;
  }
}

.skyscraper-ad-left-image {
  max-width: 160px;
  aspect-ratio: auto!important;
}

.skyscraper-ad-right-div{
  max-width: 160px;
}

.skyscraper-ad-right-image{
  max-width: 160px;
  aspect-ratio: auto!important;
  &:hover {
    cursor: pointer;
  }
}Runpython manage.py migrateto create the banner models.For a docker environment run the following two commands:docker exec <container name> python cms/manage.py migrate
   docker exec <container name> pip install -r requirements.txt
Package: django-reaktion-crm
Reaktion CMS is a Django app is simple CRM connected to tracking system.Detailed documentation is in the “docs” directory.Quick startAdddjango_reaktion_crmto your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_reaktion_crm',
]To create the polls models run:python manage.py migrateSet upMONGO_CONN,DOMAIN_IDandFILTER_NUMBER_OF_VISITS_30_DAYSenvImport contacts from .csv filepython manage.py import_csv filename <filename> project <hja/rea>Import trackingpython manage.py import_tracking delta <hours>
Package: django-real-content
Template tags to quickly show real content instead of misleadinglorem
ipsum.
Useful to get a sense of real world content with fun local unicode
characters.Works on Python >= 2.7 (including Python >= 3.5) and Django >= 1.6.DocumentationRead the DocsInstallationpip install django-real-contentIn your project’s settings file addreal_contentto your INSTALLED_APPS setting andDRC_LANGUAGEsetting (if none is set, english will be used).INSTALLED_APPS = (
    # ...
    'real_content',
)

DRC_LANGUAGE = 'hr'Languages currently supported out of the boxcz, de, en, es, fr, gr, hr, it, nl, pl, rs, ru, siUsage:Explaind in more detail onread the docs.Load django-real-content in your template.{% load drc %}random titleshow random title with h3 tag{% drc_title 'h3' %}random paragraphsshow 3 random paragraphs{% drc_paragraphs 3 %}random imageshow random image from lorempixel.com which dimensions are 420x360{% drc_image 420 360 %}random numbershow a random number between 1 and 100{% drc_number 1 100 %}Content sourcesVarious localised news portals and local wikipedia in some cases.TODOadd more languages in the package as standard (fi, pt…)
Package: django-reamaze
Django-ReamazeDjango Reamaze is django app for integrate Reamaze (http://reamaze.com) LightBox in django project.It’s tested with django 1.8(py2.7 and 3.6), 1.11(py2.7 and 3.6) and 2.0(py3.6)[![Build Status](https://travis-ci.org/mrjmad/django-reamaze.svg?branch=master)](https://travis-ci.org/mrjmad/django-reamaze)  [![Coverage Status](https://img.shields.io/coveralls/mrjmad/django-reamaze.svg)](https://coveralls.io/r/mrjmad/django-reamaze?branch=master)USAGEyou need populate this value in settings.py :REAMAZE_SECRET_KEY (your SSO Key, in settings of Reamaze)REAMAZE_JS_URL (in  Website Integration / Support Lightbox of Reamaze)REAMAZE_ACCOUNT (name of reamaze account)REAMAZE_CHANNEL  (mailbox for messages)REAMAZE_OK_FOR_ANONYMOUS (only for you authentified django user or for everyone ?)REAMAZE_PREFIX_USER_ID if you will use a prefix before django user id.
Package: django-rebel
Django RebelRequirementsDjango >= 2.0PostgresqlInstallationpip install django-rebelAdddjango_rebelto your INSTALLED_APPS setting.INSTALLED_APPS = (
    ...
    'django_rebel',
)Add Django Rebel settings to your settings file.REBEL = {
    "TEST_MODE": False,
    "SEARCH_FIELDS": [],
    "EMAIL_PROFILES": {
        'MARKETING': {
            'EMAIL': "anyone@example.com",
            'FULL_NAME': 'Anyone',
            "API": {
                "API_KEY": "MAILGUN_API_KEY",
                "DOMAIN": "mg.example.com"
            }
        }
    }
}
Package: django-recaptcha-form
Provides form widgets and class mixin for django newforms. This allows adding a recaptcha test to any django form.Make sure to set these settings in your django settings file:
RECAPTCHA_PUB_KEY
RECAPTCHA_PRIV_KEYRequires recaptcha library:http://pypi.python.org/pypi/recaptcha-clientFor more information about recaptcha, and to get a recaptcha key, visit:http://www.google.com/recaptcha(Based on this posthttp://smileychris.com/ramblings/recaptcha/)
Package: django-recaptcha-mailhide
=====reCAPTCHA Mailhide=====ReCAPTCHA Mailhide is an app for hiding mails from spammers. To use with Django templates.Installation-----------Install using PIP``pip install django-recaptcha-mailhide``Add "recaptcha-mailhide" to your INSTALLED_APPS setting like this:INSTALLED_APPS = (...'recaptcha_mailhide',)MAILHIDE_PUBLIC_KEY = "XXX"MAILHIDE_PRIVATE_KEY = "XXX"You can obtain public and private key for free via http://www.google.com/recaptcha/mailhide/apikeyUsage-----------First load it in Django template and use it as a filter.{% load mailhide %}You can mail me at {{ "example@example"|mailhide }}Credits-------------Adapted from https://github.com/jbzdak/django-mailhide
Package: django-recaptcha-mozilla
Mozilla fork of:http://github.com/praekelt/django-recaptchaOriginally written by the Praekelt Foundation.Inspired by===========Marco Fucci @ http://www.marcofucci.com/tumblelog/26/jul/2009/integrating-recaptcha-with-django/Requirements===========This version requires a custom version of the python-recaptcha library to provide ssl support for submit.You can get the required version here:http://github.com/bltravis/python-recaptchaAdd a new setting to your Django project settings file (eg.):RECAPTCHA_USE_SSL = TrueIf you don't add this setting, the code is written to default to **NOT** use SSL.
Package: django-recaptcha-works
django-recaptcha-worksprovides a Django form field that integrates the
reCaptcha service. It is released under the terms of the BSD License.This reCaptcha implementation has no extra requirements other than Django.The app is based on the codesnippet 1644as published byChris Beaven(aka SmileyChris).The original code has been further modified byGeorge Notarasin order to
implement the following:transform the snippet to a Django application releaseadd SSL support for both the captcha presentation and the communication with the reCaptcha serversmigration to the Google-hosted reCaptcha APIextension of the available application settingsaddition of a decorator that adds the remote IP to the submitted formsupport for overriding the reCaptcha field validation to facilitate
form testingMore informationMore information about the installation, configuration and usage of this
application can be found in theHELPfile inside the distribution package
or in the project’swiki.Bugs and new featuresIn case you run into any problems while using this application it is highly
recommended you file a bug report at the project’sissue tracker.
Package: django-receipts
Parsing of web app receipts in Django. A simple library to parse web
application receipts in Django. It follows the same syntax as the verification
service at thee Mozilla Marketplace.This is optional, you can just verify your receipt with the Marketplace.
However there are a couple of reasons you might want to do this:analytics, tracking usage of your app as it checks receiptstracking usage of receipt by IP address to prevent sharing of receiptsblocking of receipts that you know are fradulent.This app provides a django model that shows the receipts that been processed,
allowing you to block the receipts there.InstallationInstall from pypi:pip install django-receiptsUsageAdddjango_receiptsto yourINSTALLED_APPS:INSTALLED_APPS = (...
        'django_receipts',
)Run syncdb to install the table:python manage.py syncdbAdd in django-receipts into your urls, for example:urlpatterns = patterns('',
         ...
         url(r'^receipts/', include('django_receipts.urls')),
)You will then be able to do a POST to:curl -X POST http://localhost:1234/receiive --data "good.receipt"This will return:{"status": "ok"}Seedjango_receiptsconstants.pyfor more.ConfigurationRECEIPT_CHECK_INTERVAL(optional): time between receipts from the client to
actually send receipts to the server. Effectively a cache of the check
against the server. Default: 60 minutes.
Package: django-receipts-ms
This is sample code used in the Real Python article [Writing an Installable Django App](???). The article describes how to take an app from an existing Django project and make it a stand-alone installable package avilable on PyPI.Installable AppThis app models a list of items on a receipt. Each item has a description and a cost. A receipt may reference multiple items.This app can be installed and used in your django project by:$pipinstallrealpython-django-receiptsEdit yoursettings.pyfile to include‘receipts’in theINSTALLED_APPSlisting.INSTALLED_APPS=[...'receipts',]Edit your projecturls.pyfile to import the URLs:url_patterns=[...path('receipts/',include('receipts.urls')),]Finally, add the models to your database:$./manage.pymakemigrationsreceiptsThe “project” BranchThemaster branchcontains the final code for the PyPI package. There is also aproject branchwhich shows the “before” case – the Django project before the app has been removed.Docs & SourceArticle:https://realpython.com/installable-django-app/Source:https://github.com/realpython/django-receiptsPyPI:https://pypi.org/project/realpython-django-receipts/
Package: django-recent-objects
Recent objects fetching utilitiesUsage:fromtestapp.modelsimportArticle,Comment,Paymentfromrecent_objects.recent_objectsimportRecentObjectsro=RecentObjects([{"queryset":Article.objects.all(),"date_field":"created_at",},{"queryset":Comment.objects.all(),"date_field":"created_at",},{"queryset":Payment.objects.all(),"date_field":"created_at",},])recent_10_objects=ro.page(paginate_by=10,page=1)recent_10_objectswill now be a list of up to 10 dictionaries of the form:[{"type":"testapp.article","date":datetime(...),"pk":24,"object":Article(),},{"type":"testapp.comment","date":datetime(...),"pk":42,"object":Comment(),},...]You can optionally specify thetypeyourself in the recent objects spec
above. This may be useful when you want more control over the value or if
you’re assembling several querysets using the same underlying model.
Package: django-rechat
Django RechatChat application for Django using websocketsInstallpip install django-rechatAdd"rechat"and"instant"toINSTALLED_APPSin settings and updateurls.py:urlpatterns=[# ...path("instant/",include("instant.urls")),path("rechat/",include("rechat.urls")),]Install the websockets server:quickstartUsageAn Alpinejs frontend is available. To use the rechat templates create your own index template
(here with Tailwind css classes):{%extends"base.html"%}{%blockcontent%}{%include"rechat/init.html"%}<div class="flex flex-row h-full" x-init="$rechat.hxget('{%url'rechat-rooms'%}', '#rooms')"><div id="rooms" class="w-2/12 h-full p-3 border-r border-gray-200 bg-slate-100">Loading rooms ..</div><div id="room"><div class="p-5 text-stone-400">Select a chatroom</div></div></div>{%endblock%}TodoAdd a persistence layer optionGroup level authorizations and roomsRate limitsChannel admin, kick/banAdd a presence widget to show users in the chat
Package: django-recommend
Usepyrecommendin Django projects.Warningnot yet suitable for production.django_recommend/is the actual Django app intended for use in projects.simplerec/is a Django project used for testing.QuickstartAdddjango_recommendto yourINSTALLED_APPS, and runpython manage.py migrate.In your views, calldjango_recommend.set(user, object, score)to start
recording user scores. (Currently this is assumed to be implicit feedback).In your templates, use{% load django_recommend %}and{{ obj|similar_objects }}to show similar objects to visitors. This
filter returns a list, so you may also do, for example:{% with similar_products as product|similar_objects %}
    {% if similiar_products %}
        <h2>Other users also liked:</h2>
        <ul>
        {% for product in similar_products %}
            <li><a href="{{ product.get_absolute_url }}">{{ product }}</a></li>
        {% endfor %}
        </ul>
    {% endif %}
{% endwith %}
Package: django-recontact
DescriptionThis is a pluggable django application which provides a contact form
that generates an email message to specified addresses.  The form is
protected by an invisible recaptcha.ExampleA small django project is included, with an example django app
containing a contact form.To set up the example server, run the following commands:$ python3 -m venv pythonenv
$ source pythonenv/bin/activate
$ python -m pip install django
$ python setup.py install
$ cd example
$ python manage.py migrate
$ python manage.py runserverYou should now have an http server running on localhost port 8000.
Connect to localhost:8000 with your web browser to test the form.