Saravanan666/pypi-org huggingface dataset:
Package: django-link-shortener
django-link-shortener is a simple time and usage sensitive url shortening app.Uses A-Za-z0-9 with the exception of I, i and 1.Requires user to be logged in for link creation.Usagepip install django-link-shortenerAdd ‘shortener’to your INSTALLED_APPS setting:INSTALLED_APPS = [
    ...
    'shortener',
]Includeshortener.urlsin your project urls.py:path('s/', include('shortener.urls')),Runpython manage.py migrateto create the shortener models.TestingAdd the following to settings` SHORTENER_ENABLE_TEST_PATH = True `Start the development server and visithttp://127.0.0.1:8000/s/test/<My-URL-HERE>
to create a test shortcode.orUse shortener.create(user, link) to generate a link via code. Use shortener.expand(link)
to revertVisithttp://127.0.0.1:8000/s/<shortcode>/ to be redirectedConfiguration OptionsPlace in settings.py. Each setting be overridden on a per-user basis using the admin UrlProfile sectionSHORTENER_ENABLEDDefault: TrueControls whether users without a shortener profile can create shortlinks.SHORTENER_MAX_URLSDefault: -1Controls the default maximum limit of generated urls per account.
-1 sets infinite.SHORTENER_MAX_CONCURRENTDefault: -1Controls the default maximum limit ofconcurrent(active) generated urls per account.
-1 sets infiniteSHORTENER_LIFESPANDefault: -1Sets the default lifespan of links in seconds
-1 sets infiniteSHORTENER_MAX_USESDefault: -1Sets the default amount of times a link can be followed
-1 sets infiniteSHORTENER_LENGTHDefault: 5Note: Omitted from UrlProfileSets how many digits should be used for links.
Tries up to three times to generate a unique shortcode where
Each failure will result in length temporarily being increased by 1.SHORTENER_ENABLE_TEST_PATHDefault: FalseIf true, creates shortlinks for logged in users at s/test/<<url>>/The response is the shortcode to use used at s/<<shortcode>>Common Use Casesgoo.gl type usage (default). Unlimited concurrent links for an unlimited length of timeSHORTENER_ENABLED = True
SHORTENER_MAX_URLS = -1
SHORTENER_MAX_CONCURRENT = -1
SHORTENER_LIFESPAN = -1
SHORTENER_MAX_USES = -1Internal temporary link usage (such as on nodeferret.com). 100 Temp links per minute. 1 usage per link.SHORTENER_ENABLED = True
SHORTENER_MAX_URLS = -1
SHORTENER_MAX_CONCURRENT = 100 # To prevent spamming
SHORTENER_LIFESPAN = 600
SHORTENER_MAX_USES = 1Changelogv0.5Replaced NullBooleanField with BooleanField (Credit: sen-den)Replaced travis-ci with github actionsv0.4Allow null values in UrlProfile; null fields will use global valuesstr representation of UrlProfile in adminadd user to str representation of UrlMapremoved 256 char limit on full_url (Credit: Khaeshah)Upgrade Instructions0.3 / 0.4 –> 0.5pip install django-link-shortener==0.5
python manage.py migrate
Package: django-linkthru
Author:Colin PowellDate:2011-04-26by:One Cardinal Web Developmentlicense:GPLv3Big chunks of thie projects were taken from @andrewebdev’s excellent adzone project. What was need though, was much less of a full-featured ad management app, but just a way to provide on-site link throughs to miscellaneous content.In other words, I wanted on-site ads that wouldn’t get caught by the adblockers and didn’t keep track of advertisers or categories or other junk like that. Just some text or an image, linked to a specific url.
Package: django-lint
Consulting services: if your organisation needs a reputable software developer with a track record of producing high-quality and maintainable Python/Django code, please get in touch to discuss your needs.More infoIdeasDefault manager with restrictive get_query_set()Oldforms (?)Overring definition of model. Eg:class MyModel(models.Model):foo = [..]
foo = [..]Not importing settings via “django.conf import settings”Not using reverse (or @permalink) in get_absolute_url (?)Form definitions in models.pyIgnore testsModelsDon’t count ManyToMany fields on a model as a fieldRemove common prefix checking.models.. specifying “objects = “ should be lastViewsCalling request.is_authenticated without actually calling functionorder_by(‘?’)request.method.upper is a no-op (etc.)cache.set without a timeoutURLSUnreversible urlpatternsLayoutForm class not in forms.pyAdmin class not in admin.pyTemplates{% if foo %}{{ foo }}{% else %}bar{% endif %} => {{ foo|default:”bar” }}{% with foo as bar %} … [ not using {{ bar }} ] … {% endwith %}{% endblock %} vs. {% endblock blockname %}SettingsOrdering of MIDDLEWARE_CLASSESTEMPLATE_DIRS not absoluteLayoutforms not in forms.py
managers not in managers.py
Package: django-lint2
# django-lint2 ✅Lint2 is a linter work with Django.## RequirementsPython 3+DjangoFlake8## InstallationInstall using pip!```shpip install flake8 django-lint2```Add 'lint2' to your INSTALLED_APPS setting.```pyINSTALLED_APPS = (...,'lint2',)```## SettingsAdd options of flake8 to your settings.See flake8 documents (http://flake8.pycqa.org/en/latest/user/configuration.html).```pyLINT2 = {'max_line_length': 120,}```
Package: django_linter
This is a simple extension for pylint that aims to check some common mistakes in django projects.Contributions are welcome.Installationpip install django_linterUsageIt can be used as a plugin or standalone script. To use it as a plugin it should be installed first, then run with pylint:pylint --load-plugins=django_linter TARGETTo use it as a standalone script:usage: django-linter [-h] TARGET [TARGET ...]

Simple extension for pylint to check django projects for common mistakes.

positional arguments:
  TARGET      python package or module

optional arguments:
  -h, --help  show this help message and exitImplemented checksSettings:E5221 (required-setting-missed): Used when required setting missed in settings file.E5222 (empty-setting): Used when setting is empty value.W5221 (improper-settings-import): Used when settings is not imported from django.confModels:W5241 (nullable-text-field): Used when text field has null=True.W5242 (float-money-field): Used when money related field uses FloatField.W5243 (naive-datetime-used): Used when there is datetime.now is used.W5244 (related-field-named-with-id): Used when related field is named with _id suffixW5245 (unicode-method-absent): Used when model has no unicode method.W5246 (unicode-method-return): Used when unicode method does not return unicode.W5247 (model-field-redefinition): Used when there are more than one model field with the same name.W5248 (get-absolute-url-without-reverse): Used when get_absolute_url method is defined without using reverse function.Forms:W5211 (form-field-redefinition): Used when there are more than one form field with the same name.Views:W5231 (is-authenticated-not-called): Used when is_authenticated method is not calledW5232 (objects-get-without-doesnotexist): Used when Model.objects.get is used without enclosing it in try-except block to catch DoesNotExist exception.W5233 (fetching-db-objects-len): Used when there is db query that fetches objects from database only to check the number of returned objects.W5234 (raw-get-post-access): Used when request.GET or request.POST dicts is accessed directly, it is better to use forms.Layout:W5201 (forms-layout): Used when form class definition is not in forms module.W5202 (admin-layout): Used when admin class definition is not in admin module.Misc:W5251 (print-used): Used when there is print statement or functionImplemented suppressers“Meta” classesurlpatternsloggerImplemented transformersModels“id” field“objects” manager“DoesNotExist” exception“MultipleObjectsReturned” exceptionTestingtest responses (django and DRF)Factoriesfactory-boy’s factories  (factory should return django model, but not always possible to infer model class)
Package: django-linux
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Thanks for checking it out.All documentation is in the “docs” directory and online athttps://docs.djangoproject.com/en/stable/. If you’re just getting started, here’s how we recommend you read the docs:First, read docs/intro/install.txt for instructions on installing Django.
Next, work through the tutorials in order (docs/intro/tutorial01.txt, docs/intro/tutorial02.txt, etc.).
If you want to set up an actual deployment server, read docs/howto/deployment/index.txt for instructions.
You’ll probably want to read through the topical guides (in docs/topics) next; from there you can jump to the HOWTOs (in docs/howto) for specific problems, and check out the reference (docs/ref) for gory details.
See docs/README for instructions on building an HTML version of the docs.
Docs are updated rigorously. If you find any problems in the docs, or think they should be clarified in any way, please take 30 seconds to fill out a ticket here:https://code.djangoproject.com/newticketTo get more help:Join the #django channel on irc.freenode.net. Lots of helpful people hang out there. Seehttps://en.wikipedia.org/wiki/Wikipedia:IRC/Tutorialif you’re new to IRC.
Join the django-users mailing list, or read the archives, athttps://groups.google.com/group/django-users.
To contribute to Django:Check outhttps://docs.djangoproject.com/en/dev/internals/contributing/for information about getting involved.
To run Django’s test suite:Follow the instructions in the “Unit tests” section of docs/internals/contributing/writing-code/unit-tests.txt, published online athttps://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests
Package: django-liqpay
# MP-LiqPayDjango liqpay integration app.### InstallationInstall with pip:```$ pip install django-liqpay```App settings:```# REQUIRED:# Public_key - the identifier of the created company. For example: i00000000LIQPAY_PUBLIC_KEY = '*********'# Private key of the created company (not available to anyone except your developer).# For example: a4825234f4bae72a0be04eafe9e8e2bada209255LIQPAY_PRIVATE_KEY = '***********************************'# OPTIONAL:# Payment currency. Example value: USD, EUR, RUB, UAH, BYN, KZT.# Additional currencies can be added by company's request.# Default: UAHLIQPAY_DEFAULT_CURRENCY = '***'# Language code# Default: ukLIQPAY_DEFAULT_LANGUAGE = '**'# Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account,# subscribe - regular payment, paydonate - donation, auth - card preauth# Default: payLIQPAY_DEFAULT_ACTION = '***'```## Usage exampleviews.py```checkout_form = liqpay.get_checkout_form(amount=12.4,order_id=1,description=_('Provision of services'),result_url='http://example.com',server_url='http://example.com',language='en')```get_checkout_form method params:* public_key: str, required* amount: float, required* description: str, required* order_id: str, required* result_url: url, str, required* server_url: url, str, required* version: integer, optional, default - 3* action: str, optional, default - 'pay'* currency: str, optional, default - 'UAH'* language: str, optional, default - 'uk'template.html```<form action="{{ checkout_form.action }}" method="{{ checkout_form.method }}" target="_blank">{{ checkout_form }}<button type="submit" class="btn btn-success pull-left"><i class="fa fa-credit-card"></i>{% trans 'Pay' %}</button></form>```### RequirementsApp require this packages:* django
Package: django-liquid
A Django template backend forLiquid. Render Liquid
templates in your Django apps.InstallingInstall Django Liquid usingPipenv:$ pipenv install django-liquidOrpip:$ python -m pip install -U django-liquidLinksDocumentation:https://jg-rp.github.io/liquid/guides/django-liquidChange Log:https://github.com/jg-rp/django-liquid/blob/main/CHANGES.rstPyPi:https://pypi.org/project/django-liquid/Source Code:https://github.com/jg-rp/django-liquidIssue Tracker:https://github.com/jg-rp/django-liquid/issuesContributingInstall development dependencies withPipenvFormat code usingblack.Write tests usingunittest.TestCase.Run tests withmake testorpython runtests.py.Check test coverage withmake coverageand openhtmlcov/index.htmlin your
browser.
Package: django-listener
Django ListenerDjango Listener is a Django app that listens to and process webhooks from different providers.InstallationInstall using pippipinstalldjango-listenerUsageAdd'listener'to yourINSTALLED_APPSin settings.py.INSTALLED_APPS = [
    ...
    'listener',
    ...
]Run migrations,python manage.py migrate listenerGo to your admin page and add a newSourceobject.Name: Name of the sourceSlug: Slug of the source(automatically generated, but can be changed)Url: Url of the sourceUsername: Username for basic authentication (if any)Password: Password for basic authentication (if any)Token: Token for authentication (if any)Token Header: Header to be used for token authentication (defaults toHTTP_AUTHORIZATION)Active: Whether the source is active or notUnique ID Field: The field to be used as the unique identifier for the object (defaults toid)HTTP Method: The HTTP method to be used for the webhook (defaults toPOST)Content Type: The content type to be used for the webhook (defaults toapplication/json)Set up your webhook in the source provider to point to the urlhttps://yourdomain.com/listener/webhooks/<source_slug>/where<source_slug>is the slug of the source you created.Example:http://localhost:8080/listener/webhooks/github/Customization (Optional)You can customize your webhook processor by changing the LISTENER setting in your settings.pyLISTENER = {
    "PROCESSOR": {
        "default": "listener.processor.DefaultProcessor",
        "github": "path.to.GithubProcessor",
        "shopify": "path.to.ShopifyProcessor",
    }   
    },
}Your processor should be a function that takes in the following parameters:event: The event objectYour processor classmusthave aprocessmethod.For exampleclass GithubProcessor:
    def process(self, event):
        # Do something with the event
        passContributingPlease feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.LicenseThe MIT License (MIT). Please seeLicense Filefor more information.
Package: django-liststyle
Style your django admin changelist rows with ease!1. Install using pip2. Add liststyle to your settings.py INSTALLED_APPS3. Add to your ModelAdmin classes like this --class MyModelAdmin(admin.ModelAdmin, ListStyleAdminMixin):...def get_row_css(self, obj, index):if obj.active:return 'red red%d' % indexreturn ''Note. If you have your own change_list_results.html; you'll need toincorporate the changes from the one here.
Package: django-list-tests
Add a django management command to list all tests in the projectQuickstartInstall django-list-tests:pip install django-list-testsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_list_tests',...)And run:./manage.py list_tests <app_name>You can use this command for fzf completion of tests:# FZF ALL DAY ERRY DAY
function tz() {
    # cache the test names to speed things up. you can go more complex with
    # watchman or whatever.
    if [[ ! -f '.test_names' ]]; then
        python $DJANGO_MANAGE_SCRIPT list_tests $DJANGO_ROOT_MODULE > ./.test_names
    fi

    TESTS=$( cat .test_names | fzf )

    echo Runnning "$TESTS"
    python "$DJANGO_MANAGE_SCRIPT" "test" --keepdb "$TESTS"
}
Package: django_listview_filters
Django ListView FiltersDescriptionAdd context to list views for sidebar links and modifying querysets with those links.PurposeAttempting to duplicate the functionality of theModelAdminList Filtercapabilities.This is largely a copy-paste of the source code for that modified to work outside of the admin interface. For example, references tomodel_adminhave been removed.Additional FunctionalityA few customizations are added.Add 'Clear Filter' ContextAllow for replacing the 'All' link with a button that clears the parameter from the query.Only List Lookups With MatchesAllow for filtering of list for sidebar to only those with matches. That way empty links aren't taking up valuable space.Add Count to ContextAdd the count of number of objects to each link that can be shown in the template.ConfigurationModelfromdjango.dbimportmodelsclassAuthor(models.Model):name=models.CharField("Author's Name",max_length=100)birthday=models.DateField("Author's Birthday",blank=True)classBook(models.Model):title=models.CharField("Book Title",max_length=150)author=models.ForeignKey(Author,on_delete=models.PROTECT)Class-based Viewfromdjango.view.genericimportListViewfromdjango-listview-filtersimportRelatedFieldListViewFilterclassAuthorListView(ListView):context_object_name="author"queryset=Author.objects.order_by("name")classBookListView(ListView):context_object_name="book"queryset=Author.objects.order_by("title")list_filter=[('author',RelatedFieldListViewFilter)]Template{%forfilter_name,filter_objects,clear_fragmentinfilter_list%}<div>{{filter_name|title}}<ahref="{{ clear_fragment }}">clearfilter</a></div><ul>{%withfilter_objects|dictsort:"display"asdisplay_list%}{%foritemindisplay_list%}<div><ahref="{{ item.query_string }}">{{item.display}}</a></div>{%endfor%}{%endwith%}</ul></div>
Package: django-listview-queryset
Installation$[sudo]pipinstalldjango-listview-querysetProscustomcount()ExamplesListViewQuerySetfromdjango_listview_querysetimportListViewQuerySetclassName(models.Model):objects=ListViewQuerySet.as_manager()q=Name.objects.filter().order_by().setcount(42)ListViewRawQuerySetfromdjango_listview_querysetimportListViewRawQuerySetclassName(models.Model):objects=ListViewRawQuerySet.as_manager()q=Name.objects.raw('select * from table').setcount(42)readme42.com
Package: django-literature
Django LiteratureStreamline the handling of citable literature in your Django web applications.DocumentationThe full documentation is athttps://ssjenny90.github.io/django-literature/AboutDjango Literature is designed to facilitate the management and organization of citable literature within your Django project by providing a set of tools and models that enable you to easily handle literature citations, references, and related metadata in your projects.FeaturesLiterature Models: The package offers pre-built Django models for literature references, authors, journals, and other relevant entities. These models allow developers to store and manage literature-related information in their applications' databases.Integration: Django Literature easily integrates with existing models in a Django project, enabling the association of literature references with other data objects, such as articles, blog posts, or research papers.Efficient Querying: Django Literature provides intuitive query methods that allow developers to retrieve literature references based on various criteria, such as author, title, journal, or publication year. This makes it easy to search and filter the literature database.Citation Generation: The package offers utilities to generate citations in various formats, such as APA, MLA, or Chicago style. This feature simplifies the process of programmatically generating citations for references within the Django application.Admin Interface: Django Literature includes an admin interface that allows authorized users to manage literature references conveniently. The interface provides CRUD (Create, Read, Update, Delete) operations for literature objects and ensures data integrity.QuickstartInstall Django Literature::pip install django-literatureAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'literature',
    ...
)Add Django Literature's URL patterns:urlpatterns = [
    ...
    path('', include("literature.urls")),
    ...
]Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCredits
Package: django-literature-knowledgebase
Django app for creating a knowledge base of curated literatureDocumentationThe full documentation is athttps://django-literature-knowledgebase.readthedocs.io.QuickstartInstall Django Curated Literature Knowledge Base:pip install django-literature-knowledgebaseAdd it to yourINSTALLED_APPS(along with DRF and django-filters):INSTALLED_APPS=(...'rest_framework','django_filters',...'literature_knowledgebase','user_activities',...)Add Django Curated Literature Knowledge Base’s URL patterns:fromliterature_knowledgebaseimporturlsasliterature_knowledgebase_urlsurlpatterns=[...url(r'^',include(literature_knowledgebase_urls,namespace='literature_knowledgebase')),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-12-29)First release on PyPI.Initial models and REST API.0.2.0 (2018-01-05)0.2.0 ChangelogAdded REST API filters.Added URLs to pubmed article and NCBI utils.0.2.1 (2018-01-09)0.2.1 ChangelogFixed issues with migrations0.2.2 (2018-01-12)0.2.2 ChangelogFixed route names for SimpleRouter.0.3.0 (2018-02-09)0.3.0 Changelogupdated requirements to the latest.0.4.0 (2018-04-03)0.4.0 ChangelogAdded support for GraphQL0.5.0 (2018-04-07)0.5.0 ChangelogAdded support for Django 2.0 and Python 3.6Dropped support for Django < 1.11 and Python 2.7, 3.3, 3.40.5.1 (2018-04-18)0.5.1 ChangelogUpdated 3rd party libs0.5.2 (2018-05-16)0.5.2 ChangelogUpdated 3rd party libsUpdated setup.py to read requirements from requirements.txt0.6.0 (2018-06-01)0.6.0 ChangelogDropped support for GraphQL0.6.1 (2018-08-13)0.6.1 ChangelogUpdated 3rd party requirements. Some requirements had changed so it was causing failures0.6.2 (2018-10-29)0.6.2 ChangelogUpdated 3rd party requirements.0.7.0 (2018-12-05)0.7.0 ChangelogAdded attribute to save PDF for an articleAdded REST API to summarize all details from eutils (efetch and esummary) into a single API call0.7.1 (2018-12-05)0.7.1 ChangelogAdded REST API to summarize all details from eutils (efetch and esummary) into a single API call0.7.2 (2019-01-08)0.7.2 ChangelogUpdated 3rd party requirements.0.7.3 (2019-02-08)0.7.3 ChangelogUpdated 3rd party requirements.Refactored tests0.7.4 (2019-04-10)0.7.4 ChangelogUpdated 3rd party requirements.Updated travis to use xenial distribution. Django 2.1 dropped support for SQLite < 3.8.30.7.5 (2019-05-31)0.7.5 ChangelogUpdated package to use latest cookiecutter template0.7.6 (2019-07-26)0.7.6 ChangelogUpdated 3rd party requirements.0.7.7 (2019-08-09)0.7.7 ChangelogUpdated 3rd party requirements.0.7.8 (2019-09-09)0.7.8 ChangelogUpdated 3rd party requirements.