Saravanan666/pypi-org huggingface dataset:
Package: django-cuser
Table of contentsOverviewSupported Python versionsInstallingWho is the current userCurrentUserFieldTestsOverviewcuser will bring you Current user of your django application from anywhere in your code.
I know, sounds fantastic ;)Supported Python versionsdjango-cusercurrently can be run on multiple python versions:Python 2 (2.7)Python 3 (3.4, 3.5)PyPyInstallingdjango-cuser is also available athttp://pypi.python.org/pypi/django-cuserSo it can be install it by pip or easy_install:$ pip install django-cuserOr you can grab the latest version tarball:$ python setup.py installTo enable django-cuser in your projectAddcusertoINSTALLED_APPSin yoursettings.pyAddcuser.middleware.CuserMiddlewaretoMIDDLEWARE_CLASSESafter the
authentication and session middleware.Who is the current userTo set/get the user info, there is the following API:from cuser.middleware import CuserMiddlewareSet the current user for this thread. Accepts user objects and login names:CuserMiddleware.set_user(some_user)Get the current user or None:user = CuserMiddleware.get_user()This will return some_user if there is no current user:user = CuserMiddleware.get_user(some_user)Forget the current user. It is always safe to call this, even if there is no current user:CuserMiddleware.del_user()The middleware automatically sets/deletes the current user for HTTP requests.
For other uses (management commands, scripts), you will need to do this
yourself.CurrentUserFieldcuseralso provides aCurrentUserField, which can be used for auditing
purposes. Use it as follows:from cuser.fields import CurrentUserFieldclass MyModel(models.Model):
    ....
    creator = CurrentUserField(add_only=True, related_name="created_mymodels")
    last_editor = CurrentUserField(related_name="last_edited_mymodels")
    ...This field is aForeignKeyto thesettings.AUTH_USER_MODELmodel and you
can treat it as such.Testsdjango-cuserhas been tested Django 1.8 and later. To run the the tests:$ python manage.py test -v 2It’s also available on travis-ci:https://travis-ci.org/Alir3z4/django-cuser/
Package: django-custard
Django runtime typed custom fieldsDjango Custard is a small reusable unobtrusiveDjangoapp that implements runtime custom fields that can be attached to any model on the
fly: it’s possible to create fields and set values for them from the code or
manage them through the admin site, with the ability to display them even outside
of the admin.Home page:https://github.com/kunitoki/django-custardDocumentation:http://django-custard.readthedocs.orgPypi:https://pypi.python.org/pypi/django-custardExample app on Github:https://github.com/kunitoki/django-custard/exampleChangelog:Changelog.rstLicense:The MIT License (MIT)Supports: Django 1.6, 1.7, 1.8 - Python 2.7, 3.2, 3.3, 3.4
Package: django-cust-email-user
Just another Django-email-user app. Makes the email address as the username.Attention! Only suitable for fresh Django projects.InstallationInstallationpip install django-cust-email-userAddemail_userstoINSTALLED_APPSin settings.pyINSTALLED_APPS = [
  "email_users",
  ...
]CreateAUTH_USER_MODELin settings.pyAUTH_USER_MODEL = 'email_users.User'Database Updatepython manage.py migrateInternal NotesPublishing to PyPI:python -m pip install -U wheel twine setuptools
python setup.py sdist
python setup.py bdist_wheel
twine upload --skip-existing dist/*
Package: django_custom_500
InstallationSupported Python versions are:2.7,3.4,3.5,3.6,3.7andpypy. Supported Django versions are:1.8.x,1.9.x,1.10.xand1.11.x.pipinstall--upgradedjango-custom-500Add ``django_custom_500`` to ``INSTALLED_APPS``:INSTALLED_APPS=('django_custom_500',)UsageCreate500.htmlin yourtemplatefolder.ORSetCUSTOM_500_TEMPLATEin your settings.Example:CUSTOM_500_TEMPLATE="my/path/to/500.html"LicenseThe MIT License (MIT)Copyright (c) 2015–2017 Vašek DohnalPermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: django-custom-acccounts-plus
Project Description: Django Custom Accounts PlusThis module overrides Django’s default User modelImportantAdd this model at the very start of the project. Before any migration.Quick start1. Add “accounts” to your INSTALLED_APPS setting (in settings.py)like this::
INSTALLED_APPS = [
…
‘accounts’,
]
2. Add “AUTH_USER_MODEL” in settings (settings.py) like this::
AUTH_USER_MODEL = ‘accounts.CustomUser’Migrate (python manage.py migrate)TODOChangelog0.1 - 2023-02-22 Arindam Dutta - First releaseCopyright(c) 2023 Arindam Dutta
Package: django-custom-accounts
# Django Custom Accounts## InstallVia pippip install django-custom-accountsVia easy\_installeasy_install django-custom-accounts## Usage### SettingsIn settings.py add:INSTALLED_APPS = (...'accounts'...)AUTH_USER_MODEL = 'accounts.CustomUser'CUSTOM_AUTH_ACTIVATION_EMAIL = True # if True sent an email to activate your account otherwise the account is activate automaticallyCUSTOM_AUTH_AUTO_LOGIN = True # if true the user is logged automatically after registration or confirmingCUSTOM_AUTH_REGISTER_REDIRECT_URL = None # String with the url to redirect after successful registrationCUSTOM_AUTH_CONFIRM_REDIRECT_URL = None # String with the url to redirect after successful confirmationLOGIN_REDIRECT_URL = '/accounts/profile/' # String with the url to redirect after loginLOGOUT_REDIRECT_URL = None # String with the url to redirect after logoutIn urls.py add:url(r'^accounts/', include('accounts.urls')),### TemplatesList of templates for auth.All the templates go in registration folder- login.html: Template for login form.- logged\_out: Template por logout success message.- register\_form.html: Template for registration form.- activation\_email.html: Template for email confirmation.- activation\_subject.txt: Template for email confirmation subject.- activation\_confirm.html: Template for successful and unsuccesseful confirmation message.- password\_reset\_form.html: Template for recovery password form.- password\_reset\_email.html: Template for recovery password email.- password\_reset\_subject.txt: Template for recovery password email subject.- password\_reset\_done.html: Template for recovery password done. (Request mail for recovery password message)- password\_reset\_confirm.html: Template for change password form.- password\_reset\_complete.html Template for changge passowrd success message.## Todo- Tests- Facebook login/auth suppport- Twitter login/auth support## Changelog### 0.1 - 2014-04-22  Alvaro Lizama  <nekrox@gmail.com>- First release## LicenseCopyright (c) 2014 Alvaro Lizama MolinaPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
Package: django-custom-anonymous
django-custom-anonymous.. figure::https://travis-ci.org/bugov/django-custom-anonymous.svg?branch=masterLibrary provides customization of AnonymousUser.Works with Python >= 2.6, >= 3.2, Django >= 1.5, >= 2.0.Installation.. code:: bashpip install django-custom-anonymousCustomizationAdd tosettings:.. code:: pythonAUTH_ANONYMOUS_MODEL = 'your_app.module.CustomAnonymousUser'Add to middlewares:.. code:: pythonMIDDLEWARE = (
...
    'custom_anonymous.middleware.AuthenticationMiddleware',
...
)Create your own anonymous (for example):.. code:: pythonfrom django.contrib.auth.models import AnonymousUser as DjangoAnonymousUser
...
class CustomAnonymousUser(DjangoAnonymousUser):
    ip = None

    def __init__(self, request):
        self.ip = request.META.get('REMOTE_ADDR')
        super(AnonymousUser, self).__init__()
Package: django-custom-auth
django-custom-auth==================Implements email based login with Django >= 1.5.# Installationpip install django-custom-auth# Add this to your settingsINSTALLED_APPS += ('custom_auth',)AUTHENTICATION_BACKENDS = ('custom_auth.auth.Authenticate',)AUTH_USER_MODEL = 'custom_auth.User'# URLsurl(r'^accounts/', include('custom_auth.urls')),# Utilization in your modelsuser = models.ForeignKey(settings.AUTH_USER_MODEL)# To access the user modelfrom django.contrib.auth import get_user_model
Package: django-custom-auth-user
Django custom user model and abstract user model basic token authentication.DocumentationThe full documentation is athttps://django_custom_auth_user.readthedocs.io.FeaturesCustom userExtendable abstract userUser registration serviceToken authenticationCreate auth tokenDelete auth tokenQuery sets forUser&AuthTokenQuickstartInstall Django custom user:pip install django_custom_auth_userAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'custom_auth_user',
    ...
)Set yourAUTH_USER_MODELsetting to usecustom_auth_user.User:AUTH_USER_MODEL = 'custom_auth_user.User'Create the database tables:python manage.py migrateVersion 0.1 (2017-07-23)Initial release.
Package: django-custom_delete_selected
Djangodelete_selectedaction inModelAdminnot allow
you to add operations before and after deleting objects from
database by default.ProblemDefaultdelete_selectedaction usingdeletemethod of queryset
so need to usepre_deleteandpost_deletesignals.SolutionDisabledelete_selectedaction for all applications and
models, but for some models this is crazy.InstallingThe easiest way to install package is with pip!You can install from PyPI (for Django==1.4):$ pip install django-custom_delete_selectedOr GitHub for Django==1.4:$ pip install -e git+https://github.com/saippuakauppias/django-custom_delete_selected.git@django_v1.4#egg=custom_delete_selectedOr GitHub for Django==1.3.x:$ pip install -e git+https://github.com/saippuakauppias/django-custom_delete_selected.git@django_v1.3.x#egg=custom_delete_selectedOr from source:$ git clone https://github.com/saippuakauppias/django-custom_delete_selected.git
$ cd django-custom_delete_selected
$ python setup.py installUsageImportcustom_delete_selected.admin.CustomDeleteSelectedto extend
ModelAdmin class and overridedelete_modelmethod.
For example:from django.contrib import admin
from custom_delete_selected.admin import CustomDeleteSelected


class MyModelAdmin(CustomDeleteSelected, admin.ModelAdmin):

    # your code

    def delete_model(self, request, obj):
        # pre delete operations
        super(MyModelAdmin, self).delete_model(request, obj)
        # post delete operationsThis code allow extends you deleting one object (when delete from change_form)
and same objects (when delete from change_list).ContributingFeel free to fork, send pull requests or report bugs and issues on github.
Package: django-custom-email-user
Django Custom Email UserReplacing the username with the email as the unique identifier is so common, that I simply decided to create a package to prevent this tedium again.Used to replace default Django User model with email, instead of the username, as the unique identifer. The username is changed to optional and will not be requested as part of createsuperuser.The Django admin panel is customised to accommodate these changes, along with the User forms custom_email_user.forms.CustomUserCreationForm and custom_email_user.forms.CustomUserChangeFormSimply:add custom_email_user to your installed appssubclass the abstracted classconfigure the AUTH_USER_MODELrun the migrationsregister your user model with the admin siteINSTALLED_APPS=[...'custom_email_user']AUTH_USER_MODEL='my_model_module.User'fromdjango.dbimportmodelsfromcustom_email_user.modelsimportUserasBaseUserclassUser(BaseUser):passfromdjango.contribimportadminfromcustom_email_user.adminimportCustomUserAdminfrom.modelsimportUseradmin.site.register(User,CustomUserAdmin)
Package: django-custom-indexes
django-custom-indexes=====================Django PostgreSQL backend and custom fields to create custom indexes.With this, indexes can be defined for a model using field attributeswhich will be migrated to the db, this eliminates the need to writemigrations manually with RunSQL to create indexes.Installation============[![](https://img.shields.io/pypi/v/django-custom-indexes.svg)](https://pypi.org/project/django-custom-indexes/) ![](https://img.shields.io/badge/Maintained-yes-green.svg)![](https://img.shields.io/pypi/djversions/django-custom-indexes.svg) ![](https://img.shields.io/pypi/pyversions/django-custom-indexes.svg)Installation:pip install django-custom-indexesPyPI: https://pypi.python.org/pypi/django-custom-indexes/Add ``django_custom_indexes`` to your ``INSTALLED_APPS``:INSTALLED_APPS = ('...','django_custom_indexes')Requirements:-  Django 1.7 to 1.11 (not tested for 2.0+).-  PostgreSQL database backend.-  Python 2.7Usage=====Creating Indexes in PostgresSQL:https://www.postgresql.org/docs/9.5/static/sql-createindex.htmlIn your settings update the ``ENGINE`` parameter of ``DATABASES`` to``'django_custom_indexes.backends.postgresql_psycopg2'``By default custom\_indexes backend inherits fromdjango.db.backends.postgresql\_psycopg2, to use some other sub class ofpostgresql\_psycopg2 add the following setting:``DJANGO_CUSTOM_INDEXES_BASE_ENGINE``Example Usage:from django_custom_indexes import model_fieldsfrom django.db import modelsclass MyModel(models.Model):my_field1 = model_fields.CustomCharField(max_length=100,custom_indexes=[{'unique': True, # Optional, used to create unique indexes'name': 'custom_unique_index', # Optional (auto generated), Required only if no columns are specified'where': 'my_field2 > 0', # Optional, used to create partial Indexes},{'unique': True,'columns': ['lower(my_field1)'], # Optional, Specify columns or expressions for the index}])my_field2 = model_fields.CustomIntegerField(custom_indexes=[{'name': 'custom_gin_index1','using': 'USING gin (my_field2)', # Optional, Specify which method to use for the index}])
Package: django-customized-blog-package
This package is for blog projects only. If you want to create a blog app using Django, you can use this package.
No need to write code for blog app, just install this package and it will give you all APIs related to blog.
You can customize these classes according to your needs.Quick startAdd below apps into your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'ckeditor',
    'taggit',
    'rest_framework',
    'blog',
    'task_app',
]Add ckeditor setup codes into your settings.py like this:CKEDITOR_UPLOAD_PATH = "articles/body-images/"

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'full',
        'height': 300,
        'width': 900,
    },
}It will provide FileBasedCaching, for caching add below lines to your settings.py:CACHES = {
   'default': {
      'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
      'LOCATION': f'{BASE_DIR}/cache_data',
   }
}
SEARCH_TIMEOUT = 60*60*24

# Update middleware setup like this:
MIDDLEWARE = [
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
]Include all the polls URLconf in your project like this:urlpatterns = [
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('articles/', include('blog.urls')),
]Runpython manage.py migrateto create all the tables into database.Start the development server and visithttp://127.0.0.1:8000/articles/to perform the CRUD operations.Open thishttps://blog-module-community.herokuapp.com/to get more information about this package.
Package: django-customize-history1
#django-customise-historydjango-customise-historyis customise history feature which is used to show the old and new value of model's change field in history action of admin panel.InstallationJust use:::pip install django-customise-historySetupAdddjango_customise_historytoINSTALLED_APPSin your settings.py, e.g.:::INSTALLED_APPS = [
...
'django_customise_history',
...UsageInherit fromDjangoCustomHistoryto get the custom history feature.admin.py e.g.:::from django.contrib import admin
from .models import ExampleModel
from django_customize_history.admin import DjangoCustomHistory

@admin.register(ExampleModel)
class ExampleModelAdmin(DjangoCustomHistory, admin.ModelAdmin):
    ...ScreenshotHere is screenshot of django-customize-history
Package: django-custom-logging
django-custom-loggingDjango middleware for custom format loggingInstallationInstall the packagepython-mpipinstalldjango-custom-loggingAdd adequate middlewares toMIDDLEWAREin setting file. Current version only supports a middleware that capturesrequestinto local thread(threading.local())MIDDLEWARE=(# other middlewares ..."custom_logging.middlewares.capture_request",)Addcustom_logging.filters.CustomFiltertoLOGGINGin setting file and setcapture_listcontaining a list of variables to be captured(capture_in) and format string to be printed(capture_out). Also add filter on handler's filter list.LOGGING={"version":1,"disable_existing_loggers":False,"formatters":{"verbose":{"format":"{levelname}{asctime}{module}{process:d}{thread:d}"" [USER_ID:{user_id}]{message}",#^^^^^^^^^ - (A)"style":"{",},},"filters":{"custom_filter":{#^^^^^^^^^^^^^ - (B)"()":"custom_logging.filters.CustomFilter","capture_list":(# (capture_in, capture_out)("request.user.id","user_id"),#^^^^^^^ - (A)),},},"handlers":{"console":{"level":"DEBUG","class":"logging.StreamHandler","formatter":"verbose","filters":["custom_filter"],#^^^^^^^^^^^^^ - (B)},},"root":{"level":"INFO","handlers":["console"]},}Note that you can use any format styles(%, {, $), but should make format arguments withstrtype. For example, if you want to capturerequest.user.idasuser_id, please follow format below.%-style: %(user_id)s
{-style: {user_id}
$-style: ${user_id}How to useYou can useloggerjust like before. No extra parameter is needed.importloggingfromrest_frameworkimportstatusfromrest_framework.permissionsimportIsAuthenticatedfromrest_framework.responseimportResponsefromrest_framework.viewsimportAPIViewlogger=logging.getLogger(__name__)classExampleView(APIView):permission_classes=(IsAuthenticated,)defpost(self,request,format=None):logger.info("example log")returnResponse({"hello":"world!"},status=status.HTTP_200_OK)INFO 2021-03-25 11:33:25,170 credentials 35052 4748750336 [USER_ID:-] Found credentials in shared credentials file: ~/.aws/credentials
INFO 2021-03-25 11:33:25,505 views 35052 4748750336 [USER_ID:33] example logSupported versionsPython: >=3.5Django: >=3
Package: django-custom-modal-admin
Your project description goes hereDocumentationThe full documentation is athttps://django-custom-modal-admin.readthedocs.io.QuickstartInstall Django custom modal admin:pip install django-custom-modal-adminAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'custom_modal_admin',...)Override CustomModalAdmin in your model admin:@admin.register(ExampleModel)classExampleModelAdmin(CustomModalAdmin,admin.ModelAdmin):list_display=("title","subtitle","description",)fieldsets=((None,{"fields":(("title","subtitle","description"))}),)This admin add to your class Media this dependencies:classMedia:js=['https://code.jquery.com/jquery-2.2.4.min.js','https://code.jquery.com/ui/1.12.1/jquery-ui.min.js','js/custom_modal_admin.js',]css={'all':('https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css',),}take care of this media when override Media class.To display the modal insert in your templates a target html tag, using django admin or adding it in template or wherever you want, for example:<inputclass='js-django-admin-custom-modal'//thisclassisrequireddata-target-name='load-template-modal'//thistargetnameisrequiredtype='button'value='Click to show modal'>and the template of your modal with custom content:<divdata-django-admin-custom-modal="load-template-modal"style="display:none;"><span>This is a modal</span></div>Now you can insert whatever you want in that modal.You can also insert in the same block or display_field the admin and the button, for example:<inputclass='js-django-admin-custom-modal'type='button'data-target-name='load-template-modal'value='Click to show modal'><divdata-django-admin-custom-modal="load-template-modal"style="display:none;"><span>This is a modal</span></div>If you need to insert a modal for all your site, you can override base_site.html and insert in the extrastyle block
the required css.{% block extrastyle %}
{{ block.super }}<linkrel="stylesheet"type="text/css"href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">{% endblock %}And the required js into extrahead block:{% block extrahead %}<scriptsrc="https://code.jquery.com/jquery-2.2.4.min.js"defer></script><scriptsrc="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"defer></script><scriptsrc="{% static 'js/custom_modal_admin.js' %}"defer></script>{% endblock %}With this last implementation you can avoid to inerith CustomModalAdmin in all yours admin.CreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.2.0 (2021-11-22)First release on PyPI.
Package: django-custom-query
django-custom-query is a python module to write user provided search queries, using AND, OR and parenthesis grouping. This module will translate those to Django ORM Q objects.Documentation is available athttp://django-custom-query.readthedocs.io/or else, you can build it from source like this:$ easy_install Sphinx
$ cd docs
$ make htmlthen open _build/html/index.html in your web browser.To run tests:$ python3 run_tests.py
Package: django-custom-remote-user
=====Custom Remote User=====Custom Remote User is a Django app that extends remote user authenticationenabling custom common behavior. The app currently offers only a case-insensitivebackend `CaseInsensitiveRemoteUserBackend`.`CaseInsensitiveRemoteUserBackend` guarantees that all users created using anexternal authentication service are created with an all-lower case username.This is important because some external authentication services return acase-sensitive username upon login. This is problematic with Django as the built-inuser model is case-sensitive. This means a single remote user may have two differentrecords in that database (e.g. 'Username' is different than 'username').Quick start-----------1. Add "custom_remote_user" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'custom_remote_user',]2. Add CaseInsensitiveRemoteUserBackend::AUTHENTICATION_BACKENDS = ['custom_remote_user.backends.CaseInsensitiveRemoteUserBackend',]3. Add the required middlewares for remote user authentication::MIDDLEWARE = [...'django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.auth.middleware.RemoteUserMiddleware',...]