Saravanan666/pypi-org huggingface dataset:
Package: django-cte-trees
Django CTE Trees is an experimental implementation of Adjacency-List trees using
PostgreSQL Common Table Expressions (CTE). Its aim is to completely hide the
management of tree structure, as well as explore the issues related to including
CTE in the Django ORM.Although handling tree structure in a transparent way is a desirable
characteristic for many applications, the currently known limitations of
including CTE (see below) will be a show-stopper for many other applications.
Unless you know beforehand that these limitations will not affect your
application, this module is not suitable for you, and you should use an
actively managed tree structure (such as
django-mptt <https://github.com/django-mptt/django-mptt/> or
django-treebeard <http://code.tabo.pe/django-treebeard/>).Characteristics:Simple: inheriting from an abstract node model is sufficient to obtain tree
functionality for any Model.Seamless: does not use RawQuerySet, so queries using CTE can be combined with
normal Django queries, and won’t confuse the SQLCompiler or other QuerySets,
including using multiple databases.Self-contained: tree nodes can be manipulated without worrying about
maintaining tree structure in the database.Single query: all tree traversal operations can be performed through a single
query, including children, siblings, ancestors, roots, and descendants.Flexible ordering: supports (a subset of) normal Django ordering as well as
ordering on tree structure information, including depth and path, in DFS and
BFS orders.Multiple delete semantics: supports Pharaoh, Grandmother, and Monarchy
deletion patterns.Code: unit tests, documentation, comments.Known limitations:Virtual fields not usable in external queries: it is not yet possible to use
the virtual fields which describe the tree structure (depth, path, and
ordering information) in queries other than directly on the CTE Nodes.
Consequently, you cannot order on these fields any Model other than the CTE
Nodes themselves. See the technical notes for details.Cannot merge queries with OR: because CTE relies on custom WHERE clauses added
through extra, the bitwise OR operator cannot be used with query composition.Cannot use new Nodes without loading: immediately after creating a CTE Node,
it must be read from the database if you need to use its tree structure
(depth, path, and ordering information).Cannot order descending: you cannot order on structure fields (depth, path) or
additional normal fields combined with structure fields in descending order.
Package: django-ct-useragents
=====Useragents=====Useragents is a simple app to track the user agents, ips and other infoof the various visitors of your django site. The information is stored inthe database for easy reference and exporting.Quick start-----------1. Add "ct_useragents" and "ipware" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'ipware','ct_useragents',]2. Add useragents to the middleware:make sure you add this after 'django.contrib.auth.middleware.AuthenticationMiddleware'of you will get errorsMIDDLEWARE_CLASSES = [...'useragents.utils.UserAgentsMiddleware',...]3. Add ipware helpers to settings:# you can provide your own meta precedence order by# including IPWARE_META_PRECEDENCE_ORDER in your project's# settings.py. The check is done from top to bottomIPWARE_META_PRECEDENCE_ORDER = ('HTTP_X_FORWARDED_FOR', 'X_FORWARDED_FOR',  # client, proxy1, proxy2'HTTP_CLIENT_IP','HTTP_X_REAL_IP','HTTP_X_FORWARDED','HTTP_X_CLUSTER_CLIENT_IP','HTTP_FORWARDED_FOR','HTTP_FORWARDED','HTTP_VIA','REMOTE_ADDR',)# you can provide your own private IP prefixes by# including IPWARE_PRIVATE_IP_PREFIX in your project's setting.py# IPs that start with items listed below are ignored# and are not considered a `real` IP addressIPWARE_PRIVATE_IP_PREFIX = ('0.',  # externally non-routable'10.',  # class A private block'169.254.',  # link-local block'172.16.', '172.17.', '172.18.', '172.19.','172.20.', '172.21.', '172.22.', '172.23.','172.24.', '172.25.', '172.26.', '172.27.','172.28.', '172.29.', '172.30.', '172.31.',  # class B private blocks'192.0.2.',  # reserved for documentation and example code'192.168.',  # class C private block'255.255.255.',  # IPv4 broadcast address) + ('2001:db8:',  # reserved for documentation and example code'fc00:',  # IPv6 private block'fe80:',  # link-local unicast'ff00:',  # IPv6 multicast)for more info check django-ipware git repo: https://github.com/un33k/django-ipware3. Run `python manage.py migrate ct_useragents` to create the polls models.4. Start the development server and visit http://127.0.0.1:8000/admin/see the info on your visitors
Package: django-ctx
django-ctx==============A simple integration of the CTX defense against side-channel attacks for Django projects.Requirements============- Python 2.5+- Django 1.9+- ctx-defenseInstallation============- Install the latest stable version using ``pip``:```shpip install django-ctx```Configuration=============- Add ctx to your *INSTALLED_APPS* setting:```pythonINSTALLED_APPS = (...'django_ctx',)```- Ctx processes the *context* for template requests, which is implemented using a*context processor*. Add the ctx processor to your *context_processors* setting:```pythoncontext_processors = (...'django_ctx.context_processors.ctx_protect',)```Basic Usage===========- Load the ctx tag library:```html{% load ctx_tags %}```- Use the *ctx_protect* tag to use ctx on secrets:```html{% ctx_protect secret origin alphabet %}```*secret* is a string containing the secret that needs to be protected and *origin*is a string uniquely identifying the CTX origin for the secret. *alphabet* isan optional argument to define the alphabet that the secret belongs to, defaultbeing 'ASCII' which refers to the [ASCIIprintable](https://docs.python.org/2/library/string.html#string.printable) characters.- Add the *ctx_permutations* tag to include the used permutations for eachorigin:```html{% ctx_permutations %}```The *ctx_permutations* tag needs to be included after all *ctx_protect* tagsthat use an origin for the first time. It is proposed that it is includedbefore the *</body>* HTML tag.- Include the ctx *client script* in the template:```html<script src="ctx.js"></script>```Example=======```html<!DOCTYPE html><html><head><meta charset="utf-8"><title>django-ctx Example</title></head><body>{% load ctx_tags %}This is a very sensitive secret from origin1: {% ctx_protect "my secret" "origin1" %}This is another very sensitive secret from origin2: {% ctx_protect "my other secret" "origin2" "ASCII_printable" %}{% ctx_permutations %}<script src="ctx.js"></script></body></html>```
Package: django-cuelogic-comments
# django-cuelogic-commentsdjango-cuelogic-comments is a simple Django app to conduct Web-based Comments.Quick start-----------1. Add "comments" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'django_cuelogic_comments',)2. Include the comments URLconf in your project urls.py like this::url(r'^comments/', include('django_cuelogic_comments.urls')),3. Run `python manage.py migrate` to create the comments models.4. In your view file import the modulefrom django_cuelogic_comments import Comments5. Create a instance in your view file/where you want to include commentscomments = Comments.get(request,blog_id,edit=True,delete=True,reply=True,user=data["login"]["name"])5. Pass this comments data to your templaterender_to_response('your template file', RequestContext(request, {"comments":comments}))6. Print in Template{{comments}}
Package: django-cufon
Easy Cufon with Django.  Django-cufon provides easy-to-use template tags for use with rendering Cufon text in your
HTML with Django.It provides:A tag named{%cufon-script%}that includes the Cufon JavaScripts.  This is meant to be put inHEAD.A tag named{% cufon %}that handles rendering your Cufon texts.read the docsfor more information.ExampleIn yourHEADbe sure to include the Cufon scripts and your fonts:{% load cufon %}
<html>
<head>
    <title>My awesome page</title>
    {% cufon-script %}
    <script language="text/javascript" src="{{ STATIC_URL }}fonts/my_cufon_font.js"></script>
    [...]Then, in your body where you want to Cufon some text:<h1>{% cufon "All your base are belong to us!" "MyAwesomeFont" %}</h1>The above example will render the textAll your base are belong to us!in the Cufon font calledMyAwesomeFontDocumentationFor a little more documentation, though not much more, see thedocsfolder orread the documentation onlineAuthors & Special Thanksdjango-cufon was written byJonathan EnzinnaMany special thanks toSimo Kinnunenfor creatingCufonin the first place.
Package: django-cukierpuder-jwt-auth
=====django-cukierpuder-jwt-auth=====django-cukierpuder-jwt-auth is a simple authorization Django app based on JSON Web Tokens.Quick start-----------1. Add jwt_auth to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...,'jwt_auth.apps.JwtAuthConfig',]2. Include the polls URLconf in your project urls.py like this::path('auth/', include('jwt_auth.urls')),3. Run `python manage.py migrate` to create the polls models.4. Available endpoints::'/auth/register/' - [POST] register a new user (requires an email, username and password in request's body)'/auth/token/obtain/' - [POST] obtain access and refresh token (requires username and password in request's body)'/auth/token/refresh' - [POST] obtain refresh token (requires refresh token in request's body)'/auth/users/' - [GET] get the list of all users (requires access token in request's header)'/auth/users/<int:id>/' - [GET] get the details of specific user (requires access token in request's header)
Package: django-cumulus
django-cumulusdjango-cumulusprovides a set of tools to utilize thepython-swiftclientandRackspace Cloud Files APIfrom Django. It
includes a custom file storage class, CumulusFilesStorage.More documentation about the usage and installation ofdjango-cumuluscan be found ondjango-cumulus.readthedocs.org.The source code fordjango-cumuluscan be found and contributed to ongithub.com/django-cumulus/django-cumulus. There you can alsofile issues.To find out what’s new in this version ofdjango-cumulus, please seethe changelogCore TeamThis library is maintained by:Ferrix Hovi (@ferrix)Thomas Schreiber (@rizumu)They will be able to answer questions, give architectural guidance and merge
pull requests.Quick Installation GuidePlease visitdjango-cumulus.readthedocs.orgfor the full documentation.Install Django Cumulus with your favorite Python package manager:pip install django-cumulusTo install thein-development versionof Django Cumulus:pip install django-cumulus==devAdd'cumulus'to theINSTALLED_APPSsetting in your
project’ssettings.py:INSTALLED_APPS = (
    ...
    'cumulus',
    ...
)Add the following to your project’ssettings.pyfile:CUMULUS = {
    'USERNAME': 'YourUsername',
    'API_KEY': 'YourAPIKey',
    'CONTAINER': 'ContainerName',
    'PYRAX_IDENTITY_TYPE': 'rackspace',
}
DEFAULT_FILE_STORAGE = 'cumulus.storage.CumulusStorage'ThePYRAX_IDENTITY_TYPEparameter can either berackspaceorkeystonedepending on whether you use Rackspace or OpenStack respectively.
Package: django-currency
OverviewSimple django app that handles basic currency handling, formatting andmanualaddition of exchange rates that can be used
to easy convert from one currency to anotherExample usagefromcurrency.modelsimportCurrency,ExchangeRate,Moneyusd=Currency.objects.create(code='USD',short_name=u'$')eur=Currency.objects.create(code='EUR',short_name=u'€')ExchangeRate.objects.create(base_currency=usd,foreign_currency=eur,rate=1/1.3)print(usd.get_rate(eur))# Decimal('0.76923')print(eur.get_rate(usd))# Decimal('1.30000')my_money=Money(1531,'USD')print(my_money)# 1531.00000USDmy_money+=Money(23,'USD')print(my_money)# 1554.00000USDprint(my_money.convert_to('EUR'))# 1195.38342EUR# be careful with conversions. Errors accumulate with each conversion. Example:print(my_money.convert_to('EUR').convert_to('USD'))# 1553.99845USD# indirect rates through rates of default currency (USD) are available toohrn=Currency.objects.create(code='UAH',short_name='hrn')rub=Currency.objects.create(code='RUB',short_name='rub')ExchangeRate.objects.create(base_currency=default_currency,foreign_currency=hrn,rate='0.125')# get stored value:rate1=ExchangeRate.objects.get(base_currency=default_currency,foreign_currency=hrn)ExchangeRate.objects.create(base_currency=default_currency,foreign_currency=rub,rate='0.03125')# get stored value:rate2=ExchangeRate.objects.get(base_currency=default_currency,foreign_currency=rub)self.assertEqual(hrn.get_rate(rub),rate1.rate/rate2.rate)
Package: django-currency-history
A reusable Django app that tracks currency rates.InstallationTo get the latest stable release from PyPipipinstalldjango-currency-historyTo get the latest commit from GitHubpipinstall-egit+git://github.com/bitmazk/django-currency-history.git#egg=currency_historyTODO: Describe further installation steps (edit / remove the examples below):Addcurrency_historyto yourINSTALLED_APPSINSTALLED_APPS=(...,'currency_history',)Before your tags/filters are available in your templates, load them by using{% load currency_history_tags %}Don’t forget to migrate your database./manage.pymigratecurrency_historyUsageFirst fill the database with currencies and add your desired rates.
By default you will have to track the history by yourself. Check the
management commands and settings for automated trackings.Management Commandstrack_currency_ratesRun this command to let external services like fixer.io or Yahoo track currency
rates../manage.py track_currency_ratesYou might want to run it with a cron job.SettingsCURRENCY_SERVICEDefault = NoneBy default no external service tracks your rate histories.
The following services are available:'fixer':https://fixer.io/'openexchangerates':https://openexchangerates.org/'yahoo':http://finance.yahoo.com/currency-converter/OPENEXCHANGERATES_APP_IDDefault = FalseIf you want to make use of theopenexchangeratesservice, make sure to
register athttps://openexchangerates.org/and provide your App ID.CURRENCY_EMAIL_REPORTDefault = FalseEnable this settings to receive an email report every time thetrack_currency_ratescommand was called.Template Tagsconvert_currencyConvert an amount from one currency to another using the latest history.{% load currency_history_tags %}
{% convert_currency 2 ‘EUR’ ‘SGD’ as converted_amount %}ContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your forkmkvirtualenv-ppython2.7django-currency-historymakedevelopgitco-bfeature_branchmaster# Implement your feature and testsgitadd.&&gitcommitgitpush-uoriginfeature_branch# Send us a pull request for your feature branch
Package: django-currency_rates
Django currencies and exchange rates for django projectsYou need a key fromhttp://openexchangerates.org/to get the echange ratesFeaturesCurrencies and exchange rates modelsExchange rates with diferent rates for diferent datesLoad automatically currencies and rates fromhttp://openexchangerates.org/InstallationAdd"currency_rates"directory to your Python path.Add"currency_rates"to theINSTALLED_APPStuple found in
your settings file.AddOPENEXCHANGERATES_APP_IDto your setting file with an app key fromhttp://openexchangerates.org/Runmanage.py syncdbto create the new tables ormanage.py migrateis you are usingSouthRunmanage.py load_currenciesto load currencies fromhttp://openexchangerates.org/Runmanage.py load_ratesto load current eschange rates fromhttp://openexchangerates.org/Migrate to v0.3On version v0.3 we changed the curency name length from 25 to 50 and we adopted south for
the schema migrations.If you have installeddjango-currency-ratesversion v0.1 or v0.2 and want to migrate,
first you have to installSouthupdate thedjango-currency-ratesapp and then you have to execute
the first migration as fake with./manage.py migrate currency_rates 0001_initial --fake
./manage.py migrate currency_rates
Package: django-curriculum
=============================django-curriculum=============================.. image:: https://badge.fury.io/py/django-curriculum.svg:target: https://badge.fury.io/py/django-curriculum.. image:: https://travis-ci.org/axeliodiaz/django-curriculum.svg?branch=master:target: https://travis-ci.org/axeliodiaz/django-curriculum.. image:: https://codecov.io/gh/axeliodiaz/django-curriculum/branch/master/graph/badge.svg:target: https://codecov.io/gh/axeliodiaz/django-curriculumA simple django project to create a curriculum vitaeDocumentation-------------The full documentation is at https://django-curriculum.readthedocs.io.Quickstart----------Install django-curriculum::pip install django-curriculumAdd it to your `INSTALLED_APPS`:.. code-block:: pythonINSTALLED_APPS = (...'curriculum',...)Create migrations and migrate the models: ::python manage.py makemigrations curriculumpython manage.py migrate curriculumAdd the urls.py to access the API Rest: ::urlpatterns = [...url(r'^api/curriculum/', include('curriculum.urls')),...]All API urls by default are in: http://localhost:8000/api/curriculum/Features--------* TODORunning Tests-------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install tox(myenv) $ toxCredits-------Tools used in rendering this package:*  Cookiecutter_*  `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.1.12 (2017-07-18)++++++++++++++++++* Include Overview model.* Remove validator daprecated.* Delete additional description.* Change PhoneNumberField by IntegerField.* Fix JobInfo foreign key.* Add description to migrate.* Add migrations files.* Add details to run makemigrations and migrate.* Add language register and include all ModelAdmin.* Add TimeStampedModel to Overview0.1.13 (2017-07-19)++++++++++++++++++* Add Rest API
Package: django-cursor-pagination
Django cursor paginationA cursor based pagination system for Django. Instead of refering to specific
pages by number, we give every item in the queryset a cursor based on its
ordering values. We then ask for subsequent records by asking for recordsafterthe cursor of the last item we currently have. Similarly we can ask for
recordsbeforethe cursor of the first item to navigate back through the
list.This approach has two major advantages over traditional pagination. Firstly, it
ensures that when new data is written into the table, records cannot be moved
onto the next page. Secondly, it is much faster to query against the database
as we are not using very large offset values.There are some significant drawbacks over "traditional" pagination. The data
must be ordered by some database field(s) which are unique across all records.
A typical use case would be ordering by a creation timestamp and an id. It is
also more difficult to get the range of possible pages for the data.The inspiration for this project is largely taken fromthis
postby David
Cramer, and the connection spec forRelay
GraphQL. Much of the
implementation is inspired byDjango rest framework's Cursor
pagination..
The main difference between the Disqus approach and the one used here is that
we require the ordering to be totally determinate instead of using offsets.Installationpip install django-cursor-paginationUsagefromcursor_paginationimportCursorPaginatorfrommyapp.modelsimportPostdefposts_api(request,after=None):qs=Post.objects.all()page_size=10paginator=CursorPaginator(qs,ordering=('-created','-id'))page=paginator.page(first=page_size,after=after)data={'objects':[serialize_page(p)forpinpage],'has_next_page':page.has_next,'last_cursor':paginator.cursor(page[-1])}returndataReverse pagination can be achieved by using thelastandbeforearguments
topaginator.page.CaveatsThe ordering specifiedmustuniquely identify the object.If a cursor is given and it does not refer to a valid object, the values ofhas_previous(forafter) orhas_next(forbefore) will always returnTrue.NULLcomes at the end in query results withORDER BYboth forASCandDESC.
Package: django-cursor-pagination-dtkav
Django cursor pagination [![Build Status](https://travis-ci.org/photocrowd/django-cursor-pagination.svg?branch=master)](https://travis-ci.org/photocrowd/django-cursor-pagination)========================THIS IS A FORK========================This is a fork of django-cursor-pagination, you probably don't want to use it.Try photocrowd/django-cursor-pagination instead.Original Readme========================A cursor based pagination system for Django. Instead of refering to specificpages by number, we give every item in the queryset a cursor based on itsordering values. We then ask for subsequent records by asking for records*after* the cursor of the last item we currently have. Similarly we can ask forrecords *before* the cursor of the first item to navigate back through thelist.This approach has two major advantages over traditional pagination. Firstly, itensures that when new data is written into the table, records cannot be movedonto the next page. Secondly, it is much faster to query against the databaseas we are not using very large offset values.There are some significant drawbacks over "traditional" pagination. The datamust be ordered by some database field(s) which are unique across all records.A typical use case would be ordering by a creation timestamp and an id. It isalso more difficult to get the range of possible pages for the data.The inspiration for this project is largely taken from [thispost](http://cra.mr/2011/03/08/building-cursors-for-the-disqus-api) by DavidCramer, and the connection spec for [RelayGraphQL](https://facebook.github.io/relay/graphql/connections.htm). Much of theimplementation is inspired by [Django rest framework's Cursorpagination.](https://github.com/tomchristie/django-rest-framework/blob/9b56dda91850a07cfaecbe972e0f586434b965c3/rest_framework/pagination.py#L407-L707).The main difference between the Disqus approach and the one used here is thatwe require the ordering to be totally determinate instead of using offsets.Installation------------```pip install django-cursor-pagination```Usage-----```pythonfrom cursor_pagination import CursorPaginatorfrom myapp.models import Postdef posts_api(request, after=None):qs = Post.objects.all()page_size = 10paginator = CursorPaginator(qs, ordering=('-created', '-id'))page = paginator.page(first=page_size, after=after)data = {'objects': [serialize_page(p) for p in page],'has_next_page': page.has_next,'last_cursor': paginator.cursor(page[-1])}return data```Reverse pagination can be achieved by using the `last` and `before` argumentsto `paginator.page`.Caveats-------- The ordering specified **must** uniquely identify the object.- If there are multiple ordering fields, then they must all have the samedirection- No support for multiple ordering fields in SQLite as it does not supporttuple comparison.- If a cursor is given and it does not refer to a valid object, the values of`has_previous` (for `after`) or `has_next` (for `before`) will always return`True`.
Package: django-curtail-uuid
Installationpip install django-curtail-uuidUsagefrom account.models import LensmanInfo

from django_curtail_uuid import CurtailUUID

CurtailUUID.uuid(LensmanInfo, field='lensman_id', length=7)FunctionCurtailUUID.uuid(model, field='uuid', length=None)Settings.pyCURTAIL_UUID_LENGTH = 7
Package: django-curtains
UsageInstall the module usingpip installdjango-curtainsAdd one of the included middleware toMIDDLEWAREcurtains.middleware.only_staffOnly allows access to authenticated staff members. TheONLY_STAFF_EXEMPTsetting (defaults tor"^/admin|^/accounts") allows excluding URLs from the
middleware.curtains.middleware.basic_authRequires basic authorization to access the site. TheBASIC_AUTH_CREDENTIALSsetting should be set to a list containing the username and the password for
basic authorization, e.g.BASIC_AUTH_CREDENTIALS = ['early', 'birds'].BASIC_AUTH_EXEMPTcan be set to a regex of paths to exempt from the
authorization requirement.curtains.middleware.ip_networks_onlyRequires a list of networks in theIP_NETWORKSsetting. The default is127.0.0.0/8. TheIP_NETWORKS_EXEMPTsetting exists.