Saravanan666/pypi-org huggingface dataset:
Package: django-sso-app
Django user profiles management appDocumentationThe full documentation is athttps://django-sso-app.readthedocs.io.QuickstartInstall Django SSO App:pip install django-sso-appAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django.contrib.sites','rest_framework','rest_framework.authtoken','django_sso_app','allauth','allauth.account','allauth.socialaccount','django_countries','django_filters','treebeard',...)Setup settings.py:MIDDLEWARE=[...'django.contrib.auth.middleware.AuthenticationMiddleware',# required by django-sso-app'django_sso_app.core.authentication.middleware.DjangoSsoAppAuthenticationMiddleware',# django-sso-app...]...LOGIN_URL='/login/'LOGIN_REDIRECT_URL='/'SITE_ID=1Add Django SSO App’s URL patterns:fromdjango.utilsimporttimezonefromdjango.views.i18nimportJavaScriptCatalogfromdjango.views.decorators.httpimportlast_modifiedfromdjango_sso_app.urlsimport(urlpatternsasdjango_sso_app__urlpatterns,api_urlpatternsasdjango_sso_app__api_urlpatterns,i18n_urlpatternsasdjango_sso_app_i18n_urlpatterns)last_modified_date=timezone.now()js_info_dict={}urlpatterns=[...url(r'^jsi18n/$',last_modified(lambdareq,**kw:last_modified_date)(JavaScriptCatalog.as_view()),js_info_dict,name='javascript-catalog'),...]urlpatterns+=django_sso_app__urlpatternsurlpatterns+=django_sso_app__api_urlpatternsurlpatterns+=django_sso_app_i18n_urlpatternsFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.12.0 (2021-10-11)Minor release on PyPI.
Package: django-sso-ui
django-sso-uiSebuah library python untuk memudahkan aplikasi django menggunakan SSO
Universitas Indonesia.Instalasipip install django-sso-uiCara MenggunakanPertama import decoratorwith_sso_uifrom django_sso_ui.decorators import with_sso_uiLalu wrap ke view yang membutuhkan info user sso ui. Jangan lupa tambahkan parametersso_profilepada fungsi view yang di wrap.@with_sso_uideflogin(request,sso_profile):returnHttpResponse(json.dumps(sso_profile))Apabila pengguna tidak diharuskan login dengan SSO untuk mengakses view tersebut, tambahkan parameterforce_login=Falsepada decorator.@with_sso_ui(force_login=False)deflogin(request,sso_profile):returnHttpResponse(json.dumps(sso_profile))SettingsUntuk mengubah endpoint cas yang digunakan, terdapat opsi di tambahkan
line berikut disettings.pydengan endpoint yang diinginkanSSO_UI_URL="https://sso.ui.ac.id/cas2/"Untuk memaksa library untuk menggunakanhttpsuntuk url callback setelah
login CAS berhasil, tambahkan line berikut disettings.pySSO_UI_FORCE_SERVICE_HTTPS=TrueNotesInformasi tambahan seperti fakultas, study_program hanya bisa didapatkan
apabila menggunakanhttps://sso.ui.ac.id/cas2.
Package: django-sssoon
django-sssoonDjango-sssoon is a simple Django app to add beautiful coming soon webpage to your django website. This template is
based on on Bootstrap 3 and designed byCreative Tim.Quick startdjango-sssoon is available on the Python Package Index (PyPI), so it can be installed with standard Python tools likepiporeasy_install:pipinstalldjango-sssoonAdd "sssoon" and "captcha" to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'captcha','sssoon',]Sign up for reCAPTCHA, then Add the Google reCAPTCHA keys
generated to your Django production settings with RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY# https://github.com/praekelt/django-recaptchaRECAPTCHA_PUBLIC_KEY="MyRecaptchaKey123"RECAPTCHA_PRIVATE_KEY="MyRecaptchaPrivateKey456"RECAPTCHA_REQUIRED_SCORE=0.3Include the sssoon URLconf in your project urls.py like this to make your index page coming sssoon:path('',include('sssoon.urls',namespace="sssoon")),Collect static filespythonmanage.pycollectstaticStart the development server and visithttp://127.0.0.1:8000/
Package: django-s-store-api
django-s-store-apidjango-s-store-apiis a simple store rest api of django.InstallationTo install django-s-store-api like this:pipinstalldjango-s-store-apiConfigurationWe need to hookdjango-s-store-apiinto our project.Put s_store_api into your INSTALLED_APPS at settings module:INSTALLED_APPS = (
    ...,
    's_store_api',
)Creates_store_apidatabase table by running:pythonmanage.pymigrateAdd url patterns at project.urls module:from s_store_api import urls as s_store_api_urls

urlpatterns = [
    ...,
    path(r'api/stores/', include(s_store_api_urls))
]APIList storesShow list stores which are allowed to access by login user.method: GET
url: /api/stores/
name: s-stores:stores-list
view: StoreViewSetDetail storeShow detail of target store.Show detail with store items, if items parameter is true.method: GET
url: /api/stores/<pk>/[?items=true]
name: s-stores:stores-detail
view: StoreViewSetOpen storeOpen your store.Invite user to allow access store, when set true at is_limited_accessmethod: POST
url: /api/stores/
parameters: 
{
    'name': 'store name', 
    'is_limited_access': True
}
name: s-stores:stores-list
view: StoreViewSetClose storeClose your store.method: DELETE
url: /api/stores/<pk>/
name: s-stores:stores-detail
view: StoreViewSetUpdate store's infoUpdate your store's informationmethod: PUT/PATCH
url: /api/stores/<pk>/
parameters: 
{
    'name': 'changed store name', 
    'is_limited_access': False
}
name: s-stores:stores-detail
view: StoreViewSetHire staffHire staff.method: PUT
url: /api/stores/<pk>/hire_staff/
parameters: 
{
    'staff': 2 (user's id)
}
name: s-stores:stores-hire-staff
view: StoreViewSetDismiss staffDismiss staff.method: PUT
url: /api/stores/<pk>/dismiss_staff/
parameters: 
{
    'staff': 2 (user's id)
}
name: s-stores:stores-dismiss-staff
view: StoreViewSetInvite userInvite user to limited access storeRequest parameter's format should be json.method: PUT
url: /api/stores/<pk>/invite_user_to_limited_access/
parameters: 
{
    'users': [
        2 (user's id),
        4
    ]
}
name: s-stores:stores-invite-user-to-limited-access
view: StoreViewSetList itemsList items at storemethod: GET
url: /api/stores/<store>/items/
name: s-stores:items-list
view: ItemViewSetDetail itemDetail item at storemethod: GET
url: /api/stores/<store>/items/<pk>/
name: s-stores:items-detail
view: ItemViewSetBuy itemBuy item from store.
You received item in bag and receipt.method: POST
url: /api/stores/<store>/items/{pk}/buy/
parameters: 
{
    'price': 2 (item.price.pk)
}
name: s-stores:items-buy
view: ItemViewSetSell itemSell item to store.
Request parameter's format should be json.method: POST
url: /api/stores/<store>/items/
parameters: 
{
    'name': 'new_item',
    'prices_set': [
        {'coin_id': 2 (coin.pk), 'value': 100},
        {'coin_id': 3 (coin.pk), 'value': 10},
    ]
}
name: stores:items-list
view: ItemViewSetSet pricesSet prices to exists item.
Request parameter's format should be json.method: POST
url: /api/stores/items/<item>/prices
parameters: 
[
    {'coin_id': 4 (coin.pk), 'value': 1000},
    {'coin_id': 5 (coin.pk), 'value': 11},
]
name: s-stores:prices-list
view: PriceViewSet
Package: django-stackato
Django Stackato ExtensionsExperimental packageExtra commands for improved Django support inActiveState Stackato. For the moment, this just
includes achangepassword2command, an alternate implementation of
Django’schangepassword,
that accepts password from the command-line, sostackato runcan
be used non-interactively to set the admin password.Getting StartedAdddjango-stackatoto yourrequirements.txtAdddjango_stackatoto INSTALLED_APPS of settings.py.Run management commands:python manage.py createsuperuser --username=admin --email=admin@example.com --noinput
python manage.py changepassword2 admin secret123Changes1.0Release date: 01-06-2011Fix typo in docs0.9Release date: 27-05-2011Initial release
Package: django-stackhelper
Generate configuration files for other parts of your Django stack.As well as your django application, your stack might contain other components,
such as:nginxapachememcachedredisvarnishAny or all of these will need some configuration to work with your application.
Writing these configuration files by hand can be error prone and needs to be
coordinated around changes to your software.This django application will help you manage these files. You might want to
pair this with django-json-settings, or something else that provides local
settings, so you can easily configure your stack ona per-environment basis.WorkflowPackaging template configuration filesDuring application development, template files for other production stack
components are placed in the “stack” directory of your django project:mysite/
    myapp/
        ...
    stack_templates/
        apache/
            apache.conf
        varnish/
            varnish.vcfBuilding configuration files for the current environmentA management command is provided to generate configuration files based on the
current settings for the project in the current environment.If you are running inside a virtual environment then the files will be written to:<sys.prefix>/etcOtherwise you will need to provide a destination directory as an argument.Creating production configuration filesSince files are placed in <sys.prefix>/etc when run in a virtual environment,
you can symlink these directly into place if you wish:For example, it produces the files:<sys.prefix>/etc/apache/apache.conf
<sys.prefix>/etc/varnish/varnish.vcfYou can link them straight into your config:ln -s <sys.prefix>/etc/apache/apache.conf /etc/apache2/sites-available/mysite.confAlternatively, it may be that these files may not be suitable for use in
production yet - some settings may not be available to the django application
and so it requires further manual changes. In this case, review these
files, editing them as required, and placing them in the right location.Running stackhelperThe following management commands are provided:stack_generateUsage: manage.py stack_generate [–force] [directory]Generates new versions of configuration files in the specified directory,
if specified. Otherwise to <sys.prefix>/etc if in a virtual environment.Files will not be overwritten unless –force is specified.stack_diffUsage: manage.py stack_diff [directory]Prints out differences if the generated files would be different. Returns 0
if the files are all identical, or 1 if the files should be regenerated.
Package: django-stack-inspector
Django Stack InspectorThe Django Stack Inspector package is useful to inspect the current call stack of a Django application and determine if it is starting up or already running.It is likely that the 99% of applications do not have a need for this, but in specific niche scenarios it can be very useful. For example, when implementing a model manager that limits queries to items owned by a specific tenant by overriding theget_queryset()method filtered using data stored in aContextVaror thread-local set by a request middleware. It may be desired that if queries are executed without theContextVarbeing appropriately set (e.g. queries via asynchronous background workers or via admin commands) then theget_queryset()method fails-closed by throwing an exception warning the user that the required context is not set. However, this fail-closed behaviour breaks the management commands for migrations by throwing the exception.Installationpip install django_stack_inspectorUsageAn example of how to use when creating a custom model manager to restrict queries to specific tenants.fromdjango_stack_inspectorimportStackInspectordefget_queryset(self):"""Override the default queryset behaviour to enforce a filter dependent on the tenant contextThe queryset will fail-closed if a query is ran without a context, either by returning no results in thequeryset or by raising an exception."""try:ctx=get_request_context()exceptRequestContextNotSetasexc:# Context not set so fail-closedifStackInspector().is_app_startup():# Silence exception and return empty queryset as app starting (i.e. is a management command)returnsuper().get_queryset().none()# Raise exception to alert developerraiseexc# Perform filteringreturnsuper().get_queryset().filter(tenant=ctx.tenant)
Package: django-stack-it-bak
=============================
django-stack-it.. image::https://api.codacy.com/project/badge/Grade/4c1f910320434a5fb2fb828ebfcbaf95:alt: Codacy Badge
:target:https://app.codacy.com/app/Jufik/django_stack_it?utm_source=github.com&utm_medium=referral&utm_content=VingtCinq/django_stack_it&utm_campaign=Badge_Grade_Dashboard.. image::https://badge.fury.io/py/django-stack-it.svg:target:https://badge.fury.io/py/django-stack-it.. image::https://api.codacy.com/project/badge/Coverage/a842b7f950cd465d91d6b06c7d56ce16:target:https://www.codacy.com/app/Jufik/django_stack_it?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=VingtCinq/django_stack_it&amp;utm_campaign=Badge_Coverage.. image::https://travis-ci.org/VingtCinq/django_stack_it.svg?branch=master:target:https://travis-ci.org/VingtCinq/django_stack_itContent management system under developmentQuickstartInstall django-stack-it::pip install django-stack-itDjango Stack It relies on several dependencies, you need to add to your INSTALLED_APPS.. code-block:: pythonINSTALLED_APPS = (
    ...
    'polymorphic_tree',
    'polymorphic',
    'mptt',
    'imagekit',
    'stack_it'
    ...
)Add django-stack-it's URL patterns:.. code-block:: python
urlpatterns = [
...
path(r'^', include('stack_it.urls')),
...
]To avoid migration messup, we strongly recomend you to deportStack Itmigrations to your project.
This will avoid any unexpected conflict between environements, due to language addition/deletion.
In your settings:.. code-block:: python
MIGRATION_MODULES = {
"stack_it":"tests.migrations"
}Basic UsageAs soon as you a model is linked to a URL, it should inherit from thePagemodel... code-block:: python
from stack_it.models import Pageclass Article(Page):
    """
    Your model here
    """
    ....Article is now considered to be a Page.
It comes with several usefull fields liketitle,slugdanstemplate_path.Register your model to the admin the way you want,
and you can see all your website organization within one unified admin doing:.. code-block:: python
from stack_it.admin import PageAdmin as BasePageAdmin
from stack_it.models import Page
from blog.models import Articleclass PageAdmin(BasePageAdmin):
    base_model = Page
    child_models = (
        ...Your inherited model here,
        Article,
        ...
    )
 admin.site.register(Page, PageAdmin)Articleor any other model won't show up in the admin anymore.
Each model and model instances will be managed from the "Page" admin,
where all your pages are organized in a Drag n Drop interface to build up your site structure.If you want your model's to be registered as usual, addshow_in_index = Truein your admin class to allowFeaturesTODORunning TestsDoes the code actually work?::source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecutter_cookiecutter-djangopackage_.. _Cookiecutter:https://github.com/audreyr/cookiecutter.. _cookiecutter-djangopackage:https://github.com/pydanny/cookiecutter-djangopackageHistory0.1.0 (2019-01-14)
++++++++++++++++++First release on PyPI.
Package: django-staff
In the Django Authentication package all users use the same model/profile. This can be a drawback if you have lots of users and you want different information stored for your staff members, such as bio, contact info, etc. It is also handy for linking to models for author fields so the lookup is quicker.The staff models are automatically created and managed by theis_staffproperty ofUsers. The staff profile is automatically added to theUseradmin screen.
Package: django-staff-view
django-staff-viewGeneric non-model related admin views for Django.RationaleDefine admin views for Django admin not tied to a ModelAdmin.SupportSupports: Python 3.10.Supports Django Versions: 4.2.9Installation$pipinstalldjango-staff-viewUsageAddstaff_viewstoINSTALLED_APPS.Import the view class from the package, and subclass it like this:fromdjangoimportformsfromstaff_view.viewsimportStaffViewclassMyForm(forms.Form):text=forms.CharField()classMyView(StaffView):form_class=MyFormdefform_valid(self,form):...# Return a response object
Package: django-standalone-setup
Installation$[sudo]pipinstalldjango-standalone-setupFeaturescallsdjango.setuponce onlyConfig$exportDJANGO_SETTINGS_MOULE='django_settings'site-package/django_settings.pyINSTALLED_APPS=['your_app',]DATABASES={'default':{...}}Examplesscript.py# !/usr/bin/env pythonimportdjango_standalone_setup# at the top of module...readme42.com
Package: django-standard-form
Quick and simple django templatetags for displaying forms.Installationpip installdjango-standard-formadd'standard_form'to yourINSTALLED_APPSUsageMost basic example:{% load standard_form %}

<form action="" method="post" class="frm">
    {% csrf_token %}
    <fieldset class="frm-horizontal">
        {% standard_form form %}
        {% standard_submit %}
    </fieldset>
</form>Rendering fields individually:<form action="" method="post" class="frm">
    {% csrf_token %}
    <fieldset class="frm-horizontal">
        <ol>
            <li>{% standard_field form.field_name_one %}</li>
        </ol>
    </fieldset>
    <fieldset class="frm-vertical">
        <ol>
            <li>{% standard_field form.field_name_two %}</li>
        </ol>
        {% standard_submit %}
    </fieldset>
</form>Rendering widgets individually:<form action="" method="post" class="frm">
    {% csrf_token %}
    <fieldset class="frm-horizontal">
        <ol>
             <li>
                 <label for="id_{{ form.field_name_one.name }}">My label or other stuff</label>
                 <div class="field">{% standard_widget form.field_name_one %}</div>
             </li>
             <li>
                 <label class="empty"></label>
                 <div class="field"><input type="submit" class="btn" value="{% trans 'Go' %}" /></div>
             </li>
        </ol>
    </fieldset>
</form>All available options:{% standard_field form.field_name_one 'no_required no_required_helper no_help_text no_error_text' custom_class='input-block' placeholder='This one has all the available options' label='My label' %}
Package: django-standbydb-router
``standby`` provides a Django database router useful in master-standby deployments.MasterStandbyRouter-----------------With ``standbydb.MasterStandbyRouter`` all read queries will go to a standbydatabase;  all inserts, updates, and deletes will go to the ``default``database.First, define ``STANDBY_DATABASES`` in your settings.  It should be a list ofdatabase aliases that can be found in ``DATABASES``::DATABASES = {'default': {...},'standby-1': {...},'standby-2': {...},}STANDBY_DATABASES = ['standby-1', 'standby-2']Then put ``standbydb.MasterStandbyRouter`` into DATABASE_ROUTERS::DATABASE_ROUTERS = ('standbydb.MasterStandbyRouter',)The standby databases will be chosen in round-robin fashion.If you want to get a connection to a standby in your app, use``standbydb.get_standby``::from django.db import connectionsimport standbydbconnection = connections[standbydb.get_standby()]Running the Tests-----------------To run the tests, you'll need to install the development requirements::pip install -r requirements.txt./run.sh test
Package: django-stardate-filter
Django-stardate-filter is a small Django app implementing a filter to display a date as a Star-Trek stardate in a template.Detailed documentation is in the “docs” directory.Quick startAdd “stardate” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'stardate',
]Use the filter with a date as follows for example:{% now ‘Y-m-d H:i’ as today %}
{% load stardate %}
<div>Stardate: {{ today|stardate }}</div>And it display the date provided as a stardatePlease use this app and the code freely
Special thanks to Nicolas FLANDROIS for the conversion formula
Live long and Prosper
Package: django-starfield
DescriptionThis is a simple widget rendering so-called rating stars as input for an
integer field. It is based solely on CSS 3, as laid out byMartin Ivanov.This is different from other star rating applications in that it provides
only a widget returning its selction to any IntegerField. It is not a
complete rating application, just a presentational widget for integer input.
It is also different in that it depends only on CSS3, without any
JavaScript.In contrast to others (and to the original work credited above), this widget
also works on browsers that do not support CSS (like text-mode browsers). In
that case, it renders as basic radio buttons with numbers.UsageJust add the Stars widget to any IntegerField in a Django form.fromdjangoimportformsfromdjango_starfieldimportStarsclassStarsExampleForm(forms.Form):rating=forms.IntegerField(widget=Stars)The following aspects are configurable, both in the Django settings and when
creating the widget (by passing an argument to Stars):AspectFormatDefaultSetting nameArgumentNumber of starsinteger5STARFIELD_STARSstarsCharacter used as starhexadecimal codepoint2605STARFIELD_CODEPOINTcodepointColour of starsHTML colour#f5b301STARFIELD_COLOURcolourPlease note that some browsers render some Unicode characters, especially
emojis, as images, so changing the font colour will not work.
Package: django-startapi
Django Start-APIQuick REST API creation.Quick ready to use REST API based on Django and DRF, create your config file,
launch 'startapi' and you will get:Standard Django project createdAll app createdFor each app:Models already created and migratedFor each model:full working api (GET, POST, PUT PATCH, DELETE) (refer to:https://www.django-rest-framework.org/api-guide/routers/#simplerouter)ModelViewSet already createdModelSerializer already createdRegistered urls with DefaultRouterRegistered model in adminInstallationpip install django_startapiQuickstartCreate your config.yamlRun 'startapi'UsageThis software is intented to be used to create an initial full working REST API,
based on Django and Django Rest Framework. Design apps with models inside a config file and
run django_startapi.Create a config file named 'config.yaml'run startapioptional: python manage.py createsuperuserpython manage.py runserver and go tohttp://127.0.0.1:8000/api/Config fileAdd a project name used as for django-admin stratprojectDefine your apps with models, models fields are Django fieldsNote: Write related model name as string or put related models before
relation  to avoid "NameError: name 'YourModel' is not defined"Config file structure:project: <your_project_name>
apps:
    <app_name>:
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
    <app_name>:
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
     ...Example of config fileproject: audiolibrary
apps:
    band:
        Musician:
            name: CharField(max_length=40)
            surname: CharField(max_length=40)
            born_date: DateField(null=True)
        Band:
            name: CharField(max_length=100)
            author: ManyToManyField('Musician')
    album:
        Genre:
            name: CharField(max_length=100)
        Label:
            name: CharField(max_length=100)
        Album:
            name: CharField(max_length=120)
            band: ForeignKey('band.Band',  on_delete=models.DO_NOTHING)
            label: ForeignKey('Label',  on_delete=models.DO_NOTHING)
            date: DateField(null=True)
Package: django-startappextracontext
Installation==========Installing:easy_install django-startappextracontextor:pip install django-startappextracontextThen add `startappextracontext` to your `INSTALLED_APPS`:INSTALLED_APPS = (#... your other apps('startappextracontext'),)Example usage===========To create an new app called `my_stuff` from a custom template residing in `~/my-custom-app-template` with thecustom variable `model_name` with value `Stuff` you can do the following:./manage.py startappextracontext --template=~/my-custom-app-template --extra-context=[model_name]Stuff my_stuff