Saravanan666/pypi-org huggingface dataset:
Package: django-bootstrap-swt
django-bootstrap-swt  - An app for creating bootstrap components on python leveldjango-bootstrap-swt simplifies the task of building HTML pages with bootstrap components by using the java swt concept. This reduces your html code duplication, cause you can use predefined bootstrap components.Available on pypi asdjango-bootstrap-swtDocumentation on readthedocs.orgBug trackerFeatures:Create any bootstrap component on backend level.Creates uniq id's for bootstrap components likeaccordionandmodalto avoid id conflicts in javascript.supports async data fetching for modal and accordion components.ExampleStart by addingdjango_bootstrap_swtto yourINSTALLED_APPSsetting like this:INSTALLED_APPS=(...,"django_bootstrap_swt",)Creating a bootstrap component is as simple as:item_list=[ListGroupItem(left='text-at-the-left',center='text-at-the-center',right='text-at-the-right')list_group=ListGroup(items=item_list)my_modal=Modal(title=f'Details of{self.object.title}',modal_body=list_group,btn_value='Open modal',btn_color=ButtonColorEnum.SECONDARY,btn_tooltip='Click this button to open modal',size=ModalSizeEnum.LARGE,)All django-bootstrap-swt components returns the rendered template asstring. So you can simply concatenate the components:accordion_title=python_object.str_attribute+Badge(value='123')If you need aSafeStringinstead ofstringyou can call therender()function manually:safe_string=Badge(value='123').render(safe=True)Check out thedocumentationfor more details.
Package: django-bootstrap-themes
django-bootstrap-themes=======================Bootstrap theme support for Django, includes themes from Bootswatch.* Bootstrap (http://getbootstrap.com/)* Bootswatch (http://bootswatch.com/)Installation------------django-bootstrap-themes can be installed via pip:```shellpip install django-bootstrap-themes```or by copying the `bootstrap_themes` directory into your Django project.Configuration-------------To configure django-bootstrap-themes in your project, first add it tothe installed apps in your Django settings:```pythonINSTALLED_APPS = (# Django apps'bootstrap_themes',# Other apps)```Once you've added it to your installed apps, you can use the templatetags to get the CSS and JS files for Bootstrap:* Loading the templatetags```django{% load bootstrap_themes %}```* Getting the CSS files (use the `theme` parameter to select the themeand the `type` parameter to choose between CSS, minified CSS, or LESSformat for the stylesheets)```django{% bootstrap_styles theme='default' type='min.css' %}{% bootstrap_styles theme='cosmo' type='css' %}{% bootstrap_styles theme='united' type='less' %}```* Getting the Javascript files (select minified or not with the`use_min` parameter)```django{% bootstrap_script use_min=True %}```As with any Django templatetags, you can use variables for theparameters, thus making it easy to switch themes, and even make thetheme user-configurable.If you want to make the theme user configurable, there is a handyfunction to return the list of included themes as a `choices` list fora `CharField`, like this:```pythonfrom django.db import modelsfrom bootstrap_themes import list_themesclass MyModel(models.Model):theme = models.CharField(max_length=255, default='default', choices=list_themes())```Then in your templates, you can use the value of the `theme` field as thetheme parameter to `bootstrap_styles`.
Package: django-bootstrap-typeahead
# Django Bootstrap Typeahead## Convert django model choice fields into typeahead fields.Typeahead inputs built ontop of [Django](https://www.djangoproject.com/) and [Bootstrap](http://getbootstrap.com/).![Example](http://thegoods.aj7may.com/content/images/2014/Feb/Screen_Shot_2014_02_05_at_5_27_56_PM.png)### Install:`> pip install django-bootstrap-typeahead`### Usage:* Add `django-bootstrap-typeahead` to the installed apps of your Django Project* create a form and use `TypeaheadField` instead of `ModelChoiceField`or `MultipleTypeaheadField` instead of `ModelMultipleChoiceField`* Be sure to include the form's required media in the template. _ie._ `{{ form.media }}`* Also be sure to include [Twitter Bootstrap](http://getbootstrap.com/)### Example:_forms.py_from django import formsfrom django_bootstrap_typeahead.fields import *from .models import Thingdef build_thing(value):thing, created = Thing.objects.get_or_create(name=value)return thingclass TestForm(forms.Form):typeahead = TypeaheadField(queryset=Thing.objects.all(),builder=build_thing)multi_typeahead = MultipleTypeaheadField(queryset=Thing.objects.all(),builder=build_thing)
Package: django-bootstrap-ui
Welcome to django-bootstrap-uidjango-bootstrap-ui simplifies the integration of the popularBootstrap UI framework. It is written inPythonand built on theDjango web framework. Give it a try and head over to thedocumentation!Basic featuresBasic HTML5 templateExtensive and up-to-date documentationMainstream Python and Django supportBootstrap 5 featuresFull-featured Bootstrap 5 template (5.3.2)Integrated Google material design icon fontBootstrap 4 featuresFull-featured Bootstrap 4 template (4.6.2)Integrated Google material design icon fontBootstrap 3 featuresFull-featured Bootstrap 3 template (3.4.1)Latest Font Awesome integration (4.7.0)Technical requirementsNew feature releases frequently add support for newer versions of underlying technologies and drop support for older ones. The compatible versions of Django and Python currently are:DjangoPython4.03.8, 3.9, 3.103.2 LTS3.7, 3.8, 3.9, 3.103.13.7, 3.8, 3.93.03.7, 3.8, 3.92.2 LTS3.7, 3.8, 3.9
Package: django-bootstrap-v5
django-bootstrap v5This package builds on top of the excellentdjango-bootstrap4package.Bootstrap 5 integration for Django.Package nameUnfortunately, someone squatted on the django-bootstrap-v5 (as well as 6, 7, 8 etc) name in PyPi in 2013, so I had to modify the name of this package accordingly.GoalThe goal of this project is to seamlessly blend Django and Bootstrap 5.RequirementsPython 3.6 or newer with Django >= 2.2 or newer.DocumentationThe full documentation is athttps://django-bootstrap-v5.readthedocs.io/InstallationInstall using pip:pipinstalldjango-bootstrap-v5Alternatively, you can install download or clone this repo and callpip install -e ..Add toINSTALLED_APPSin yoursettings.py:INSTALLED_APPS=(# ..."bootstrap5",# ...)In your templates, load thebootstrap5library and use thebootstrap_*tags:Example template{%loadbootstrap5%}{# Display a form #}<form action="/url/to/submit/" method="post" class="form">{%csrf_token%}{%bootstrap_formform%}{%buttons%}<button type="submit" class="btn btn-primary">Submit</button>{%endbuttons%}</form>DemoA demo app is provided indemo. You can run it from your virtualenv withpython manage.py runserver.Bugs and suggestionsIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.https://github.com/zelenij/django-bootstrap-v5/issuesLicenseYou can use this under BSD-3-Clause. SeeLICENSEfile for details.AuthorDeveloped and maintained byAndre Bar'yudinOriginal authors:ZosteraDylan VerheulThanks to everybody that has contributed pull requests, ideas, issues, comments and kind words.Please seeAUTHORS.mdfor a list of contributors.
Package: django-bop
Django-bop provides Basic Object-level Permissions for django 1.2 and
later. It is based on the django-adventarticle‘Object Permissions’
by Florian Apolloner.Although there are a fewotherpermission backends I wanted a
simple(r) backend that closely matches the existing django
functionality.FeaturesDjango-bop provides several mechanisms to manage and check the
permissions for objects:bop.admin.ObjectAdminbop.forms.inline_permissions_form_factoryapi.grant and api.revokebop.backends.ObjectBackendifhasperm templatetagbop.managers.UserObjectManagerbop.managers.ObjectPermissionManagerAlso of interest:has_model_permsInstallationInstall it in your (virtual) environment:$ pip install django-bopIf you haven’t already you should also install south:$ pip install SouthAdd ‘bop’ (and south) to you INSTALLED_APPS in settings.py:INSTALLED_APPS = (
  ...
  'south',
  'bop',
)While in settings.py specify the AUTHENTICATION_BACKENDS:AUTHENTICATION_BACKENDS = (
      'django.contrib.auth.backends.ModelBackend',
      'bop.backends.ObjectBackend',
)If you, optionally, want to give permissions to anonymous users you
should do the following:Add a user to contrib.auth.models.User to represent anonymous users
(e.g. via the admin). Give it an appropriate name (anon /
anonymous) so it easily recognized when assigning permissions.Add ANONYMOUS_USER_ID to settings.py:ANONYMOUS_USER_ID = 2If, in addition – and again optionally – you want to support
Model-permissions for anonymous users, you can add the
AnonymousModelBackend:AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'bop.backends.AnonymousModelBackend',
    'bop.backends.ObjectBackend',
)When all configuration is done, bring the database up to date:$ ./manage.py migrate bop
Package: django-bosssearch
Search the web or a specific domain in your Django project using the
Yahoo BOSS API.InstallationFirst, adddjangobosssearchtoINSTALLED_APPSUsing the BOSS API requires a key and a secret. Get them
fromhttp://developer.yahoo.com/search/boss/and add them to your
projects settings:BOSS_API_KEY = ''
BOSS_API_SECRET = ''Then include the views in your projects urlconf:urlpatterns = patterns('',
    url(r'^search/$', include('djangobosssearch.bosssearch_urls')),
)If you want the search to be limited to a certain domain add the following
to the settings:BOSS_SITE_SEARCH_DOMAIN = 'example.com'TemplatesThe templates provided are just an example. Pagination on the results page
(bosssearch/results.html) is done usingdjango-pagination.ConfigurationBesides the previously mentioned configuration keys, the following options
are also useful if you use the provided urlpatterns and view.BOSS_SEARCH_MARKETThe region (country) to search in (default: ‘en-us’).BOSS_RESULTS_PER_PAGEThe number of results per page (default: 50).Changes1.1 (2012-07-02)Fixed UnicodeEncodeError caused by oauth request to_url1.0 (2012-05-11)Initial release
Package: djangobot
# DjangobotDjangobot is a bridge between Slack and a [Channels](https://channels.readthedocs.org)-enabled Django app.Specifically, it is a protocol server that produces and consumes messages for channels-based apps.It is built atop [autobahn](http://autobahn.ws/python/) and [twisted](http://twistedmatrix.com/trac/).## Installation & UsageTo install, simply use pip.```shell$ pip install djangobot```Djangobot should be installed in the virtual environment of your application as it needs to be able to import one of the specified channel layers defined in your `settings.py`.Then, assuming your django project is named `myapp`, the ASGI file is named `asgi.py` and you've created a channel layer in it named `channel_layer`, run this command:```shell$ DJANGOBOT_TOKEN=[your slack token] djangobot myapp.asgi:channel_layer```In production, you'll want to keep this process alive with [supervisor](http://supervisord.org/), [circus](https://circus.readthedocs.org/en/latest/) or a similar tool.## What's it doing?When beginning `djangobot`, it will:1. Connect to the Slack API and request users and channels for your team.2. Initiate a [Real-Time Messaging Connection](https://api.slack.com/rtm).3. Forward any RTM events onto the `slack.{type}` channel. For example, message events(whose `type` is `message`) are sent along the `slack.message` channel.4. Send any messages on the `slack.send` channel back to slack.## Receiving events in your applicationIn your `routing.py`, you'll need to specify consumer functions to handle events on the slackchannels like so:```pythonchannel_routing = {'websocket.receive': 'path.to.my.consumer','websocket.connect': 'path.to.another.consumer','websocket.disconnect': 'path.to.yet.another.consumer',# Slack channels'slack.message': 'function.to.handle.slack.messages','slack.hello': 'handle.when.djangobot.connects',# and so forth```## Sending messages to slackTo send messages to slack, simply send a dictionary at least a `text` key. You may optionally include the `channel` on which to post the message. This can be the human-readable version or a channel id. Note that `djangobot` necessarily posts messages as the user tied to your Slack API token.For example:```pythonimport channelschannels.Channel('slack.send').send({'text': 'Why hello there!', 'channel': 'general'})Of course, part of the beauty of channels is that this can be done from anywhere.# Why is this useful?This simply bridges your slack team to your production application in real-time. On it's own, it does nothing else. Implementing actual features is up to you. Off the top of my head, some ideas:1. Make Slack a logging destination.2. 2FA to approve certain tasks.3. Chat through Slack to users.# Contributing1. Fork this repository.2. Create a branch with your feature or bug fix.3. Work on it, push commits.4. Submit a Pull Request.# Todo1. Testing: I would appreciate help testing twisted clients.2. Setting up the reply channel: Right now the2. Logging: Djangobot could `logger.debug` a lot more.
Package: django-botai-manager
Polls is a Django app to conduct web-based polls. For each question,
visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'manager',
]Include the polls URLconf in your project urls.py like this:path('manager/', include('manager.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/api/to participate in the poll.
Package: django-bot-crawler-blocker
=====django_bot_crawler_blocker=====This is a simple Django app to block the IP addresses which sends too many hits to your application.You can decide the number of hits that are allowed per IP address in defined time.Quick start-----------1. Add "django_bot_crawler_blocker" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'django_bot_crawler_blocker',]2. Add 'CrawlerBlockerMiddleware' to your middleware classes in settings.py file::MIDDLEWARE = ['django_bot_crawler_blocker.django_bot_crawler_middleware.CrawlerBlockerMiddleware','django.middleware.security.SecurityMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware',]'CrawlerBlockerMiddleware' can be and should be first middleware as we need to make sure IP check is the very firstthing in processing request.3. If cache settings are not defined in your settings.py file, then you need to add below lines to your settings.py file::CACHES = {'default': {'BACKEND': 'django.core.cache.backends.db.DatabaseCache','LOCATION': 'cache_table',}}Make sure you have database settings configured. Run the below command to create cache_table in database::'python manage.py createcachetable'You may choose whatever cache backend you want to use.4. (optional) Set variables in MAX_ALLOWED_HITS_PER_IP and IP_HITS_TIMEOUT in settings.py file::MAX_ALLOWED_HITS_PER_IP = 2000  # max allowed hits per IP_TIMEOUT time from an IP. Default 2000.IP_HITS_TIMEOUT = 60  # timeout in seconds for IP in cache. Default 60.To test on local system, set these values to very low, e.g. IP_HITS_TIMEOUT = 30 and MAX_ALLOWED_HITS_PER_IP = 2.Restart the server and send requests frequently. After two requests you will start receiving 403 error.If not defined in settings file, default values will be used.5. In case of any query or issue, please feel free to reach out to me. Email provided in MANIFEST file.
Package: django-bot-faq
django-bot-faqFAQ moduleInstallation:pipinstalldjango-bot-faqSetting upYourProject/tbot/storage.pyfromosimportgetenvfrombot_storage.storageimportRedisStoragestorage=RedisStorage(host=getenv('REDIS_HOST','localhost'),username=getenv('REDIS_USER',None),password=getenv('REDIS_PASSWORD',None))YourProject/settings.py# import your storagefromtbot.storageimportstorage# Define your storage for user states & dataBOT_STORAGE=storage# Add this application definition to INSTALLED_APPSINSTALLED_APPS=['mptt','django_cleanup','faq.faq_admin','django.contrib.postgres',...]# Specify the ELASTICSEARCH host if you want use ElasticSearch, otherwise# the search will be done by default using PostgreSQL TrigramSimilarityELASTICSEARCH=getenv('ELASTIC_DB','http://localhost:9200')Install and run RedisMore information about installing and running Redis on your system onthis page.Install and run ElasticSearchMore information about installing and running ElasticSearch on your system onthis page.Create and apply migrationspythonmanage.pymakemigrationsfaq_admintbot_base
pythonmanage.pymigrateUsageHandlersYourProject/tbot/handlers.pyfromtelebotimporttypesfromtelebot.apihelperimportApiTelegramExceptionfromtbot_base.botimporttbot# install faq_tbot-base lib or make your own faq_tbot instancefromfaq.faq_tbot.dispatcherimportFAQDispatcherfrom.storageimportstorageasst# your storage for users datadp=FAQDispatcher(tbot=tbot,storage=st)@tbot.message_handler(func=lambdamsg:msg.textin(dp.FAQ_BTN.text,'/start'))defsend_faq(msg:types.Message):dp.send_faq(user_id=msg.from_user.id)@tbot.message_handler(func=lambdamsg:st.get_user_state(msg.from_user.id)=='faq_search#')defsend_faq_search(msg:types.Message):dp.send_faq_search(user_id=msg.from_user.id,text=msg.text)@tbot.callback_query_handler(func=lambdacall:True)defcallback_inline(call:types.CallbackQuery):key,article_id=call.data.split('#')ifkey=='tree_article':dp.send_faq(user_id=call.from_user.id,article_id=article_id)elifkey=='show_article':dp.send_article(user_id=call.from_user.id,article_id=article_id)elifkey=='faq_search':dp.send_faq_search(user_id=call.from_user.id)# remove the "clock" on the inline buttontry:tbot.answer_callback_query(callback_query_id=call.id,text='')exceptApiTelegramException:pass
Package: django-botscout
django-botscout===============This provides an easy hook into the Botscout system for Django formsAvailable Settings------------------```python# All settings are optional. They are displayed here with their defaultsBOTSCOUT_API_KEY = NoneBOTSCOUT_API_URL = 'http://botscout.com/test/'BOTSCOUT_CACHE_TIMEOUT = 1800BOTSCOUT_NETWORK_TIMEOUT = 5```Additionally, you can set the following variables on individual forms to altertheir behavior:```pythonBOTSCOUT_NAME_FIELD = 'name'BOTSCOUT_EMAIL_FIELD = 'email'BOTSCOUT_ERROR_MESSAGE = 'This request was matched in the BotScout database'```Basic Usage-----------In forms.py:```pythonfrom botscout import BotScoutFormfrom django import formsclass ContactForm(BotScoutForm, forms.Form):name = forms.CharField('Name')email = forms.EmailField('Email')```In views.py:```pythonfrom .forms import ContactFormdef contact(request):if request.method == 'POST':form = ContactForm(request=request, data=request.POST)if form.is_valid():...else:form = ContactForm(request=request)...```Advanced Usage--------------```pythonfrom botscout import BotScoutFormfrom django import formsfrom django.db import modelsclass Person(models.Model):full_name = models.CharField('Full name', max_length=255)email_address = models.EmailField('Email')class MyForm(BotScoutForm, forms.ModelForm):BOTSCOUT_NAME_FIELD = 'full_name'BOTSCOUT_EMAIL_FIELD = 'email_address'BOTSCOUT_ERROR_MESSAGE = 'GO AWAY SPAM BOT!'class Meta:model = Person```
Package: django-bower
Easy way to usebowerwith yourDjangoproject.Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.Read full documentation onread-the-docs.InstallationInstall django-bower package:pipinstalldjango-bowerAdd django-bower toINSTALLED_APPSin your settings:'djangobower',Add staticfinder toSTATICFILES_FINDERS:'djangobower.finders.BowerFinder',Specify path to components root (you need to use an absolute path):BOWER_COMPONENTS_ROOT='/PROJECT_ROOT/components/'If you need, you can manually set the path to bower:BOWER_PATH='/usr/bin/bower'You can see an example settings file inexample project.UsageSpecifyBOWER_INSTALLED_APPSin settings, like:BOWER_INSTALLED_APPS=('jquery#1.9','underscore',)Download bower packages with the management command:./manage.pybowerinstallAdd scripts in the template, like:{%loadstatic%}<scripttype="text/javascript"src='{%static'jquery/dist/jquery.js'%}'></script>In production you need to callbower installbeforecollectstatic:./manage.pybowerinstall./manage.pycollectstaticIf you need to pass arguments to bower, like–allow-root, use:./manage.pybowerinstall----allow-rootYou can usebower freezeto receiveBOWER_INSTALLED_APPSwith fixed current versions:./manage.pybowerfreezeYou can call bower commands likeinfoandupdatewith:./manage.pybowerinfobackbone./manage.pybowerupdatePython 3 supportdjango-bower supports python 3.3+
Package: django-bower-app
Library to manage bower.json dependancies with easeWHYManaging assets for django is more and more complicated when you need
to interact with heavy javascript page. Now many javascripts
developers use bower to manger their dependancies.Bower then need to be interfaced with Django as seemlessly as
possible. Neither the javascript developer nor the django developper
must change the way they work.django-bower-app aims to be the glue between javascript and django
with simple, easy to manage code.HOWA simple command, bower_install will look in each of the static
directory of each app and extract the bower.json, letting
bower_components untouched and build each module dependancies in the
settings.STATIC_ROOT directory.You can now develop your javascript apps with bower and create a
production ready environnment with bower_installRequirementsObviousely, to run django-bower-app, you need bower and django. That’s
all.INSTALLFirst download this module and install it with>>> python setup.py installThen add “djangobwr” to your INSTALLED_APPS>>> INSTALLED_APPS = (
...
"djangobwr",
...
)you are ready to run the command each time you want to collect the
bower dependancies:>>> python manage.py bower_install