Saravanan666/pypi-org huggingface dataset:
Package: django-seeding-data
Django Seeding DataDjango Seeding Data is Django app for seeding data in existing DB.Quick startAdd "django_seeding_data" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (
...
'seeding',
)Add "SEEDING_DIR" to your settings.py file like this::SEEDING_DIR = "mainapp/seeding/"Runpython manage.py seeding createto create new seeding file in path from previous instruction.Write some seeding code in methodseedingfrom classSeeding, for create superuser, or add new groups.Runpython manage.py seeding seedto apply new seeding files that was never applied on this DB instance.
Package: django-sekh
Django Search Engine KeywordsHighlighter,is a middleware for Django providing the capacities to highlight the user’s
search keywords if he is coming from a search engine like Google, Yahoo or
a custom search form plugged in your Website.It retrieves the keywords of the search and decorate them with aspanmarkup containing the classeshighlightterm-Xfor CSS makuping.ContentsInstallationUsageSearch EnginesTestingInstallationFirst of all you need to installBeautifulSoup>= 4.0.Then install the package in yourPYTHON_PATHby getting the
sources and runsetup.pyor usepip.$ pip install -e git://github.com/Fantomas42/django-sekh.git#egg=django-sekhUsageIn your settings file, simply add this middleware at the end of the list.MIDDLEWARE_CLASSES = (
  ...
  'sekh.middleware.KeywordsHighlightingMiddleware',
  )This is it !Search EnginesCurrenty django-sekh supports these search engines :AskBaiduBingGoogleHotbotLycosYahooAnd even if you have a custom search engine plugged on your website,sekhcan highlight the searched keywords. Currentlysekhwill
highlight all the terms contained in this list of GET variables :['highlight', 'hl', 'q', 'query', 'pattern']You can change the supported values by defining a variable namedHIGHLIGHT_GET_VARNAMESrepresenting a list of supported variable names
in your project’s settings.TestingIf you want to test the highlighter, you can pass keywords in thehlparameter in GET.http://localhost:8000/admin?hl=django%20admin
Package: django-sekizai
Sekizai means “blocks” in Japanese, and that’s what this app provides. A fresh
look at blocks. With django-sekizai you can define placeholders where your
blocks get rendered and at different places in your templates append to those
blocks. This is especially useful for css and javascript. Your sub-templates can
now define css and Javascript files to be included, and the css will be nicely
put at the top and the Javascript to the bottom, just like you should. Also
sekizai will ignore any duplicate content in a single block.There are some issue/restrictions with this implementation due to how the
django template language works, but if used properly it can be very useful and
it is the media handling framework for the django CMS (since version 2.2).NoteThis project is endorsed by thedjango CMS Association.
That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy.
Join us onSlack.Contribute to this project and win rewardsBecause this is a an open-source project, we welcome everyone toget involved in the projectandreceive a rewardfor their contribution.
Become part of a fantastic community and help us make django CMS the best CMS in the world.We’ll be delighted to receive your
feedback in the form of issues and pull requests. Before submitting your
pull request, please review ourcontribution guidelines.We’re grateful to all contributors who have helped create and maintain this package.
Contributors are listed at thecontributorssection.DocumentationSeeREQUIREMENTSin thesetup.pyfile for additional dependencies:Please refer to the documentation in the docs/ directory for more information or visit ouronline documentation.Running TestsYou can run tests by executing:virtualenv env
source env/bin/activate
pip install -r tests/requirements.txt
python setup.py test
Package: django-selecmat
SelecmatMaterializeCSS + Selectize.js for Django FormA simple Django template tag to work withMaterializecssandSelectize.jsInstallpip install  django-selecmaton pypion GitHubAdd to INSTALLED_APPS:INSTALLED_APPS = (
     'selecmat',
     ...
     )Add MaterializeCSS and Selectize to your project:In your base.html:<head>

{% block css %}
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css">

  <link type="text/css" rel="stylesheet" href="{% static 'css/selectize.css' %}" media="screen,projection"/>

{% endblock css %}

</head><body >

  {% block javascript %}
  <script
    src="https://code.jquery.com/jquery-3.3.1.min.js"
    integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
    crossorigin="anonymous"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/js/materialize.min.js"></script>
  <script type="text/javascript" src="{% static 'js/selectize.min.js' %}"></script>

  <script>
  $(document).ready(function(){

    // Initialize materialize data picker
    $('.datepicker').datepicker({'format': 'yyyy-mm-dd'});
    $('select').selectize();

  });

  </script>

  {% endblock javascript %}



  ...

  </body>UsageUse it like this, simple.{% load selecmat %}All the form{{ form|selecmat }}Individual field{{ form.<> | selecmat }}Custom size (default is 's12'){{ form|selecmat:'m6' }}Icons supportThis is most useful for adding a descriptive icon when you are creating a custom layout by building the form one field at a time. Substitue FIELD_NAME below with one of the field names from your form.{{ form.FIELD_NAME|selecmat:'s12 m6, icon=person' }}
{{ form.FIELD_NAME|selecmat:'custom_size=s12 m6, icon=person' }}DemoHelpWidgetTextInputTextareaCheckboxInputRadioSelectSelectSelectMultipleCheckboxSelectMultipleFilefieldDateFieldDateTimeField (doesn't show time yet)Inspired bydjango-bootstrap-formOriginally Built ByFlorent CLAPIÃ‰https://pypi.org/user/florent1933/Adapted fromdjango-materialize-form
Package: django-select2-admin-filters
django_select2_admin_filtersThis extension is based ondjango-select2and works with or without Grappelli.InstallationInstall using pippip install django-select2-admin-filtersUpdate INSTALLED_APPS, you need too put django_select2_admin_filters after admin and django_select2INSTALLED_APPS=['django.contrib.admin',#'django_select2','django_select2_admin_filters',]Update urls.py to use model filters (refer todjango-select2 documentation)path('select2/', include('django_select2.urls')),FiltersFilters are generally of two types, but each of them can be single or multiple selectable:ChoiceFilterChoiceSelect2FilterMultipleChoiceSelect2FilterModelFilterModelSelect2FilterMultipleModelSelect2FilterUsageUse filter in your admin.pyfromdjango.contribimportadminfromdjango_select2_admin_filters.adminimport(Select2AdminFilterMixin)fromdjango_select2_admin_filters.filtersimport(ChoiceSelect2Filter,MultipleChoiceSelect2Filter,ModelSelect2Filter,MultipleModelSelect2Filter)fromyour_app.modelsimportCountry,Person,ProfessionclassCountryFilter(ModelSelect2Filter):title='Country of residence'# filter's titleparameter_name='country'# parameter used in url and by default field name of Foreign Key used to filter resultsautocomplete_queryset=Country.objects.all()# queryset to autocompletesearch_fields=['name__icontains']# fields of Country model used to filtering# optionally you can override queryset methoddefqueryset(self,request,queryset):val=self.value()ifval:returnqueryset.filter(country_of_residence=val)returnquerysetclassProfessionFilter(MultipleModelSelect2Filter):title='Profession'parameter_name='profession'autocomplete_queryset=Profession.objects.all()search_fields=['name__icontains']defqueryset(self,request,queryset):val=self.value_as_list()iflen(val)>0:returnqueryset.filter(professions__profession_id__in=val)returnquerysetclassStatusFilter(ChoiceSelect2Filter):title='Status'parameter_name='status'autocomplete_choice_list=[# list of choices(1,'Active',),(2,'Suspended',),(3,'Deleted',),]@admin.register(Person)classPersonAdmin(Select2AdminFilterMixin,admin.ModelAdmin):# change_list_template = 'admin/change_list_filter_sidebar.html' <- DON'T override change_list_templatelist_filter=(CountryFilter,ProfessionFilter,StatusFilter,)# actually you cannot mix filters with traditional filtersTODOadd testsadd handlingdependent_fieldsAuthorBartłomiej Żmudziński
Package: django-select2-rocks
Light integration glue betweenDjangoandSelect2.This project is inspired byDjango-Select2anddjango-select2light.Django-select2-rocks is distributed under the BSD 2-clause license.Installationpip install django_select2_rocksaddselect2rocksto yourINSTALL_APPSpython manage.py collectstaticwill install Django Select2 Rocks JS.Include jQuery (1.7+), Select2 JS/CSS (not provided, tested with v3.4.5) and
select2rocks/select2rocks.js in your templates.Now, you can useSelect2ModelChoiceFieldfields in your forms.DesignDjango-select2-rocks provides widgets to render and initialize Select2 inputs.The widget rendering is based on Django with a further step which adds a JS
initialization for each input (on DOM ready). When a character is typed in the
input field, an AJAX request is sent to the URL associated to the field.The widget API is designed to allow you to pass any arguments you want to
Select2 JS code (eg. allowClear option).You can use various JSON views to answer to Select2 AJAX queries, and so to
adjust search terms or the format of the results, it’s possible to extend the
default django-select2-rocks backend (see select2rocks-backends.js in testproj
for an example).ExampleThe testproj project contains examples with a simple JSON view and a
Django REST framework view.importselect2rocksclassBeachForm(forms.Form):beach=select2rocks.Select2ModelChoiceField(queryset=Beach.objects.all(),widget=select2rocks.AjaxSelect2Widget(url_name='json_beaches'))SubtletiesBeware, the internal representation of the fields uses commas (,) to separate items. Thus youcannotuse commas
in your labels. Otherwise we’ll interpret it as a separator and try to work with the text on both sides of the comma,
which will most likely break.Get the CodeDjango-select2-rocks is developed on GitHub:https://github.com/polyconseil/django-select2-rocksYou can either clone the public repository:$gitclonegit://github.com/polyconseil/django-select2-rocks.gitOnce you have a copy of the source, you can install it with:$pythonsetup.pyinstall
Package: django-select2-tags
django-select2-tagsprovides a form class and form fields to handle storing new Django model
values created usingSelect2fields with tags enabled. This is a rough project at the moment;
it doesn’t handle required fields well nor does form validation restore tags to inputs. It may
still help you out, and pull requests are welcome!Tested on Python 2.7 and 3.5 with Django 1.10.Like my work? Tip me!https://www.paypal.me/jessamynsmithInstallationThe development version can be installed with:pip install -e git://github.com/jessamynsmith/django-select2-tags.git#egg=django-select2-tagsIf you are developing locally, your version can be installed from the
working directory with:python setup.py.installUsageThe simplest way to usedjango-select2-tagsis to useselect2_tags.forms.Select2ModelChoiceFieldandselect2_tags.forms.Select2ModelMultipleChoiceFieldin the ModelForm fordjango.db.models.ForeignKeyanddjango.db.models.ManyToManyFieldmodel fields, respectively. These fields extend
their django equivalents and take the same arguments, along with the requiredvalue_fieldargument and an optionalsave_newkeyword argument. Currently, this only works with
nullable model fields, and you must passrequired=Falseto the choice fields.If you use theselect2_tags.forms.Select2ModelFormin place of a regular ModelForm and set
save_new=True on any Select2 choice fields, the new values will be saved for you.Given the following models:class MyRelatedModel(models.Model):
    name = models.CharField(max_length=20)


class MyModel(models.Model):
    my_fk_field = models.ForeignKey(MyRelatedModel, null=True, blank=True)
    my_m2m_field = models.ManyToManyField(MyRelatedModel)You could create the following form to automatically save the select2 tag values:from select2_tags import forms


class MyFkForm(forms.Select2ModelForm):
    class Meta:
        model = MyModel
        exclude = []

    my_fk_field = forms.Select2ModelChoiceField(
        'name', queryset=test_models.MyRelatedModel.objects.all(), required=False)
    my_m2m_field = forms.Select2ModelMultipleChoiceField(
        'name', queryset=test_models.MyRelatedModel.objects.all(), required=False)You will be able to enter new values on the edit page and they will be saved to the database,
so long as select2 is set up with tags enabled:$("#id_my_fk_field").select2({
    tags: true
});DevelopmentFork the project on github and git clone your fork, e.g.:git clone https://github.com/<username>/django-select2-tags.gitCreate a virtualenv and install dependencies:mkvirtualenv django-select2-tags
pip install -r requirements/package.txt -r requirements/test.txtRun tests with coverage (should be 100%) and check code style:coverage run manage.py test
coverage report -m
flake8Verify all supported Python versions:pip install tox
toxInstall your local copy:python setup.py install
Package: django-selectable
Tools and widgets for using/creating auto-complete selection widgets using Django and jQuery UI.NoteThis project is looking for additional maintainers to help with Django/jQuery compatibility
issues as well as addressing support issues/questions. If you are looking to help out
on this project and take a look at the openhelp-wantedorquestionand see if you can contribute a fix. Be bold! If you want to take a larger role on
the project, please reach out on themailing list. I’m happy to work
with you to get you going on an issue.FeaturesWorks with the latest jQuery UI Autocomplete libraryAuto-discovery/registration pattern for defining lookupsInstallation RequirementsPython 3.9+Django>= 3.2jQuery>= 1.9, < 3.0jQuery UI>= 1.10To install:pip install django-selectableNext addselectableto yourINSTALLED_APPSto include the related css/js:INSTALLED_APPS = (
    'contrib.staticfiles',
    # Other apps here
    'selectable',
)The jQuery and jQuery UI libraries are not included in the distribution but must be included
in your templates. See the example project for an example using these libraries from the
Google CDN.Once installed you should add the urls to your root url patterns:urlpatterns = [
    # Other patterns go here
    url(r'^selectable/', include('selectable.urls')),
]DocumentationDocumentation for django-selectable is available onRead The Docs.Additional Help/SupportYou can find additional help or support on the mailing list:http://groups.google.com/group/django-selectableContributingIf you think you’ve found a bug or are interested in contributing to this project
check out ourcontributing guide.If you are interested in translating django-selectable into your native language
you can join theTransifex project.
Package: django-selectable-filter
django-selectable-filter=======================Installation------------Use pip/easy_install.. code-block:: bashpip install django-selectable-filterAdd selectable_filter to settings.INSTALLED_APP. For this, edit the setup.py file:.. code-block:: pythonINSTALLED_APPS = (...'selectable_filter')Inspiration------------This project was inspired on library django-datefilterspechttps://github.com/tzulberti/django-datefilterspec
Package: django-selectel-storage
This application allows you easily save media and static files into Selectel cloud storage.InstallationInstall the packagepipinstalldjango-selectel-storageAdd to your settings module:DEFAULT_FILE_STORAGE='django_selectel_storage.storage.SelectelStorage'SELECTEL_STORAGES={'default':{'USERNAME':'xxxx_user1','PASSWORD':'secret','CONTAINER_NAME':'bucket',},'yet-another-schema':{'USERNAME':'yyyy_user2','PASSWORD':'mystery','CONTAINER_NAME':'box',},}Please see details in thedocumentation.
Package: django-selectize
Django Selectizedjango-selectize  is a Django app based on Selectize.js that help you to create Select and Multiselect widgets in Django forms.InstallationInstalldjango-selectize:pip install django-selectizeAdddjango-selectizeto yourINSTALLED_APPSin your project settings.INSTALLED_APPS = [
    # other django apps...
    'django_selectize',
]Quick StartHere is a quick example to get you started:We have the following model:# models.py
from django.conf import settings
from django.db import models

class Book(models.Model):
    author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    co_authors = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='co_authored_by')Next, we create a model form with custom Selectize widgets.# forms.py
from django import forms
from django_selectize import forms as s2forms

from . import models

class AuthorWidget(s2forms.SelectizeWidget):
	search_fields = [
		"username__icontains",
		"email__icontains",
	]

class CoAuthorsWidget(s2forms.SelectizeMultipleWidget):
	search_fields = [
		"username__icontains",
		"email__icontains",
	]

class BookForm(forms.ModelForm):
	class Meta:
		model = models.Book
		fields = "__all__"
		widgets = {
			"author": AuthorWidget,
			"co_authors": CoAuthorsWidget,
		}A simple class based view will do, to render your form:# views.py
from django.views import generic

from . import forms, models

class BookCreateView(generic.CreateView):
    model = models.Book
    form_class = forms.BookForm
    success_url = "/"Make sure to add the view to yoururls.py:# urls.py
from django.urls import include, path
from . import views

urlpatterns = [
    # ... other patterns
    path("", views.BookCreateView.as_view(), name="book-create"),
]Finally, we need a little template,myapp/templates/myapp/book_form.html<!DOCTYPE html>
<html lang="en">
<head>
    <title>Create Book</title>
    {{ form.media.css }}
    <style>
        input, select {width: 100%}
    </style>
</head>
<body>
    <h1>Create a new Book</h1>
    <form method="POST">
        {% csrf_token %}
        {{ form.as_p }}
        <input type="submit">
    </form>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    {{ form.media.js }}
</body>
</html>
Package: django-selector
django-selector is a custom url pattern parser for Django that is based off ofLuke Arno’s Selectorfor WSGI.  It
is designed to simplify the writing and reading of url patterns by providing
recipes for frequently used patterns.  django-selector’s parser ignores classic
regex based url patterns, so if you require the flexibility of regexes you
needn’t jump through registration hoops for a one-off url pattern. Using these
named patterns in your urls.py clarifieswhatthey are matching as well ashowthey are matching it:patterns('foo.views',
(r'^/(?P<name>[a-zA-Z0-9\-]+)/(?P<foos>\d*.?\d+)/$', 'index', {}, 'foo-index'))becomes:parser.patterns('foo.views',
(r'/{name:slug}/{foos:number}/', 'index', {}, 'foo-index'))You can install django-selector with pip:pip install django-selectorYou can fork django-selectorfrom its hg repository:hg clone http://bitbucket.org/jmoiron/django-selectorYou can also read the fullrelease documentation.
Package: django-selenium-boilerplate
A simple boilerplate app for selenium testing in Django withLiveServerTestCase.Installation:pip install django-selenium-boilerplateUsageThis app provides aSeleniumBaseclass that extendsLiveServerTestCase. It sets up selenium, and provides several helper methods for testing.SeleniumBase.url(route, *args, **kwargs): Returns the full live server URL to the given route.  Ifrotuestarts with “/”, it’s interpreted as a full path.  Otherwise, it’s interpreted as a reversible route name, which is resolved usingreverse(route, args=args, kwargs=kwargs).SeleniumBase.by_css(selector): Shortcut forself.selenium.find_element_by_css_selector.SeleniumBase.by_csss(selector): Shortcut forself.selenium.find_elements_by_css_selector.SeleniumBase.await_selector(selector, timeout=30): Polls for the presence of the given CSS selector, until the timeout.  Returns when at least one element matching that selector is found.SeleniumBase.select_option(selector, visible_text): Shortcut for selecting the<option>with the given visible text within the<select>that matches the given CSS selector.Optional setting:
-SELENIUM_FIREFOX_BIN: Optional path to the firefox binary to use when building the Selenium driver.  Use this to constrain to a particular selenium-supported Firefox release.Example:from selenium_boilerplate import SeleniumBase

class MyTestCase(SeleniumBase):
    def test_home(self):
        # Look up the route named "home"
        self.selenium.get(self.url("home"))
        # Pause until the selector "h1" appears
        self.await_selector("h1")
        self.assertEquals(self.by_css("h1").text, "Hello, World")LicenseBSD License.Copyright (c) 2014, Charlie DeTar
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: django-selenium-login
django-selenium-login sets a session cookie for the Selenium driver and a creates a session object for the Django backend in order to force a user to quickly login.UsageWith django-selenium-login you can use the force_login function to force a user to qucikly login before using the the Selenium driver to proceeds on pages that requires login. The function takes a Django user, a Selenium driver, and the base url for the live server. Here is an example of how to use the force_login function in a test:fromseleniumloginimportforce_logindeftest_use_django_selenium_login_to_force_login(selenium,live_server):User=get_user_model()user=User.objects.create_user(username='myuser',password='password')force_login(user,selenium,live_server.url)selenium.get('{}/a/url/which/requires/login/'.format(live_server.url))Before setting the session cookie for the Selenium driver, the driver must access a page in the project. By default it will try to access the /page_404/ page. This can be changed by changing the SELENIUM_LOGIN_START_PAGE setting in the settings file for your tests. A blank page is used for the tests in this lib.InstallationUse pip to install django-selenium-login:pipinstalldjango-selenium-loginFor developersCreate venv using:makevenvRun tests for multiple versions of Python and Django for a specific browser using tox:tox----driver=ChromeUse environment variable SESSION_ENGINE to change authentication backend.To run tests for all authentication backends for Chrome and Firefox:./run_tests.shTo run tests in docker with selenium server and headless chrome in a continer:makerun-tests-in-docker