Saravanan666/pypi-org huggingface dataset:
Package: django-thvapp
thvapp is a remote visual application plugin to th system on novncthvapp used in iframe in django templatedetail documentation is in the “docs” directoryQuick startpip install django-thvappAdd “thvapp” to your INSTALLED_APPS setting like this:INSTALL_APPS = [
    ...
    'thvapp',
]Include the thvapp URLconf in your project urls.py like this:from thvapp import urls as thVAppsUrls
urlpatterns = [...] + thVAppsUrls.urlpatterns,Set IFrame Option in settings.py like this:X_FRAME_OPTIONS = ‘ALLOWALL’Add the thvapp in your html tempalte by iframe like this:1)、add path in project urls like this:path(‘vapps/’, main.vApps),2)、in main views.py:@login_required
def vApps(request):return render(request,’vapps.html’,{})3)、write the xterm.html tempalte file like:…
<div class=”page-row”><iframe id=”webthvisual” src=”/thva/apps#/applist” frameborder=”0” width=”100%” style=”min-height: 82vh” scrolling=”yes”></iframe>
</div>
…Setup thuri appid and appid in settings.py like this；THTERMCONF = {‘server’:’{ visual<shell> backend server }’,
‘appid’:’{appid}’,
‘appkey’:’{appkey}’}
TH_VISUALAPP_CONFIG = {‘VAPP_BACKEND_HOST’:’{ visualbackend server }’,‘VAPP_BACKEND_APPID’:’{ appid }’,‘VAPP_BACKEND_APPKEY’:’{appkey}’,‘VAPP_DEFAULT_IMGAGE_URL’:’/media/visual.png’, # default image url in front page
‘FOOTER_HEIGHT’:70,  # your iframe’s parent page’s footer height
‘SCREEN_RATIO’:16 / 9,  # if you want to set the remote screen ratio
‘VAPP_ICONS’:{‘{thcluster1}’:{“app1”: {“video”: “app1 image url”}, “app2”: {“video”: “{app2 video url}”}, …}} # vapp icons (image or video) you can get th visual applications from THVisual client SDK then config your own icons in settings or database}Add th user 、cluster and visual applications’ icons to session when user login like this:request.session[“systemUsername”] = “{thsystem user name}”
request.session[“cluster] = “{thcluster1}”
request.session[“vapp_icons”] = json.dumps(settings.TH_VISUALAPP_CONFIG.get(‘VAPP_ICONS’))Use nginx proxy the porject port like this:server {listen       80;
server_name  _;port_in_redirect off;location /visual/ {proxy_pass { visualbackend server }proxy_http_version 1.1;
proxy_read_timeout 600s;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}location / {proxy_set_header  Host  $host;
proxy_set_header  X-real-ip $remote_addr;
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass { django server:port };}Start the development server and visithttp://yourhost:80/vapps/you will see the web term
Package: django-thwterm
thwterm is a simple web shell to connect to thhpc cluster through webthwterm used in iframe in django templatedetail documentation is in the “docs” directoryQuick startpip install django-thwtermAdd “thwterm” to your INSTALLED_APPS setting like this:INSTALL_APPS = [
    ...
    'thwterm',
]Include the thwterm URLconf in your project urls.py like this:from thwterm import urls as thWTermUrls
urlpatterns = [...] + thWTermUrls.urlpatterns,Set IFrame Option in settings.py like this:X_FRAME_OPTIONS = ‘ALLOWALL’Add the thwterm in your html tempalte by iframe like this:1)、add path in project urls like this:path(‘xterm/’, main.xTerm),2)、in main views.py:@login_requireddef xTerm(request):return render(request,”xterm.html”,{})3)、write the xterm.html tempalte file like:…<div class=”page-row”><iframe id=”webterminaliframe” src=”/thwterm/” frameborder=”0” width=”100%” height=”100vh” style=”height: 80vh” scrolling=”no”></iframe></div>
…Setup thuri appid and appid in settings.py like this；TH_WEBTERM_CONFIG = {
‘WTERM_BACKEND_HOST’:’{ visual<shell> backend server }’,
‘WTERM_BACKEND_APPID’:’{appid}’,
‘WTERM_BACKEND_APPKEY’:’{appkey}’}Add th user and cluster to session when user login like this:request.session[“systemUsername”] = “{thsystem user name}”
request.session[“cluster] = “thcluster1”Use nginx proxy the porject port like this:server {listen       80;
server_name  _;port_in_redirect off;location /visual/ {proxy_pass { visualbackend server }proxy_http_version 1.1;
proxy_read_timeout 600s;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}location / {proxy_set_header  Host  $host;
proxy_set_header  X-real-ip $remote_addr;
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass { django server:port };}Start the development server and visithttp://yourhost:port/xterm/you will see the web term
Package: django-tiamat
A collection of utilities to help in Django ProjectsInstallationpip installdjango-tiamatAdd to your Python path orsetup.py installand add'tiamat'to yourINSTALLED_APPSsetting.UsageThis is intended for general use in any project to save time writing helpers
that are common to most projects.View Decoratorsas_jsonwill return a JSON response:from tiamat.decorators import as_json

@as_json
def some_view(request):
    #do something
    return {'key': 'value'}as_jsonpwill return a JSONP response:from tiamat.decorators import as_jsonp

@as_jsonp('callback')
def some_view(request):
    #do something
    return {'key': 'value'}`http://.../?callback=myFunctionCall`returns`myFunctionCall({"foo":"1"})`Model MixinsSlugMixinwill add a slug field (named slug) to your model that will be
automatically generated from a field called ‘name’ on saving. If you wish
to override the default field to generate the slug from setmake_slug_fromon the model. See the source for more details.Generic ManagerA simple way to add a manager that overrides the queryset returned.So this:class SomeManager(models.Manager):
    def get_query_set(self):
        return super(SomeManager, self).get_query_set().filter(this=that)


class SomeModel(models.Model):
    # define the model
    objects = models.Manager()
    custom_objects = SomeManager()Becomes this:from tiamat.models import GenericManager

class SomeModel(models.Model):
    # define the model
    objects = models.Manager()
    custom_objects = GenericManager(this=that)Pagination HelperA simple way to handle pagination of your querysets:from tiamat.paginate import page_objects

page = page_objects(Something.objects.all(), 25, 2)Where25is objects per page and2is the current page numberID EncoderThis is a good when you are using IDs in your urls. An example would be a link
generated to confirm an email address, or a link generated to reset a user’s
password.Make sure you set the settingURL_ENCODER_KEYto something different than
yourSECRET_KEYthen you can:from tiamat.urlencoder import encoder

encoder.encode_id(id)
encoder.decode_id(identifier_string)Emailsend_async_emailprovides an easy helper to send email using a template:from tiamat.mail import send_async_email

send_async_email(
    'path/to/template.html',
    {'name': 'Steve'},
    'Hello',
    [user.email for user in User.objects.all()]
)Template TagsAs an alternative to usingform.as_p()orform.as_table()and dealing
with that you can define a generic template for forms by overriding the
templatetiamat/_form.htmland using it like so:{% load tiamat_tags %}
{% render_form form %}More?See the source code for more.Need Help?Email:rvause@gmail.comGithub:https://github.com/rvause/django-tiamat
Package: django-ticker
django-ticker is a reusableDjangoapplication that provides a ticker like
news section including row level permissions. What does this mean?In django-ticker you have a fine grained permission control what the
(administrative) user can do and what not. Besides the default Django
permissions – add, change, delete – there are some extra permissions:change_foreignpublishOriginally this was created for the news section of theGerman Django communitywhere foreign users could add articles but had no permission to publish
them, cause a moderator must check these articles first.It’s easy to create a pressroom like workflow, assumed we have different
people with different permissions:The freelance journalist:Granted permissions: add, changecan add articlescan change his articles (only his own)can not delete his articlescan set the status of the article to “closed” or “draft”. Draft means,
that the article is ready for check by a moderator.in the admin list of articles, they see only they ownThe journalist:Granted permissions: add, change, delete, publishcan add articlescan change and delete his articles (only his own)can set the status of the article to “closed”, “draft” or “published”in the admin list of articles, they see only their ownThe chief editor (or moderator):Granted permissions: add, change, delete, publish, change_foreigncan add articlescan change and delete all (!) articlescan set the status of the article to “closed”, “draft” or “published”in the admin list of articles, they see all articlesThe proofreader (or subject specialist):Granted permissions: change, change_foreigncan not add articlescan not delete articlescan not publish articlescan change all articles (e.g. for correction)in the admin list of articles, they see all articlesSo, you can mix these permissions and create a workflow that perfectly
fits your needs.
Package: django-ticket
django-ticketTicket application for django project1. install packagepip install django-ticket2. add this application in settings.INSTALLED_APPS :INSTALLED_APPS = [
    # ...
    'ticket',
    # ...
]3. create and migrate migrations in BASE_DIR:python manage.py migrate ticket4. in core application include application urls:from django.urls import path , include

urlpatterns += path("ticket/", include("ticket.urls"))when you pass this missions you will see this in your admin panel:API Documentation:You can create a Ticket from admin panel for a user to  admin.
Note that and you can do all this operations from admin to a user.../create_ticket/Create a ticket from user to admin and add a new message:method:postrequired keywords :("title","section","priority","message").../add_message/Add message to a ticket :method:postrequired keywords :("ticket","message")Note: ticket means ticket's id.../close/Close ticket.method:patchrequired keywords :("ticket",)Note: ticket means ticket's id.../seen/Change ticket to seen state from usermethod:patchrequired keywords :("ticket",)Note: ticket means ticket's id.../get_my_tickets/Get all tickets of user as a listmethod:getrequired keywords :just must to be authorized.A little more ProfessionalYou can filter and have not seen tickets in admin panel:settings.py:1. Add 'ticket/templates' to DIRS of TEMPLATES:TEMPLATES = [
    {
            # ...
        'DIRS': ['ticket/templates'],
            # ...
    }
]2.Add 'ticket.context_processors.get_pending_tickets' to context_processors OPTIONS:TEMPLATES = [
    # ...
            "OPTIONS": {
            # ...
            "context_processors": [
                # ...
            'ticket.context_processors.get_pending_tickets'
                # ...
            ]
            # ...
    }
]
    # ...Finally your application is complete to use:Thanks for attention
Package: django-ticketoffice
django-ticketofficeprovides one-shot authentication (a.k.a. temporary
credentials) utilities for Django.
It lets you create and manage tickets that allow users to perform one action
on the website. As an example, Django could use it for the “password reset”
action, where users authenticate using a temporary token.ExampleRestrict some URL to guests with valid invitation tickets:fromdjango.conf.urlsimportpatterns,urlfromdjango_ticketoffice.decoratorsimportinvitation_required,stamp_invitation@invitation_required(place=u'louvre',purpose=u'visit')@stamp_invitation# Mark invitation as used right **after** view execution.defvisit_louvre(request):ticket=request.cache['invitation']# Set by `invitation_required`.returnu'Welcome to the Louvre museum{guest}'.format(guest=ticket.data['first_name'])urlpatterns=patterns('',url('^louvre$',visit_louvre,name='louvre'))Create and deliver tickets for this resource:fromdjango.utils.timezoneimportnowfromdjango_ticketoffice.modelsimportTicketticket=Ticket(place=u'louvre',purpose=u'visit')ticket.set_password(u'I love Paris')# Encrypted in database.ticket.expiry_datetime=now()+timedelta(days=5)# Optional.ticket.data={'first_name':u'Léonard'}# Optional.ticket.save()credentials={'uuid':ticket.uuid,'password':u'I love Paris'}visit_url=reverse('louvre')+'?'+urlencode(credentials)django-ticketofficefocuses on authentication. It does not send invitation
emails. You may checkdjango-mail-factoryabout sending emails.Project statusdjango-ticketofficeis, at the moment, a proof-of-concept: it delivers basic
features in order to create tickets and to use them in views. It works (you
can use it), but it may lack some features (ideas are welcome), and it may
change (improve) quite a bit. That said, maintainers will take care of release
notes and migrations.See alsovision,roadmapandalternativesto get a better overview of
project status.ResourcesDocumentation:https://django-ticketoffice.readthedocs.orgPyPI page:http://pypi.python.org/pypi/django-ticketofficeCode repository:https://github.com/novapost/django-ticketofficeBugtracker:https://github.com/novapost/django-ticketoffice/issuesContinuous integration:https://travis-ci.org/novapost/django-ticketofficeRoadmap:https://github.com/novapost/django-ticketoffice/issues/milestones
Package: django-tickets
django-tickets==============Reusable django application providing a generic support ticket system.## InstallationIf you want to install the latest stable release from PyPi:$ pip install django-ticketsIf you want to install the latest development version from GitHub:$ pip install -e git://github.com/byteweaver/django-tickets#egg=django-ticketsAdd `tickets` to your `INSTALLED_APPS`:INSTALLED_APPS = (...'tickets',...)Hook this app into your ``urls.py``:urlpatterns = patterns('',...url(r'^tickets/', include('tickets.urls', namespace='tickets')),...)## TestsTo run the test cases simply call:$ make testsor use tox test runner:$ tox
Package: django-tides
A tool to acquire, store, and serve tide data. Designed to have pluggable backends for multiple tide services. So farNOAAis the only source.InstallationUsepipto install from PyPI:pip install django-tidesAdddjango_tidesto your settings.py file:INSTALLED_APPS = (
    ...
    'django_tides',
    ...
)Additional Requirementsbeautifulsoup4to parse the XML served by NOAAdjango-tastypieto generate the APIGeoDjangois used to store point data for tide stations. I usePostGISas my database backend.Acquiring Datadjango-tidescomes with a management function:./manage.py update_tidesThis will pull all tide data for all available backends. Use this with care as it will use a lot of bandwidth.Endpointsdjango-tidesexposes two endpoints for now:/tides/api/water-level/Provides the water level at a specific station over time. Example:/tides/api/water-level/?format=json&time__gte=2013-07-04%2000:00&time__lte=2013-07-15%2000:00&limit=10&station__source_id=8447355/tides/api/station/Provides a list of stations within proximity of a given point. Example:/tides/api/station/?format=json&limit=10&offset=0&lat=41.77873679916478&lon=-70.47317504882812ContributingThink this needs something else? To contribute todjango-tidescreate a fork onBitbucket. Clone your fork, make some changes, and submit a pull request.Bugs are great contributions too! Feel free to add an issue onBitbucket.
Package: django-tidings
django-tidings is a framework for sending email notifications to users who have
registered interest in certain events, such as the modification of some model
object. Used bysupport.mozilla.organddeveloper.mozilla.org, it is
optimized for large-scale installations. Its features include…Asynchronous operation using thecelerytask queueDe-duplication of notificationsAssociation of subscriptions with either registered Django users or anonymous
email addressesOptional confirmation of anonymous subscriptionsHook points for customizing any page drawn and any email sentPlease see the full documentation atdjango-tidings.readthedocs.io.Version History2.0.1 (2018-02-14)Fix a bug where asynchronously firing a task (the default) would
raise an exception when run via Celery.2.0 (2018-02-10)Added support for Django 1.9, 1.10, 1.11, and 2.0.Dropped support for Django 1.7 and South.Dropped support forjingo. Templates for theunsubscribeview are now
standard Django templates.AddedEvent.fire(delay=False), to avoid using the
pickle serializer, which hassecurity concerns.Added settingTIDINGS_TEMPLATE_EXTENSIONto allow changing the
template extension used by theunsubscribeview fromhtmltojinja,j2, etc.Migrated Watch.email from a maximum length of 75 to 254, to follow the
EmailField update in Django 1.8.1.2 (2017-03-22)Added support for Django 1.8 and Python 3Dropped support for Python 2.61.1 (2015-04-23)Added support for Django 1.7Dropped support for Django 1.4, 1.5 and 1.6Dropped mock, Fabric and django-nose dependencies.Moved tests outside of app and simplified test setup.Added Travis CI:https://travis-ci.org/mozilla/django-tidingsMoved to ReadTheDocs:https://django-tidings.readthedocs.io/en/latest/1.0 (2015-03-03)Support Django 1.6.Fix a bug in reconstituting models under (perhaps) Django 1.5.x and up.Remove rate limit onclaim_watchestask.Add tox to support testing against multiple Django versions.0.4Fix a deprecated celery import path.Add support for newer versions of Django, and drop support for older ones.
We now support 1.4 and 1.5.Add an initial South migration.WarningIf you’re already using South in your project, you need to run the following
command to create a “fake” migration step in South’s migration history:python path/to/manage.py migrate tidings --fake0.3Support excluding multiple users when callingfire().0.2API change:_mails()now receives,
in each user/watch tuple, a list ofWatchobjects rather than just a single one. This enables you to list all
relevant watches in your emails or to make decisions from anEventUnion’s_mails()method based on
what kind of events the user was subscribed to.Expose a few attribute docs to Sphinx.0.1Initial release. In production on support.mozilla.com. API may change.
Package: django-tidy
Django-tidyMake Django automatically tidy up all your generated HTML withHTML
Tidy!InstallationFirst, make sure thetidycommand is available (e.g.,sudo apt install tidy). Then, install Django-tidy withpip:$ pip install django-tidyFinally, add the the following to yourMIDDLEWAREsetting:MIDDLEWARE += ['tidy.middleware.TidyMiddleware']PrecautionsIf used in production, it is advised to use some kind ofcachingto
prevent server overload.
Package: django-tiers
# Django Tiers[![Build Status](https://travis-ci.org/appsembler/django-tiers.svg?branch=master)](https://travis-ci.org/appsembler/django-tiers)
[![codecov](https://codecov.io/gh/appsembler/django-tiers/branch/master/graph/badge.svg)](https://codecov.io/gh/appsembler/django-tiers)This should serve as a reusable django app for representing tiers. Currently it only implements the
“Trial” tier but it should be easily extendable.## InstallAddtierstoINSTALLED_APPS.SetTIERS_EXPIRED_REDIRECT_URLandTIERS_ORGANIZATION_MODELin settings. Runmanage.py migrate.Addtiers.middleware.TierMiddlewareto MIDDLEWARE in settings.py.
You might want to add it at the top.## Testingmkvirtualenv django-tiers
make install-dev
make install-test-deps
py.test
Package: django-tigger
Bounce users out of your view by raising an exceptionIntroductionYou’re probably used to this sort of workflow:fromdjango.httpimportHttp404fromdjango.views.genericimportTemplateViewclassMyView(TemplateView):defget_context(self,**kwargs):# do some stuffraiseHttp404…but wouldn’t it be nice if rather than just bombing out with a 404, you
could bounce the user out to a redirect and attach a friendly message?  That’s
what django-tigger does!fromdjango.core.urlresolversimportreversefromdjango.views.genericimportTemplateViewfromtigger.exceptionsimportBounceclassMyView(TemplateView):defget_context(self,**kwargs):# do some stuffraiseBounce(reverse("some-url"),message="The wonderful thing about tiggers...",level="SUCCESS")The above code will bounce the user to whateversome-urlresolves to and
dump a message on the screen using the Django messaging framework.InstallationUse pip:pip installdjango-tigger.Adddjango_tigger.middleware.BouncingMiddlewareto yourMIDDLEWARElist in your Django settings.  Note that you don’t need to add this toINSTALLED_APPSas this package doesn’t have any models, migrations, or
anything that would require that.UseBasically anywhere you want to just bail out of your current process and
instead redirect the user, callBounce()and pass in a few arguments:url: The only required argument, this is where you’re bouncing your user
to.message: If supplied, this will attach a message to the user’s session
using the Django messaging frameworklevel: The level of the message.  Must be one ofDEBUG,INFO,SUCCESS,WARNING,ERROR.  The default isINFO.SupportI’ve used this in Python 3 and Django 1.11, but I see no reason why it wouldn’t
work in Python 2.7 and Django 1.10.  Older than that though, and you’ll have
trouble.  Newer than that, and you should be fine.This isn’t particularly complex code ;-)ColophonThe wonderful thing about tiggers
Is tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs
They're bouncy, trouncy, flouncy, pouncy fun, fun, fun, fun, fun
But the most wonderful thing about tiggers is I'm the only one
I'm the only one.
-- Winnie the Pooh and Tigger Too!, 1974
Package: django-tilda
На русскомWarning!Before start you have to register intilda.ccand have
“Tilda Business” account for use Tilda API.Synchronization available only forpublishedin Project pages.Supported versionsDjango >= 2.0 (old version supported >= 1.10)Python 2.7, >=3.5ScreenshotsScreenshotQuick-Start GuideInstall Django Tilda:pip install django-tildaAdd to yourINSTALLED_APPS:'django_object_actions',
'tilda',Add insettings.pyparams:TILDA_PUBLIC_KEYandTILDA_SECRET_KEYgenerated in Business account
Tilda.cc —https://tilda.cc/identity/apikeys/TILDA_PROJECTID— you need to have exist project in Tilda.cc (look at
your location bar when you work with project in Tilda panel)TILDA_MEDIA_IMAGES_URL— your url path for folder in TILDA_MEDIA_IMAGESTILDA_PUBLIC_KEY = ''
TILDA_SECRET_KEY = ''
TILDA_PROJECTID = ''
TILDA_MEDIA_IMAGES_URL = '/media/tilda/images'
TILDA_MEDIA_IMAGES = os.path.join(BASE_DIR, 'media/tilda/images')
TILDA_MEDIA_JS = os.path.join(BASE_DIR, 'media/tilda/js')
TILDA_MEDIA_CSS = os.path.join(BASE_DIR, 'media/tilda/css')TILDA_MEDIA_IMAGES,TILDA_MEDIA_JS,TILDA_MEDIA_CSS— create
this folders manuallyMigratepython manage.py migrateDone!UsageSimple example:models.pyfromdjango.dbimportmodelsfromtildaimportTildaPageFieldclassPage(models.Model):title=models.CharField(u'Title',max_length=100)tilda_content=TildaPageField(verbose_name=u'Tilda Page')created=models.DateTimeField(u'Created',auto_now_add=True)template(object— instance of Page class)<head>...
    {% for css in object.tilda_content.get_css_list %}<linkrel="stylesheet"href="{{ css }}">{% endfor %}
    ...</head><body>...
    {{ object.tilda_content.html|safe }}
    ...
    {% for js in object.tilda_content.get_js_list %}<scriptsrc="{{ js }}"></script>{% endfor %}</body>LocalizationsEnglishРусский