Saravanan666/pypi-org huggingface dataset:
Package: django-fastbill
management commandspython manage.py fastbill --update-articlessignalsput this in your models.pyfrom django_fastbill.signals import customer_signal, subscription_signal, payment_signalfrom django.dispatch import receiver@receiver(customer_signal)def customer_signal_receiver(sender, customer, event_type, raw_data, **kwargs):print "#" * 50print "sender", senderprint "event_type", event_typeprint "customer", customerprint "data", raw_dataprint "#" * 50@receiver(subscription_signal)def subscription_signal_receiver(sender, customer, subscription, event_type, raw_data, **kwargs):print "#" * 50print "sender", senderprint "event_type", event_typeprint "customer", customerprint "subscription", subscriptionprint "data", raw_dataprint "#" * 50@receiver(payment_signal)def payment_signal_receiver(sender, customer, subscription, invoice, event_type, raw_data, **kwargs):print "#" * 50print "sender", senderprint "event_type", event_typeprint "customer", customerprint "subscription", subscriptionprint "invoice", invoiceprint "data", raw_dataprint "#" * 50
Package: django-fast-export
Utilities for quickly streaming CSV responses to the clientThanks,https://docs.djangoproject.com/en/4.0/howto/outputting-csv/Example usage:fromdjango_fast_export.csvimportStreamingCSVResponseresponse=StreamingCSVResponse.from_queryset(queryset)Or with additional fields:fromdjango_fast_export.csvimportStreamingCSVResponse,all_values,all_verbose_namesdefgenerate():yield(all_verbose_names(queryset.model)+["Lösungen"])yield from((all_values(instance)+[instance.get_solutions()])forinstanceinqueryset)response=StreamingCSVResponse(generate())
Package: django-fast-fixtures
The fast_fixtures django application provides apps with a way to export fixtures which note the state of the database when they were made.They then allow the database to move to that state when loading the data or warn the user about the discrepencies (if they want to play it save)This module is very new and it's ideas are pretty radical. Please test and consider contributing to the code.Caveats:* Output only supports json right now. This is a limitation of django's serializer structure.Features:* Json file is backwards compatible and new data is ignored if not relivent.* Will not run any migrations for test fixtures, but this tools could be used to upgrade those fixtures.Installation:```pythonpip install django-fast-fixturesINSTALLED_APPS = (...'fast_fixtures',)```Use:```bashmanage.py dumpdata --migrated > fixture.jsonmanage.py migrate ... or another website instancemanage.py loaddata fixture.json```Data Created:The data created in the json file is almost exactly the same, except for a new header object which appears at the start of the data stream:```json[{"model": "auth.user","fields": {},"migrations": {"app_label": "last_migration_label",...},},...other data]```The model and fields entries are there so the header is ignored by a normal loaddata process. Migrations lists all the apps that are included in this dump and their last applied migration in order.
Package: django-fast-gfk
Django Fast Generic Foreign KeysTravisOverviewGeneric foreign keys are incredibly powerful but can’t be prefetched, leading
to a large number of SQL queries when accessing a generic foreign key field
while iterating over a queryset. This app provides a function that reduces the
number of SQL queries to1 + (number of content types included in the set of generic foreign keys).InstallationInstall or adddjango-fast-gfkto your Python path.UsageThefetchfunction returns a generator with the generic foreign key prefetched. Parameterfieldis the name of the generic foreign key.:from fast_gfk import fetch

fetch(Bar.objects.all(), field="target"))AuthorsHedley RoosChangelog0.1Initial release.
Package: django-fast-migrations
Django-Fast-MigrationsCommand to speed up the application of migrations in a Django project.InstallationInstall using pip:pip install django-fast-migrationsThen add'django_fast_migrations'to yourINSTALLED_APPS.INSTALLED_APPS = [
    ...
    'django_fast_migrations',
]UsageHow to execute command:./manage.py migrate_by_appThe previous command only checks if there are applications with pending migrations.To execute the pending migrations we have to call the command:./manage.py migrate_by_appWhen executed without parameters itonly checksif there are applications with pending migrationsPossible arguments:--execute: If pending migrations are found then execute them.--database: Nominates a database to synchronize. Defaults to the "default" database.
Package: django-fast-paginator
Fast Paginator for DjangoSimple speedy pagination over your large database tables.FeaturesSimple IntegrationFastPaginator API is compatible with Django's built-in pagination library. Only change your import statements then you're ready.Better SQL QueriesDjango's built-in pagination system builds SQL queries that have offset and limit clauses. FastPagination does not use them.Built-in Cache SystemFastPaginator has a built-in cache system. It does not cache QuerySets but caches primary keys of object lists. This provides speedup for pagination progress.Quick StartAdd "fast_pagination" to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'fast_pagination']In Django settings, you can set FAST_PAGINATION_TIMEOUT variable to invalidate cache. Default value is 1 hour.In Django settings, you can set FAST_PAGINATION_PREFIX variable to use in cache keys. Default values is 'fastpagination'.Import FastPaginator like this:fromfast_pagination.helpersimportFastPaginatorThen, you are ready. All you have to do is give your queryset and number of entries when creating FastPaginator object.To Run TestsCreate a dummy project.Run following command../manage.pytestfast_pagination.testsBenchmarkThis benchmark is executed on Postgres9.6 with a table that has 1000000 rows, and fetched only one field. Results can be seen below.PaginatorMinMaxMeanStdDevMedianDjango93.5535 (1.53)95.7217 (1.54)94.7340 (1.53)0.9755 (2.32)94.9046 (1.54)FastPaginator61.1488 (1.0)62.3316 (1.0)61.7489 (1.0)0.4205 (1.0)61.7649 (1.0)You can also run benchmark tests following instructions:Run migrations if app needs using./manage.pymigrateCall generate_users command from command line using./manage.pygenerate_users1000000Run tests usingpytestfast_pagination/tests.py
Package: django-fastsettings
# FastSettingsVersion:0.5Download:<https://pypi.org/project/django-fastsettings>Source:<https://github.com/wickeym/django-fastsettings>Keywords:django, redis, database, settings, fastsettingsDjango FastSettings stores settings in the database and syncs it to redis, so that access is “fast”. This will work without redis, it will simply fetch from the database each time.## Quick startpip install django-fastsettingsAdd “fastsettings” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'fastsettings',
]Add the Redis connection settings to the django settings.py file` python # PROJECT SETTINGS (used in fastsettings) REDIS_HOST = 'localhost' REDIS_PORT = 6379 REDIS_DB = 0 REDIS_PASSWORD = "your_redis_password" `For logging, add a handler for “fastsettings_logger” in your logging configuration:Runpython manage.py migrateto create the fastsettings models.Start the development server and visit <http://127.0.0.1:8000/admin/> to create a fastsetting (you’ll need the Admin app enabled).
Package: django-fasttest
This is an alternateTestCaseclass to improve test running times (I measured
a 2x improvement on some of my projects).You can just use it and get a speed improvement for free, as long as your
projects satisfy the follwoing conditions:You use Django 1.3 (It might work with newer versions but I haven’t tried)Your tests use postgreSQL as a database backend, 8.0 or newerYour tests usa a single-database setupYour tests don’t make operations on the db connection that make some state
change that is not reverted by a savepoint rollback.If the last point is false for a few of your tests, you can use the regulardjango.test.TestCasefor that case, and gain the speed improvement in most of
them.How to useChange your:from django.test import TestCaseto:from django_fasttest import TestCaseHow does it workWhat makes it faster is that fixture parsing/loading is done once perTestCaseinstead of once per test. Between tests in a sameTestCase, the database is
rolled back (using a pgsql savepoint) to the point just after loading the
fixtures.All the tests within a testcase use the same database connection (the standardTestCaseclass shuts down the connection between tests), and are run within
the same transaction. If you use transactions in your code, you’ll have the
same limitations as you do currently in Django 1.3The speed benefits will be more noticeable if you have many test cases that use
large fixtures, and if those tests are grouped in aTestCase.
Package: django-fast-test
django-fast-testprovides a Django Command fast_test.FeaturesDjango fast_test command.Installation & UsageInstall from code usingpython setup.py buildand thenpython setup.py install, or usingpip installdjango-fast-test.Add'django_fast_storage'to yourINSTALLED_APPSsetting.Run the command by:python manage.py fast_test.How it worksThe fast_test command runs very fast, because it does not create TEST DB and does not run migrations.
Directly, it uses the developing db or product db, and the result of operations onto db is really durably committed.
So, CAUTIOUSLY use this command.Support and announcementsDownloads and bug tracking can be found at themain project
website.
Package: django-fast-utils
Django Fast UtilsOfficial Documentation-https://tarsil.github.io/django-fast-utils/Table of ContentsAbout Django Fast UtilsOverviewVersionsDocumentationInstallationDocumentation and SupportLicenseAbout Django Fast UtilsDjango Fast Utils is a miscellaneous of common utilities for every new or existing
django projects. From auditing models to database fields and REST framework mixins.OverviewSupported Django and Python VersionsDjango / Python3.73.83.93.102.2YesYesYesYes3.0YesYesYesYes3.1YesYesYesYes3.2YesYesYesYes4.0YesYesYesYesDocumentationInstallationTo install django-fast-utils:$pipinstalldjango-fast-utilsDocumentation and SupportFull documentation for the project is available athttps://tarsil.github.io/django-fast-utils/LicenseCopyright (c) 2022-present Tiago Silva and contributors under theMIT license.
Package: django-faucet-pipeline
Django Faucet Pipelinedjango-faucet-pipeline integratesfaucet-pipelinewith Django. It allows you to
transparently reference assets created by faucet-pipeline in Django templates and operate on them using thedjango.contrib.staticfilesapp.UsageConfiguring Django and faucet-pipelineTo start using faucet-pipeline in Django, you need to make sure that both the staticfiles and the django_faucet_pipeline app are mentioned in theINSTALLED_APPSsection ofsettings.py:INSTALLED_APPS=[…,'django.contrib.staticfiles','django_faucet_pipeline',]faucet-pipeline needs to be configured to write amanifest.jsonfile for integrating with Django. By default,
django-faucet-pipeline will look for this file in theBASE_DIRof the Django project (as specified
bysettings.py). You can customise the search path usingFAUCET_PIPELINE_MANIFESTsetting.The manifest configuration needs to align with the Django configuration in two
respects: TheSTATIC_URLin settings by needs to be the same as thebaseURIin the manifest config.
Also, all assets need to be output into thewebRoot, which also needs to be configured as one of theSTATICFILES_DIRSin Django. For example, if you were to have the following configuration in Django:BASE_DIR=Path(__file__).resolve().parent.parentSTATIC_URL='/static/'STATICFILES_DIRS=[BASE_DIR/"dist/"]A compatiblefaucet.config.jsmight look as follows:module.exports={js:{input:'app/index.js',output:'dist/bundle.js'},manifest:{target:"./manifest.json",key:"short",baseURI:"/static/",webRoot:"./dist"}};django-faucet-pipeline will emit an error message if it cannot read the manifest file, but it will not check
whether your webRoot and andSTATICFILES_DIRSconfiguration is correct.Referencing assetsIn order to reference an asset, you simply use thestatic_faucettemplate tag from thefaucet_pipelinelibrary. This behaves similarly to the "standard"statictag, but automatically expands the canonical name
of the asset to the current (potentially fingerprinted) name.{% load static_faucet from faucet_pipeline %}<!doctype html><html><head><metacharset="utf-8"><title>Hello World</title></head><body><scriptsrc="{% static_faucet "bundle.js"%}"type="text/javascript"></script></body></html>Debug vs. ProductionThe behaviour of django-faucet-pipeline will change depending on whether the Django settingsDEBUGis set
to true or not. If debug mode is enabled, the manifest file will be re-read when ever a template is rendered.
In production, you should haveDEBUGset toFalse, in which casemanifest.jsonwill be read once on first
access and then cached indefinitely.
Package: django-fav
django-favA simple reusable app for django that makes it easy to deal with faving
and unfaving any object from any application.It comes with a Graphene (GraphQL) Query to enable favs in your queries.RequirementsPython 3.4+Django 1.11Installationpip install django-favAdd the app to your settings.pyINSTALLED_APPS=[..."fav",...]Sync your database:python manage.py migrateUsage:Favorites ManagerCreate a Favorite instance for a user and object:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='gengue')>>>song=Song.objects.get(pk=1)>>>fav=Favorite.objects.create(user,song)or:>>>fav=Favorite.objects.create(user,1,Song)or:>>>fav=Favorite.objects.create(user,1,"music.Song")Get the objects favorited by a given user:>>>fromdjango.contrib.auth.modelsimportUser>>>user=User.objects.get(username='gengue')>>>Favorite.objects.for_user(user)>>>[<Favorite:Favoriteobject1>,<Favorite:Favoriteobject2>,<Favorite:Favoriteobject3>]Now, get user favorited objects belonging to a given model:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='gengue')>>>Favorite.objects.for_user(user,model=Song)>>>[<Favorite:Favoriteobject1>,<Favorite:Favoriteobject2>,<Favorite:Favoriteobject3>]Get the favorited object instances of a given model favorited by any user:>>>frommusic.modelsimportSong>>>Favorite.objects.for_model(Song)>>>[<Favorite:Favoriteobject1>,<Favorite:Favoriteobject2>,<Favorite:Favoriteobject3>]Get a Favorite instance for a given object and user:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='gengue')>>>song=Song.objects.get(pk=1)>>>fav=Favorite.objects.get_favorite(user,song)Get all Favorite instances for a given object>>>frommusic.modelsimportSong>>>song=Song.objects.get(pk=1)>>>fav=Favorite.objects.for_object(song)GraphqlInsettings.py, map your grahene queries to your django modelsFAV_MODELS={'CurrentUser':'core.user','User':'core.user','Track':'listen.Track',}Addurl_renditions.graphql_schema.Queryto your root query and mutation.importgrapheneimportfav.graphql_schemaclassQuery(...fav.graphql_schema.Query,graphene.ObjectType):passclassMutation(...fav.graphql_schema.Mutation,graphene.ObjectType):passschema=graphene.Schema(query=Query,mutation=Mutation)QueryThen, you can ask for:query{isInUserFavorites(objectId:"VHJhY2s6OA==")}and you get{"data":{"isInUserFavorites":false}}Mutationmutation{favorite(input:{objectId:"VHJhY2s6OA=="}){deletedcreated}}and you get{"data":{"favorite":{"deleted":null,"created":true,}}}ThanksThis apps was based on the fork:https://github.com/gengue/django-favswhich is based on the fork ofhttps://github.com/streema/django-favitby streema.
Package: django-favicon
A reusable app to add simple favicon.ico handling for your site.InstallationInstall “django-favicon” using pip or easy_install:pip install django-faviconAdd “favicon” to your INSTALLED_APPS in settings.py:INSTALLED_APPS = (
    ...
    'favicon',
)Add favicon URL patterns to urls.py:urlpatterns = patterns('',
    ...
    url(r'^', include('favicon.urls')),
)UsagePut favicon.ico into your STATIC_ROOT. and you good to go, /favicon.ico will automatically redirect to /static/favicon.ico if your STATIC_URL = ‘/static/’.Otherwise you can set a custom path to your favicon using FAVICON_PATH setting. For example:FAVICON_PATH = STATIC_URL + 'images/favicon.png'Running the TestsYou can run the tests with via:python setup.py testor:python runtests.pyContributePyPI (Downloads)https://pypi.python.org/pypi/django-faviconOfficial repositoryhttps://github.com/littlepea/django-faviconIssue trackerhttps://github.com/littlepea/django-favicon/issuesCreditsDeveloped and maintained under supervision ofEvgeny Demchenko
Package: django-favit
# django-favitA simple reusable app for django that makes it easy to deal with favingand unfaving any object from any application.## Installation* Install django-favit in your vilrtual env:```pip install django-favit```* Add the app to your settings.py```pythonINSTALLED_APPS = [..."favit",...]```* Add favit urls to your project's `urls.py` file:```pythonurlpatterns = patterns('',...(r'^favit/', include('favit.urls')),...)```* Sync your database:```python manage.py syncdb```* Make sure you have jQuery ajax CSRF configuration rightSee https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#ajax## Usage:### Template tags:* Get the favorited objects for a given user:```python{% with user_favorites <user> "app_label.model" as favorite_list %}{% for fav_obj in favorite_list %}{# do something with fav_obj #}{% endfor %}{% endwith %}```* Given an object `obj` you may show it fav count like this:```python<p>Favorite Count {{ obj|favorites_count }}</p>```* Get Favorite instance for an object (obj) and a user (user)```python{% with obj|get_favorite_for:user as fav_object %}...{% endwith %}```* Favorite Button for an object `my_obj`:```python{% favorite_button my_obj %}```### Favorites Manager* Create a Favorite instance for a user and object:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.create(user, song)```or:```python>>> fav = Favorite.objects.create(user, 1, Song)```or:```python>>> fav = Favorite.objects.create(user, 1, "music.Song")```* Get the objects favorited by a given user:```python>>> from django.contrib.auth.models import User>>> user = User.objects.get(username='jdoe')>>> Favorite.objects.for_user(user)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Now, get user favorited objects belonging to a given model:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> Favorite.objects.for_user(user, model=Song)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Get the favorited object instances of a given model favorited by any user:```python>>> from music.models import Song>>> Favorite.objects.for_model(Song)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Get a Favorite instance for a given object and user:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.get_favorite(user, song)```* Get all Favorite instances for a given object```python>>> from music.models import Song>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.for_object(song)```
Package: django-favman
django-favman===============================================* `Overview`_* `Quick start`_.. _Overview: #overview.. _Quick start: #quick-start.. _overview:Overview?------------------------------------django-favman is a simple application that let users bookmark their favorites... _quick-start:Quick start------------------------------------In settings.py, add 'favman' to the INSTALLED_APPSIn urls.py add ``(r'^favorites/', include('favman.urls'))`` to your urlpatternsIn your templates ::{% load favman_tags %}{% favman_media %}{{object_to_manage}}{% favman_item object=object_to_manage %}It will create a two-state icon that indicates if the object is in the user favorites.Clicking on this icon will toggle the state.The user can also see the list of /favorites/list/License=======django-favman is licensed under the GNU-LGPL
Package: django-favs-sc
# django-favitA simple reusable app for django that makes it easy to deal with favingand unfaving any object from any application.## Installation* Install django-favit in your vilrtual env:```pip install django-favit```* Add the app to your settings.py```pythonINSTALLED_APPS = [..."favit",...]```* Add favit urls to your project's `urls.py` file:```pythonurlpatterns = patterns('',...(r'^favit/', include('favit.urls')),...)```* Sync your database:```python manage.py syncdb```* Make sure you have jQuery ajax CSRF configuration rightSee https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#ajax## Usage:### Template tags:* Get the favorited objects for a given user:```python{% with user_favorites <user> "app_label.model" as favorite_list %}{% for fav_obj in favorite_list %}{# do something with fav_obj #}{% endfor %}{% endwith %}```* Given an object `obj` you may show it fav count like this:```python<p>Favorite Count {{ obj|favorites_count }}</p>```* Get Favorite instance for an object (obj) and a user (user)```python{% with obj|get_favorite_for:user as fav_object %}...{% endwith %}```* Favorite Button for an object `my_obj`:```python{% favorite_button my_obj %}```### Favorites Manager* Create a Favorite instance for a user and object:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.create(user, song)```or:```python>>> fav = Favorite.objects.create(user, 1, Song)```or:```python>>> fav = Favorite.objects.create(user, 1, "music.Song")```* Get the objects favorited by a given user:```python>>> from django.contrib.auth.models import User>>> user = User.objects.get(username='jdoe')>>> Favorite.objects.for_user(user)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Now, get user favorited objects belonging to a given model:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> Favorite.objects.for_user(user, model=Song)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Get the favorited object instances of a given model favorited by any user:```python>>> from music.models import Song>>> Favorite.objects.for_model(Song)>>> [<Favorite: Favorite object 1>, <Favorite: Favorite object 2>, <Favorite: Favorite object 3>]```* Get a Favorite instance for a given object and user:```python>>> from django.contrib.auth.models import User>>> from music.models import Song>>> user = User.objects.get(username='jdoe')>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.get_favorite(user, song)```* Get all Favorite instances for a given object```python>>> from music.models import Song>>> song = Song.objects.get(pk=1)>>> fav = Favorite.objects.for_object(song)```