Saravanan666/pypi-org huggingface dataset:
Package: djangolearn
# Django-Learn### A simplistic SciKitLearn Machine learning model persistence layer for django.[![Build Status](https://travis-ci.org/open-holvi/djangolearn.svg?branch=master)](https://travis-ci.org/open-holvi/djangolearn) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bd14b53e401548eb8324afa414f15f9c)](https://www.codacy.com/app/sergio_4/djangolearn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=open-holvi/djangolearn&amp;utm_campaign=Badge_Grade)## Basic Usage```pyfrom sklearn import svmfrom sklearn import datasetsfrom djangolearn.models import SciKitLearnModeliris = datasets.load_iris()class IrisModel(SciKitLearnModel):def train(self, X, Y):clf = svm.SVC()clf.fit(X, Y)self.store(clf)def evaluate(self, x):# This is an example. Don't do this at request time# Loading the model takes a bitrestored = self.restore()restored_results = restored.predict(x)X, y = iris.data, iris.targetinstance = IrisModel.objects.create()instance.train(X, y)instance.evaluate(X[0:1])```## Storage:Django Learn uses [Django Storages](https://github.com/jschneier/django-storages)If you want to specify a different storage system than the default one,specify it through the setting:```pyDJANGOLEARN_STORAGE = 'storages.backends.s3boto.S3BotoStorage'```Note that you will need to do the configuration management mentioned in theDjango Storage page.## What's under the hood?One simple solution would be to Pickle the model. [That's quite insecure](http://pyvideo.org/pycon-us-2014/pickles-are-for-delis-not-software.html).For that reason we use joblib to store the models. There's a bit of validation sauce,like making sure that the scikit version is the same as the one used totrain the system. There is also the option to specify the version of thecode/library used to pre-process the data, so that train data and evaluationdata have the same features.## SecurityEvery object de-serialization is dangerous. Only store models you trust andkeep your model storage secure.We try to make basic validations of the models, but python can only go so far. Use at your own risk.## PerformanceThis is supposed to be an MVP for small jobs, and for playing around with machine learning in Django.Loading models at request time is not recomemdend.## Requirements* Python 2.7 3.4 3.5* Django > 1.7 (tests being deprecated for 1.7)* SciKitLearn >= 0.15
Package: django-learngual
OverviewLearngual is a Python package that provides helper functions for learngual.FeaturesInstallationYou can install Your Django Package Name using pip:$pipinstalldjango-learngualUsageLicenseDjango Learngual  is licensed under the MIT.ContactIf you have any questions, suggestions, or feedback, please feel free to contact us atsupport@learngual.com.
Package: django-learning-log
=====
Learning LogLearning Log is a Django app to track learning that provides users with action such as log in, register, create topic, and entries to that topic.\Detailed documentation is in the 'docs' directory.Quick startAdd 'learning_logs', 'users' and 'bootstrap4' to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'learning_logs',
'users',
]Include the learning_logs and users URLconf in your project urls.py like this::path('', include('learning_logs.urls')),
path('users', include('users.urls')),AddLOGIN_URL = 'users:login'in settings.pyRunpython3 manage.py migrateto create the required modelsStart the development server withpython3 manage.py runserverand visithttp://127.0.0.1:8000to start your Learning Log!
Package: django-lecamit83-blog
Polls is a simple 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 = [
    ...
    'blog',
]Include the polls URLconf in your project urls.py like this:path('blog/', include('blog.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/blog/to participate in the poll.
Package: django-legal
This Django app adds support for versioned terms of service.InstallationInstall with pip:$ pip install django-legalAddlegalto yourINSTALLED_APPSsetting.(Optional)Add a new setting:LEGAL_TOS_NAME = 'terms_of_service'Updateurls.pywith the following:url(r'^legal/', include('legal.urls')),Create a new Agreement and AgreementVersion (ideally via data migration):# -*- coding: utf-8 -*-
import os
from south.v2 import DataMigration

# This should be the same value as LEGAL_TOS_NAME (if you overrode it)
AGREEMENT_NAME = 'tos'


class Migration(DataMigration):
    def forwards(self, orm):
        agreement, created = orm['legal.Agreement'].objects.get_or_create(name=AGREEMENT_NAME)

        # This file should live in the same directory as the migration
        f = open('%s/tos_content_2013_08_01.html' % os.path.dirname(__file__), 'r')
        orm['legal.AgreementVersion'].objects.create(agreement=agreement, date='2013-08-01', content=f.read())

    def backwards(self, orm):
        agreement = orm['legal.Agreement'].objects.get(name=AGREEMENT_NAME)
        agreement.delete()

    models = {
        'legal.agreement': {
            'Meta': {'object_name': 'Agreement'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': (
                'django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})
        },
        'legal.agreementversion': {
            'Meta': {'ordering': "['-date']", 'unique_together': "(('agreement', 'date'),)",
                     'object_name': 'AgreementVersion'},
            'agreement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['legal.Agreement']"}),
            'content': ('django.db.models.fields.TextField', [], {}),
            'date': ('django.db.models.fields.DateTimeField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        }
    }

    # Change this to be the name of the app where the migration lives
    complete_apps = ['my-app']
    symmetrical = TrueTesting This AppA modifiedmanage.pyand Django settings file are included to test this app:$ python manage.py testTesting Your AppYou may find the middleware a bit excessive for your tests as it requires you to create an agreement and version, and accept the agreement on behalf of your tests users. If you want to disable the middleware, add the following to your settings:if 'test' in sys.argv:
  MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
  MIDDLEWARE_CLASSES.remove('legal.middleware.TermsOfServiceAcceptanceMiddleware')
Package: django-legaltext
Legaltext is a Django application to help managing legal text versioning (e.g.
terms of condition, pr privacy policy). It also supports versioning of the
corresponding checkbox labels.FeaturesThe application consists of multiple parts and helpers:Models to maintain legal texts, their versions and checkboxesModel field to store the accepted version of a legal text (with support to
auto-fetched default of current version)Form field to render the widget which outputs the configured checkboxes just
using the legal text slugAdmin interface to maintain the legal texts, adding new version with prefilling, and exportTemplatetag legaltext_urlInstallationrequirements.txtJust add the following PyPI package to your requirements.txtdjango-legaltextsettings.pyTo activate the application, add the following two packages to yourINSTALLED_APPSINSTALLED_APPS = (
    ...
    'floppyforms',  # needed for widget rendering
    'markymark',  # required for markdown rendering
    'legaltext',
)urls.pyTo register the url to output the legal texts, add the following to yoururls.py.urlpatterns = [
    ...
    url(r'^legaltext/', include('legaltext.urls')),
]UsagePlease refer to the examples to learn how to use the application.You just need to add a new model field to your models and set the correct formfield
in the corresponding forms.class YourModel(models.Model):
    ...

    accepted_legaltext = LegalTextField('some-unique-slug')class YourForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['accepted_legaltext'] = LegalTextFormField('some-unique-slug')Make sure that you use the same slug on both (model and form) field.CustomizationThere are some more settings you can set to change the applcationLEGALTEXT_ANCHOR_CLASSAdd an additional css class the the rendered anchor-span when using [anchor:foo]LEGALTEXT_VIEW_TEMPLATEChange the template which is used to in the view to output the legal textLEGALTEXT_VIEW_TEMPLATE_OVERRIDESChoose a different template to use in views for specific slugsLEGALTEXT_WIDGET_TEMPLATEChange the template which is used to in the widget to output the checkboxesLEGALTEXT_WIDGET_TEMPLATE_OVERRIDESChoose a different template to use in widget for specific slugsLEGALTEXT_WIDGET_ATTRSAdd extra attributes to checkbox input elementsLEGALTEXT_SILENCE_TEMPLATE_ERRORSSilence errors for legaltext_url templatetag if legaltext does not existResourcesCodeUsage example
Package: django-lens
Enhance your Django development experienceDocumentationThe full documentation is athttps://django-lens.readthedocs.io.QuickstartInstall Django Lens:pip install django-lensAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'lens.apps.LensConfig',...)Add Django Lens’s URL patterns:fromlensimporturlsaslens_urlsurlpatterns=[...url(r'^',include(lens_urls)),...]FeaturesTODORunning 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.0.0 (2023-03-05)First release on PyPI.
Package: django-le-social
Django-le-social is an external registration helper for Django. It currently
lets you use Twitter (OAuth) and OpenID authentication, as well as traditional
registration.It’s more a framework than a drop-in app in the sense that it won’t create
any user data for you: when a user comes from an external authentication
source, django-le-social executes a method thatyoudecide. There is no
user creation, no new model instance, no user login. You need to decide what
to do, mainly store the OAuth token or the OpenID data, create a user and log
him in.Authors: Bruno Renié andcontributorsLicence: BSDCompatibility: Django 1.8+Optional requirements: twitter, python-openidDocumentation:https://django-le-social.readthedocs.io/en/latest/HackingSetup your environment:git clone https://brutasse@github.com/brutasse/django-le-social.git
cd django-le-social
mkvirtualenv --python le-social
pip install toxHack, and run the tests:toxToxruns all tests on python 2.7 and 3.4 and above, as well as all the
supported Django versions.
Package: django-less
THIS PACKAGE IS NOT MAINTAINED.Please usedjango-static-precompilerDjango LESSDjango LESS provides template tags to compile LESS into CSS from templates.
It works with both inline code and extenal files.InstallationAdd"less"toINSTALLED_APPSsetting.Make sure that you havelesscexecutable installed. SeeLESS official sitefor details.Optionally, you can specify the full path tolesscexecutable withLESS_EXECUTABLEsetting.
By default it’s set tolessc.In case you use Django’s staticfiles contrib app you have to add django-less’s file finder to theSTATICFILES_FINDERSsetting, for example :STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    # other finders..
    'less.finders.LessFinder',
)Example UsageInline{% load less %}

<style>
  {% inlineless %}
    #header {
      h1 {
        font-size: 26px;
        font-weight: bold;
      }
      p { font-size: 12px;
        a { text-decoration: none;
          &:hover { border-width: 1px }
        }
      }
    }
  {% endless %}
</style>renders to<style>
  #header h1 {
    font-size: 26px;
    font-weight: bold;
  }
  #header p {
    font-size: 12px;
  }
  #header p a {
    text-decoration: none;
  }
  #header p a:hover {
    border-width: 1px;
  }
</style>External file{% load less %}

<link rel="stylesheet" href="{{ STATIC_URL}}{% less "path/to/styles.less" %}" />renders to<link rel="stylesheet" href="/media/LESS_CACHE/path/to/styles-91ce1f66f583.css" />Note that by default compiled files are saved intoLESS_CACHEfolder under yourSTATIC_ROOT(orMEDIA_ROOTif you have noSTATIC_ROOTin your settings).
You can change this folder withLESS_ROOTandLESS_OUTPUT_DIRsettings.Note that all relative URLs in your stylesheet are converted to absolute URLs using yourSTATIC_URLsetting.SettingsLESS_EXECUTABLEPath to LESS compiler executable. Default:"lessc".LESS_OPTIONSOptions sent tolessc. Default:[].LESS_ROOTControls the absolute file path that compiled files will be written to. Default:STATIC_ROOT.LESS_OUTPUT_DIRControls the directory insideLESS_ROOTthat compiled files will be written to. Default:"LESS_CACHE".LESS_USE_CACHEWhether to use cache for inline styles. Default:True.LESS_CACHE_TIMEOUTCache timeout for inline styles (in seconds). Default: 30 days.LESS_MTIME_DELAYCache timeout for reading the modification time of external stylesheets (in seconds). Default: 10 seconds.Changes0.7.2Add LESS_OPTIONS config variable.Use urlparse instead of posixpath to leave double slashes in urls.Raise exception on compilation errors.0.7.1Use hashlib instead of django.utils.hashcompat which is deprecated in Django 1.5Addshell=Trueto Popen arguments when running on Windows.0.7Add staticfiles finder to serve compiled files in dev mode0.6Add LESS_ROOT setting0.5.1Fix unicodedecodeerror with non ascii in less file0.5Switch to staticfiles.finders when looking up the files in DEBUG mode.0.4Add support for lookup in STATICFILES_DIRS0.3Log LESS compilation errorsFixed bug with paths on Windows0.2Use STATIC_ROOT / STATIC_URL settings when possible instead of MEDIA_ROOT / MEDIA_URL0.1Initial release
Package: django-letsencrypt
Let's Encrypt App for Djangodjango-letsencryptwill allow you to add, remove, and update anyACME challengeobjects you may
need through your Django admin interface. Simply add theACME challengeandresponsefor your app to serve up the necessary information forLet's Encryptvalidation.This project strives to make installation, configuration, and usage a snap!
From high levels of code coverage, multiple compatible python versions, multiple
versions of Django supported, even multiple databases too!And of course all wrapped up and published toPyPIfor standard installation!Supported Configurationsdjango-letsencryptis tested across a number of configurations, here's what's
supported so far:Python Versions Supported:3.10(Django4.0and3.2only)3.83.7(Django3.2and2.2only)Django Versions Supported:4.0minimum version4.03.2minimum version3.2.102.2minimum version2.2.25Databases Supported:mysqlpostgressqliteRecent Build Status BadgesInstallation & Configurationpip install django-letsencryptAddletsencryptto yourINSTALLED_APPSINSTALLED_APPS=[...,'letsencrypt',...,]Include theletsencryptin your project'surls.py,
or where applicable (usually your rooturls.py).re_path(r'^\.well-known/',include('letsencrypt.urls'))Runmanage.py migrateto create the required table for theletsencryptmodelCreate yourACME Challengeobjects in your Django admin interfaceTest yourACME Challengeobjects and their responses by visiting
them:{Django Site}/.well-known/acme-challenge/challenge_textEnjoy your easy to manageACME Challengesinside your Django project!Example ProjectIf you would like a demo of how to use this application simply clone this project'sgitrepository fromGitHub,
take a moment to read theREADME.mdfile within theexample_projectdirectory, and follow the directions. That will spin up a small sample django
application already configured for you to try out.
Package: django-lets-go
Django-Lets-go provide a lot of goodies, functions, useful snippets recompiled,
if you develop some Django projects you will certainly found something useful here.Django-lets-go contains the following :1. Modelintermediate_model_base_class2. MiddlewareFilterPersistMiddleware3. Functionsget_unique_code- Generate unique codepass_gen- Unique password generatorcomp_month_range- Prepare month range list to compare with selected monthcomp_day_range- Prepare day range list to compare with selected daydate_range- Get date list between two datesvalidate_days- Validate no of days in given month and yearget_news- Get news from news urlonly_one- Decorator for distributed task locking in celeryceil_strdate- Convert a string date to either a start or end day datepercentage- Get percentage valueunset_session_var- Unset settion variablegetvar- Check field in POST/GET request and return field value. if there is value you can also save a session variableword_capital-  Capitalizes the first character of each word4. Template tagstime_in_min- Convert value in min:sec or seconds formatconv_min- Convert value in min:sec formatmonth_name- Get month name from 1-12 int nosort_link- Usage: {% sort_link “link text” “field_name” %} or {% sort_link “link text” “field_name” “Visible name” %}get_fieldset- Make group of fields for field-setUsage: {% get_fieldset field1,field2 as list_field from xyz_form %}groupby_rows- Returns a list of n lists. Each sub-list is the same lengthgroupby_rows- Returns a list of lists where each sub-list has n items.listsort- Perform sorting on template listconvert_to_int- Convert value to intergerwordcap- Capitalizes the first character of each words.percentage_tag- get percentage value.5. FieldsLanguageField - Field to language list6. Test suite toolsbuild_test_suite_from : Returns a single or group of unittest test suite7. Admin Class HelperAppLabelRenamer Class for django admin UIexport_as_csv_action - Admin custom action which returns an export csvInstallationInstall using the sourcespip install -r requirements.txt
python setup.py installInstall with PIPpython install django-lets-goProjects using Django-lets-goCDR-Stats :http://www.cdr-stats.orgNewfies-Dialer :http://www.newfies-dialer.orgChangelogChangelog summary :https://github.com/areski/django-lets-go/blob/master/CHANGELOG.rstLicenseDjango-lets-go is licensed underMITThe Initial Developer is Arezqui Belaid <areski@gmail.com>
Package: django-letsmaintain
django-letsmaintainDjango middleware that provides a maintenance countdown warning message.This middleware searches the cache for the keymaintenance_alert. Its contents are expected to be a string representing an aware datetime in isoformat:fromdatetimeimportdatetime,timezonethe_time=datetime.now(timezone.utc).isoformat(timespec='minutes')print(the_time)Example result:'2020-06-24T12:00+00:00'The middleware will raise a warning in all pages with a seconds countdown.The last 60 seconds, the warning message will become an error message.A bash script can invoke the relevant cache key:#!/bin/bashFIVE_MINUTES_LATER=$(date--date"$(date+%Y-%m-%dT%H:%M:%S%:z)+5 min"--iso-8601=minutes)echo"from django.core.cache import cache; cache.set(\"maintenance_alert\", \"$FIVE_MINUTES_LATER\")"\|./manage.pyshell
sleep5m# Redirect to maintenance.html# nginx example: https://lincolnloop.com/blog/pro-tip-redirecting-custom-nginx-maintenance-page/# <perform maintenance># Cancel redirectRequired SettingsThe required settings for the middleware to operate are:CACHESTIME_ZONEUSE_TZ = True"letsmaintain" inINSTALLED_APPS"letsmaintain.middleware.MaintenanceMiddleware" inMIDDLEWAREafter "MessageMiddleware"TestsTo run the tests:Install toxDefine:TOX_DB_NAME,TOX_DB_USER,TOX_DB_PASSWD
Package: django-le-twitter
Twitter authentication that sucks.Django-le-twitter provides almost nothing to let your users sign in with
twitter: two class-based views.Django-le-twitter is based on Django >= 1.3 andTweepy.The concept is simple: when a user successfully logs in using twitter (i.e.
you get a valid OAuth token), django-le-twitter executes a method thatyoudefine. There is no model instance created, no login using contrib.auth, no
nothing. You decide.Installationpip install django-le-twitterThere’s nothing to add to your INSTALLED_APPS. It just needs to be in your
python path. You need to add your Twitter app credentials to your Django
settings:CONSUMER_KEY = 'your key'
CONSUMER_SECRET = 'your secret'UsageSubclass the two views provided by django-le-twitter in one of your apps’
views. Actually, one of them doesn’t strictly need to be subclassed.# app/views.py
from django.http import HttpResponse

from le_twitter import views

authorize = views.Authorize.as_view()

class Return(views.Return):

    def handle_error(self, error_msg, exception=None):
        return HttpResponse(error_msg)

    def handle_success(self, auth):
        # Now it's up to you!
        return HttpResponse('It worked!')
return_ = Return.as_view()handle_success()gives you atweepy.OAuthobject containing your user’s
OAuth credentials. At this point you can:Fetch information using the tweepy APICreate an auth.User instance and link it to a custom twitter profilehandle_success()just needs to return anHttpResponse.After that, just hook your custom views in your app urlconf:# app/urls.py
from django.conf.urls.defaults import patterns, url

from app.views import authorize, return_

urlpatterns = patterns(''
    url(r'^oauth/authorize/$', authorize, name='oauth_authorize'),
    url(r'^oauth/return/$', return_, name='oauth_return'),
)
Package: django-lfc
What is it?LFC is a Content Manangement System based on DjangoDemohttp://demo.django-lfc.comGrouphttp://groups.google.com/group/django-lfcCodehttp://github.com/diefenbach/django-lfcChanges1.1.1 (2014-06-27)Adds Pillow toinstall_requiresAdds django-compressor toinstall_requiresFixes german translation for lfc-contact-form1.1 (2014-06-26)Adds Django 1.6 supportFactores out page content type to lfc-pageFactores out portlets to lfc-portletsFactores out contact form to lfc-contact-form
Package: django-lfs
What is it?LFS is an online shop based on Python, Django and jQuery.InformationFor more information please visit:http://www.getlfs.comDocumentationFor the latest documentation please visit:http://docs.getlfs.comDemo shopA demo shop can be tried here:http://demo.getlfs.comDevelopmentFor development environment please visit:https://github.com/diefenbach/lfs-buildout-developmentChanges0.11.0 (2017-03-09)Adds Django 1.10 supportExcludes variants from sitemapAdd appending slash to all urlsUse F() expressions to update stock amount (#203)Use F() expression to increase use_amount for vouchers (#202)Removes django-pagination (use Django’s default one instead)remove STATIC_URL (user static_url tag instead)fix saving properties and variant prices [pigletto]0.10.2 (2015-04-25)Updates lfs-paypal to 1.3Fixes all tests0.10.1 (2015-04-23)Fixes MANIFEST.inFixes adding and display of reviews when L10N is turned on0.10.0 (2015-04-22)Adds Django 1.8 supportMoves static files to lfs.manageMoves manage templates to lfs.manageHISTORYFor the complete history please look into HISTORY.txt
Package: django-lgi
django-lgi - Django Lambda Gateway Interfacedjango-lgi is a python module that interpretsHTTP APIrequests sent to your Django project in Lambda.FeaturesProcess2.0 payload format versiondata that API Gateway sends to a Lambda integration.Trigger management commands directly on lambda, e.g. invoke lambda function with{"manage": ["version"]}todisplay the current Django version.Installationpip install django-lgiUsageCreatelgi.pyfile in Django project root. Remember to replacemysite.settingswith dotted path to your settings module.import os

from lgi import get_lgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

application = get_lgi_application()Set lambda handler tomysite.lgi.application.ExamplesDjambda- example project setting up Django application in AWS Lambda managed by Terraform.Related Projectsawsgiapig-wsgiZappachaliceTestingTo run the test suite, first, create and activate a virtual environment. Then run tests.$ flit install -s
$ cd tests
$ ./runtests.py