Saravanan666/pypi-org huggingface dataset:
Package: django-twittersync
django-twittersync------------------Very basic application to sync a Twitter account's stream tothe local storage engine.There are a few other applications that handle this for youbut none of them fit my needs, so here we are. The idea behindthis app is to be very light weight - do one thing and do it well.There is no need for a Twitter consumer key or token for use withthis app. It makes use of the public facing (non-auth required) RESTAPI. This also means that if the account you are trying to sync issetup as private, this app will not sync that account.Dependencies------------This app only depends on the python-dateutil module. You can installit like so:$ sudo pip install python-dateutilIt was written for Python 2.4+ and Django 1.2.3Install-------Basic Install:$ python setup.py build$ sudo python setup.py installAlternative Install (Manually):Place webutils directory in your Python path. Either in your Pythoninstalls site-packages directory or set your $PYTHONPATH environmentvariable to include a directory where the webutils directory lives.Use---1) Add 'twittersync' to your INSTALLED_APPS2) Run 'python manage.py syncdb'3) Add a twitter account via the admin interface4) Run 'python manage.py sync_twitter_accounts'There you go. You might want to setup a cron job to run thesync_twitter_accounts command (like on step 4) every hour or so.To display your tweets in a template, simple do something like:{% load twittersync_tags %}{% get_latest_tweets "accountname" 5 as "tweets" %}{% for tweet in tweets %}<a href="{{ tweet.url }}">{{ tweet.content }}</a><br />{% endfor %}This will grab the last 5 status updated for the twitter account"accountname" and place it in the context as the variable named"tweets"Replace "accountname" with the name of the account you want tosync. It can be a string or an actual TwitterAccount (model)instance.Replace 5 with the number of updates to fetch. If it's not giventhe template tag will check for the following settings variable:TWITTERSYNC_LATEST_TWEETSIt will default to 5 if that variable doesn't exist.That's it! Simple right?Enjoy.Copyright & Warranty--------------------All documentation, libraries, and sample code areCopyright 2010 Peter Sanchez <petersanchez@gmail.com>. The library andsample code are made available to you under the terms of the BSD licensewhich is contained in the included file, BSD-LICENSE.
Package: django-twittersync-extended
django-twittersync------------------Very basic application to sync a Twitter account's stream tothe local storage engine.There are a few other applications that handle this for youbut none of them fit my needs, so here we are. The idea behindthis app is to be very light weight - do one thing and do it well.There is no need for a Twitter consumer key or token for use withthis app. It makes use of the public facing (non-auth required) RESTAPI. This also means that if the account you are trying to sync issetup as private, this app will not sync that account.In this version you can extend Twitter Account base models.Dependencies------------This app only depends on the python-dateutil module. You can installit like so:$ sudo pip install python-dateutilIt was written for Python 2.4+ and Django 1.2.3Install-------Basic Install:$ python setup.py build$ sudo python setup.py installAlternative Install (Manually):Place webutils directory in your Python path. Either in your Pythoninstalls site-packages directory or set your $PYTHONPATH environmentvariable to include a directory where the webutils directory lives.Use---0.9) TODO explain how extend basic module1) Add 'twittersync' to your INSTALLED_APPS2) Run 'python manage.py syncdb'3) Add a twitter account via the admin interface4) Run 'python manage.py sync_twitter_accounts'There you go. You might want to setup a cron job to run thesync_twitter_accounts command (like on step 4) every hour or so.To display your tweets in a template, simple do something like:{% load twittersync_tags %}{% get_latest_tweets "accountname" 5 as "tweets" %}{% for tweet in tweets %}<a href="{{ tweet.url }}">{{ tweet.content }}</a><br />{% endfor %}This will grab the last 5 status updated for the twitter account"accountname" and place it in the context as the variable named"tweets"Replace "accountname" with the name of the account you want tosync. It can be a string or an actual TwitterAccount (model)instance.Replace 5 with the number of updates to fetch. If it's not giventhe template tag will check for the following settings variable:TWITTERSYNC_LATEST_TWEETSIt will default to 5 if that variable doesn't exist.That's it! Simple right?Enjoy.Copyright & Warranty--------------------All documentation, libraries, and sample code areCopyright 2010 Peter Sanchez <petersanchez@gmail.com>. The library andsample code are made available to you under the terms of the BSD licensewhich is contained in the included file, BSD-LICENSE.
Package: django-twittersync-oauth
Set these in your settings.py (you can obtain consumer key and secret from
twitter.com):TWITTER_APP_NAME = "Your App name"
TWITTER_CONSUMER_SECRET = "####"
TWITTER_CONSUMER_KEY = "####"Add twittersync_oauth to your INSTALLED_APPSaftertwittersync:INSTALLED_APPS = (
    ...
    'twittersync',
    'twittersync_oauth',
    ...
)Then run:./manage.py auth_twitterauth_twitter opens a twitter authentication request in your browser. Please
note that you can do this on your own pc and then use the resulting keys on
your server. Click Accept and twitter gives you a PIN. Insert this PIN in the
manage.py you executed. The script gives you other two variables you need to
set in your settings.py. Done! :)
Package: django-two-factor-auth
Complete Two-Factor Authentication for Django. Built on top of the one-time
password frameworkdjango-otpand Django’s built-in authentication frameworkdjango.contrib.authfor providing the easiest integration into most Django
projects. Inspired by the user experience of Google’s Two-Step Authentication,
allowing users to authenticate through call, text messages (SMS), by using a
token generator app like Google Authenticator or aYubiKeyhardware token
generator (optional).If you run into problems, please file an issue on GitHub, or contribute to the
project by forking the repository and sending some pull requests. The package
is translated into English, Dutch and other languages. Please contribute your
own language usingTransifex.Test drive this app through theexample app. It demos most features except
the Twilio integration. The example also includesdjango-user-sessionsfor
providing Django sessions with a foreign key to the user. Although the package
is optional, it improves account security control overdjango.contrib.sessions.Compatible with supported Django and Python versions. At the moment of writing that
includes 3.2, 4.0, 4.1, and 4.2 on Python 3.8, 3.9, 3.10 and 3.11.
Documentation is available atreadthedocs.io.InstallationRefer to theinstallation instructionsin the documentation.Getting helpFor general questions regarding this package, please hop over toStack Overflow.
If you think there is an issue with this package; check if the
issue is already listed (either open or closed), and file an issue if
it’s not.ContributeRead thecontribution guidelines.See AlsoHave a look atdjango-user-sessionsfor Django sessions with a foreign key to
the user. This package is also included in theexample app.LicenseThe project is licensed under the MIT license.
Package: django-two-factor-auth-ovh-gateway
django_two_factor_auth_ovh_gatewayPlugin fordjango-two-factor-auth, adding a gateway for sending SMS using the OVH API.All you need is your OVH API credentials and the name of the SMS account you want to use.SetupPlease see thedjango-two-factor-auth documentationfor instructions on how to set up two-factor authentication in your Django project.OVH SetupTo use the OVH gateway, you need first to install this OVH plugin for django-two-factor-auth:$pipinstalldjango_two_factor_auth_ovh_gatewayThen, add the plugin to yourINSTALLED_APPSsetting:INSTALLED_APPS=[..."django_two_factor_auth_ovh_gateway",]Finally, you need to add the OVH gateway to yourTWO_FACTOR_SMS_GATEWAYsetting:TWO_FACTOR_SMS_GATEWAY="django_two_factor_auth_ovh_gateway.gateway.Ovh"ConfigurationOVH_ENDPOINT(default:ovh-eu)
The OVH API endpoint to use. Seethis listfor available endpoints.OVH_APPLICATION_KEY(required)
The application key, provided by OVH.OVH_APPLICATION_SECRET(required)
The application secret, prodived by OVH.OVH_CONSUMER_KEY(required)
The consumer key, provided by OVH.OVH_CLASS(default:phoneDisplay)
The SMS class used by OVH to send the SMS. Possible values areflash,phoneDisplay,sim,toolkit.OVH_CODING(default:7bit)
The SMS coding used by OVH to send the SMS. Possible values are7bit,8bit.OVH_MESSAGE(default:Your token is {token})
The message template used by OVH to send the SMS. The{token}placeholder needs to be present, as it will be replaced by the actual token.OVH_NO_STOP_CLAUSE(default:True)
Whether to allow the user to stop receiving SMS by replyingSTOPto the SMS. If set toTrue, the userwill notbe able to stop receiving SMS.OVH_PRIORITY(default:high)
The SMS priority used by OVH to send the SMS. Possible values arehigh,low,medium,veryLow.OVH_SENDER(default:OVH)
The sender's name used by OVH to send the SMS. Can be the name of your app, or your company name.OVH_SENDER_FOR_RESPONSE(default:False)
Whether to allow the user to reply to the SMS. If set toTrue, the userwillbe able to reply to the SMS.OVH_VALIDITY_PERIOD(default:2880)
The SMS validity time, in minutes.
Package: djangotworm
Django ORM + Twisted + asyncio - blocking----------------------------------------This is a library that contains a custom queryset and a custom manager that adds introspection to usethe twisted database api instead of django. It returns deferred (Future or coroutine) instead of just hitting the database.since v0.6:------------ added support for django_bulk_update (github.com/aykut/django-bulk-update)since v0.5:------------ model instance save method replacing on the fly, now u can:```pythonawait obj.save()```since v0.3-0.4:------------ get_or_create fixsince v0.2:------------ mostly rewrited;- renamed package as "twisted-django-orm";- python 3.5.2+ now is required;- used asyncio to avoid "callback hell";- you still can obtain result as defered;- there are some untested cases;To install:-----------Python 3.5.2+ is required1. pip install twango2. Import and set the manager as the manager for any model (see examples)3. Use it on the top of the twisted and asyncioThis will keep the orm from blocking when using the django orm!Important-----------Does not make job in asynchronous way, but goes into threads and do not perform blocking main reactor.Example 352+:--------```pythonq = await Operation.twisted.all()[:5].fetch()print(q)b = await Operation.twisted.all().fetch()print(b[5])async for x in Operation.twisted.all().order_by('cell', 'status'):print(x.price, x.status, x.cell)async for x in Operation.twisted.all().order_by('cell', 'status')[:5]:print(x.price, x.status, x.cell)x = await Operation.twisted.get(price=3000, status=1, cell=11)print(x)p = await Operation.twisted.count()print(p)x, created = await Operation.twisted.update_or_create(defaults={'cell': 11, 'price': 333}, price=1, status=1, cell=25)print(x)x, _created = await Operation.twisted.get_or_create(price=27, status=1, cell=11)print(x)```Example (old):--------You can create models that are separate to be used in twisted processes:```pythonfrom myapp import Bookfrom twango.manager import TwistedManagerfrom django.db.models.manager import Managerclass TwistedBook(Book):objects = Manager()twisted = TwistedManager()class Meta:app_label = 'myapp'proxy = True```
Package: django-twostepauth
Django application that allows user authentication with two steps for
additional security. The a first step with username and password and a
second step with a one-time code such as the codes generated by soft
token devices like [Google Authenticator][goog_auth].Features:Authentication with TOTP (Time-Based One-Time Password)Authentication HOTP (HMAC-Based One-Time Password)Support for the login in the admin siteSelective activation of two-step for the admin site, the main site or bothSupport for authentication backup codesAutomatic adjustment for clock synchronization issuesDetails on the installation and setup can be found indocs/install.rst. An
example application is provided for two-step authentication integrated withdjango-registrationanddjango-profiles.[goog_auth]http://support.google.com/accounts/bin/answer.py?hl=en&answer=1066447
Package: django-txtlocal
For sending and receiving text messages (SMS) from textlocal.comInstallationpipinstalldjango-txtlocalReceiving MessagesAdd to yoururls.py:url(r'^',include('txtlocal.urls'))Add to yoursettings.py:INSTALLED_APPS=(...'txtlocal',...)Run:pythonmanage.pysyncdbSending MessagesAdd to yoursettings.py:TXTLOCAL_USERNAME=YourusernamewithtextlocalTXTLOCAL_PASSWORD=YourpasswordwithtextlocalTXTLOCAL_FROM=Wordupto11charactersornumberupto14digits.String.You can also setTXTLOCAL_ENDPOINT. This defaults tohttps://www.txtlocal.com/sendsmspost.phpInfrequently Asked QuestionsWhy txtlocal, not tExtlocal?Because textlocal.com used to be txtlocal.co.uk
Package: django-typed-models
django-typed-modelsIntrodjango-typed-modelsprovides an extra type of model inheritance for Django. It is similar to single-table inheritance in Ruby on Rails.The actual type of each object is stored in the database, and when the object is retrieved it is automatically cast to the correct model class.Licensed under the New BSD License.FeaturesModels in querysets have the right class automaticallyAll models subclassing a common base are stored in the same tableObject types are stored in a 'type' field in the databaseNo extra queries or joins to retrieve multiple typesUsage:An example says a bunch of words:# myapp/models.pyfromdjango.dbimportmodelsfromtypedmodels.modelsimportTypedModelclassAnimal(TypedModel):"""Abstract model"""name=models.CharField(max_length=255)defsay_something(self):raiseNotImplementeddef__repr__(self):returnu'<%s:%s>'%(self.__class__.__name__,self.name)classCanine(Animal):defsay_something(self):return"woof"classFeline(Animal):mice_eaten=models.IntegerField(default=0)defsay_something(self):return"meoww"Later:>>>frommyapp.modelsimportAnimal,Canine,Feline>>>Feline.objects.create(name="kitteh")>>>Feline.objects.create(name="cheetah")>>>Canine.objects.create(name="fido")>>>printAnimal.objects.all()[<Feline:kitteh>,<Feline:cheetah>,<Canine:fido>]>>>printCanine.objects.all()[<Canine:fido>]>>>printFeline.objects.all()[<Feline:kitteh>,<Feline:cheetah>]You can actually change the types of objects. Simply run an update query:Feline.objects.update(type='myapp.bigcat')If you want to change the type of an object without refreshing it from the database, you can callrecast:kitty.recast(BigCat)# or kitty.recast('myapp.bigcat')kitty.save()Listing subclassesOccasionally you might need to list the various subclasses of your abstract type.One current use for this is connecting signals, since currently they don't fire on the base class (see#1)forsenderinAnimal.get_type_classes():post_save.connect(on_animal_saved,sender=sender)Django adminIf you plan to use typed models with Django admin, consider inheriting from typedmodels.admin.TypedModelAdmin.
This will hide the type field from subclasses admin by default, and allow to create new instances from the base class admin.fromdjango.contribimportadminfromtypedmodels.adminimportTypedModelAdminfrom.modelsimportAnimal,Canine,Feline@admin.register(Animal)classAnimalAdmin(TypedModelAdmin):pass@admin.register(Canine)classCanineAdmin(TypedModelAdmin):pass@admin.register(Feline)classFelineAdmin(TypedModelAdmin):passLimitationsSince all objects are stored in the same table, all fields defined in subclasses are nullable.Fields defined on subclasses can only be defined ononesubclass, unless the duplicate fields are exactly identical.RequirementsDjango 3.2+Python 3.6+
Package: django-typeform
A Typeform integration for DjangoDocumentationThe full documentation is athttps://django-typeform.readthedocs.io.QuickstartInstall Django Typeform:pip install django-typeformAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_typeform.apps.DjangoTypeformConfig',...)Usage as template tag:{% load django_typeform %}<html><body>{% typeforms_embed 'https://xxxx.typeform.com/to/xxxxxx' 'my-typeform' '{"hideHeaders": true, "hideFooter": true}' %}</body></html>FeaturesEmbed SDK SupportResults API supportTypeformMixin to use Django forms to process typeform resultsTypeformView to transparently integrate typeforms into the Django frameworkHistory0.2.0 (2019-07-18)Add TypeformMixin and TypeformView0.1.0 (2017-10-05)Add Embed SDK support0.0.0 (2017-10-05)First release on PyPI.
Package: django-typeform-feedback
Use typeform as feedback with DjangoQuickstartInstall django-typeform-feedback:pip install django-typeform-feedbackAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'typeform_feedback',...)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: django-typescript-routes
django-typescript-routesMeant as a spiritual successor todjango-js-reverse,django-typescript-routesis meant to answer to the following question:I've got a Typescript-based SPA that is powered by a Django-based API. How do I safely make requests to Django without messing up the routes or parameters?django-typescript-routesis how! At a high level, it turns:urls=[path(r"about",about,name="about",),path(r"/<str:username>",subscribe,name="subscribe",),path(r"/<str:username>/subscribers/<pk:uuid>/success",subscription_success,name="subscription-success",),]into:constURLS={about:()=>`/`,subscribe:(username:string)=>`/${username}`,"subscription-success":(username:string,pk:string)=>`/${username}/subscribers/${pk}/success`,};Quick startInstall:poetryadd--devdjango-typescript-routesAdddjango-typescript-routesto yourINSTALLED_APPSsetting:INSTALLED_APPS=[...,"typescript_routes",...]Run the management command to print out the typescript file:pythonmanage.pygenerate_typescript_routes--urlconfprojectname.urls>assets/urls.ts
Package: django_typograph
# Типограф для Django 1.7+## Установка` pip install django_typograph `В settings.py INSTALLED_APPS добавить` django_typograph `## ИспользованиеИмпортировать` from django_typograph.fields import TypographyField `Добавить поле в модель_text = models.TextField()text = TypographyField(source="_text")Выполнить миграции## Пример моделиfrom django.db import modelsfrom django_typograph.fields import TypographyFieldclass TestModel(models.Model):title = models.CharField(max_length=200, verbose_name='Название')_text = models.TextField()text = TypographyField(source='_text')def __unicode__(self):return self.titleclass Meta:verbose_name = 'TestModel'## Доступные настройки у поля TypographyField* source - Из какого поля брать исходный код для типографии* engine - Использовать другой движок для типографии именно у этого поля* options - настройки для указанного движка. Если движок не указан, то настройки все равно будут применены к текущим## НастройкаДля тонкой настройки нужно переопределить AppCfg приложенияСоздайте файл:```project_root/project_name/apps/django_typograph.py```Со след. содержимымfrom django_typograph.apps import DjangoTypographConfigclass CustomTypographConfig(DjangoTypographConfig):engines = {'EMT': {'path': 'django_typograph.engine.EMT.driver.typography','options': {},},'EMT_SAFE': {'path': 'django_typograph.engine.EMT.driver.typography','options': {'OptAlign.all': 'off','OptAlign.oa_oquote': 'off','OptAlign.oa_obracket_coma': 'off','OptAlign.layout': 'off','Text.paragraphs': 'off','Text.auto_links': 'off','Text.breakline': 'off','Text.no_repeat_words': 'off',}}}default_engine = "EMT"## Старые записиПрисутствует management команда type_records. Вся ее суть в том, что она просто пересохраняет текущих контент моделей у которых прописано поле TypographyField---А теперь рисуем сову собственно.
Package: django-tz-detect
This app will auto-detect a user’s timezone using JavaScript, then
configure Django’s timezone localization system accordingly. As a
result, dates shown to users will be in their local timezones.Authored byAdam Charnock, and some greatcontributors.How it worksOn the first page view you should find thattz_detectplaces a
piece of asynchronous JavaScript code into your page using the
template tag you inserted.  The script will obtain the user’s GMT
offset usinggetTimezoneOffset, and post it back to Django. The
offset is stored in the user’s session and Django’s timezone awareness
is configured in the middleware.The JavaScript will not be displayed in future requests.InstallationEither checkouttz_detectfrom GitHub, or install using pip:pipinstalldjango-tz-detectAddtz_detectto yourINSTALLED_APPS:INSTALLED_APPS+=('tz_detect',)Be sure you have thedjango.template.context_processors.requestprocessorTEMPLATES=[{...'OPTIONS':{'context_processors':[...'django.template.context_processors.request',],},},]Update yoururls.pyfile:urlpatterns+=[path('tz_detect/',include('tz_detect.urls')),]Add the detection template tag to your site, ideally in your base layout just before the</body>tag:{%loadtz_detect%}{%tz_detect%}AddTimezoneMiddlewaretoMIDDLEWARE:importdjangoMIDDLEWARE+=('tz_detect.middleware.TimezoneMiddleware',)ifdjango.VERSION<(1,10):MIDDLEWARE_CLASSES+=('tz_detect.middleware.TimezoneMiddleware',)(Optional) Configure the countries in which your app will be most commonly used:# These countries will be prioritized in the search# for a matching timezone. Consider putting your# app's most popular countries first.# Defaults to the top Internet using countries.TZ_DETECT_COUNTRIES=('CN','US','IN','JP','BR','RU','DE','FR','GB')Please seeexampleapplication. This application is used to manually
test the functionalities of this package. This also serves as a good
example.You need only Django 1.8 or above to run that. It might run on older
versions but that is not tested.CaveatsDjango’s timezone awareness will not be available on the first page viewThis method requires JavaScriptTimezone detection is done entirely from the user’s GMT offset, not from their locationFuture expansionA hook to allow the timezone to be stored against a userAllow timezones to be manually specifiedImprove timezone detectionOptionally using HTML5’s location API for better timezone determination