Saravanan666/pypi-org huggingface dataset:
Package: django-pagelets
django-pagelets is a simple, flexible app for integrating static, unstructured content in a Django site.For complete documentation, checkouthttp://django-pagelets.readthedocs.orgFeatures“Pagelets” for adding small pieces of content to otherwise static templatesCMS “pages” which include any number of pagelets and, if needed, attachmentsDifferent pagelet content types including HTML and MarkdownAn integrated WYSIWYG editor (WYMeditor) which can be selectively enabled/disabledRequired DependenciesDjango >= 2.2A Python version supported by your chosen Django versionDjango admin sitedjango-taggit 0.12.1 or greaterdjango-selectable 1.2.1 or greaterThedjango.template.context_processors.requestcontext processorOptional DependenciesjQuery 1.7WYMeditor(included in pagelets media)Installation and Setupdjango-pagelets is available onPyPI, so the easiest way to install it is to usepip:pip install django-pageletsAddpagelets,selectableandtaggitto INSTALLED_APPS in settings.py and run migrate:INSTALLED_APPS = (
    ...,
    'pagelets',
    'selectable',
    'taggit'
    ...
)Make suredjango.template.context_processors.requestis loaded and that you have a template
directory with a “base.html” template in it:TEMPLATES=[
    {
        ...
        'DIRS': ['/home/user/projects/myproject/templates'], # <- should have 'base.html' inside
        ...
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
            ]
        },
    },
],Add the pagelets URLs to urls.py, e.g.:urlpatterns += [
    path('selectable/', include('selectable.urls')),
    path('pagelets-management/', include('pagelets.urls.management')),
    path('/', include('pagelets.urls.content')),
]Visit the admin site, add and save a new page, and click the View on site link.  If everything is setup correctly, you should be able to see and edit the content you just added.Development sponsored byCaktus Consulting Group, LLC..
Package: django-pagemeta
PAGE METAPage meta is a Django package allowing to add meta tags, og tags, images, and descriptions dynamically. Meta tags are stored in models and can be managed through Django admin (or any CMS).Installationpipinstalldjango-pagemetaIn settings fileINSTALLED_APPS=[...'pagemeta',...]MIDDLEWARE=[...'pagemeta.middleware.MetaRequestMiddleware',# for binding meta into the request...]Creating a Meta tagsRun the server.Go to theDjango Admin>Pagemeta>Meta for Pages.Create Meta for pages, use full absolute url inpage_url. Also supports relative url but might varies in different domains.To create default tags for the whole system, usepage_urlasdefaultorDEFAULT(case insensitive)UsageLoad the meta tags in templateIn your template<head>
    ...
    {{ request.meta }}
    ...
</head>Page titles are not rendered throughrequest.meta. To render page title see the below example....
<title>{{ request.meta.title }}</title>
...For conditional titlesrequest.meta_exactwill be good.request.meta_exactcontains the exact meta tags for the url orNone. Whereasrequest.metacontains default value if no match found....
<title>{{ request.meta_exact.title|default:'Default title' }}</title>
...OR...
<title>{% if request.meta_exact %}{{ request.meta_exact.title }}{% else %}Title for {{ article }}{% endif %}</title>
...Set a Custom Meta tagsIf you want to set a custom meta tags for specific pages or conditions, you can reassign request.meta with an instance ofMeta.Note: context variable can be overridden if MetaForPage for that url existsExample code:classMyView(TemplateView):...defget_context_data(self,**kwargs):...# adding custom metaself.request.meta=Meta(title='custom test',description='custom description',image_url='http://image_url_dot_com',)...ContributionInstall requirementsCreate your virtualenv first.pipinstall-rrequirements.txtRunning test casespython manage.py test
Package: django-pagemore
KISS approach to a “Load more” style AJAX paginatorRequirementsDjango 1.3+jQueryFeaturesNon-intrusive: your Django view is completely unaware of dynamic
load-more stuff going on.There is literally no code (no Python, no Javascript) required to
get a fully AJAX style “load more” going.KISSQuickstartWrite your view as usual, handing over an (unpaginated) list of
items to a template.Render the list of items in your template as follows:{% load pagemore %}
{% more_paginator items per_page=10 ordered_by="-created_at" as paginator %}

{% for item in paginator.objects %}
{% if forloop.first %}
<div class="pagemore-container">
{% endif %}
{{item}}
{% if forloop.last %}
</div>
{% if paginator.has_more %}
<a class="pagemore-paginator" href="?{{paginator.next_query}}">More items...</a>
{% endif %}
{% endif %}
{% endfor %}

<script type="text/javascript" src="{{STATIC_URL}}pagemore/js/pagemore.js"></script>
<script type="text/javascript">
    $(function() { $(".pagemore-paginator").pagemore(); });
</script>That’s all!Pagination StrategiesWhen a user is paginating through a list of items, while at the same
time new items are being inserted, offset based slicing would result
in duplicate items being shown.  A way to circumvent this is to make
sure that the items are properly ordered and to filter on items after
a certain point. Both strategies are supported.Paginate by SlicingUsage:{% more_paginator ... strategy="slice" ... %}Characteristics:Supports both querysets and listsDoes not order the objects unless explicitly told to (ordered_by).Paginate by FilteringUsage:{% more_paginator ... strategy="filter" ... %}Characteristics:Only supports querysetsEnforces an ordering of the objects passed (default onid, overridable
byordered_by).
Package: django-pages-cms
Simple content management system for Django 1.8+django-pages-cmsis a simple content management system for Django 1.8+RequirementsDjango>=1.8,<1.10
django-appcore>=0.0.9
django-mptt>=0.8.6
django-guardian>=1.4.6
django-markitup>=2.3.1
python-slugify>=1.2.1
PyYAML>=3.12
Markdown>=2.6.7UsageYou can find detailed documentation in the “docs” directory.
Package: django-pages-cms-extensions
Extensions for django-pages-cms applicationdjango-pages-cms-extensionsis a extensions for django-pages-cms applicationRequirementsdjango-pages-cms>=0.2.8
django-image-cropping>=1.0.4
django-taggit>=0.21.3
django-embed-video>=1.1.0
easy_thumbnails>=2.3UsageYou can find detailed documentation in the “docs” directory.
Package: django-pagetree-epub
[![Build Status](https://travis-ci.org/ccnmtl/django-pagetree-epub.png?branch=master)](https://travis-ci.org/ccnmtl/django-pagetree-epub)[![Coverage Status](https://coveralls.io/repos/github/ccnmtl/django-pagetree-epub/badge.svg?branch=master)](https://coveralls.io/github/ccnmtl/django-pagetree-epub?branch=master)epub export library for django-pagetree## Installation```$ pip install django-pagetree-epub```Add `pagetreeepub` to your `INSTALLED_APPS`.The `epubbuilder` library uses Genshi templates for a few things andis unaware of Django's template finding functionality. I really hatethis and will be ripping that out and fixing this ASAP. In themeantime, you have two options:1) copy the `pagetreeepub/templates/epub` directory into your app andpoint `EPUB_TEMPLATE_DIRECTORY` at it.2) ensure that you pip install to a known location and set`EPUB_TEMPLATE_DIRECTORY` to that.Add the following settings:* `EPUB_ALLOWED_BLOCKS` - list of pageblocks that will be allowed inthe published epub. Other blocks are silently ignored.* `EPUB_TITLE` - title for the epub* `EPUB_CREATOR` - creator field* `EPUB_PUBLICATION` - publication date
Package: django-page-visibility
DEPRECATED. This approach causes more headaches than it's worth.django_page_visibilityThis package implements a standard protocol allowing developers to ask "can user X currently access page Y?".Rather than duplicating the permission checks performed in that view, you ask the view itself whether or not the user can access it.Conforming ViewsConforming views must implement a.test_page_visibilty(request, *args, **kwargs)method. This will be called with the sameargsandkwargsthat the actual view would be called with.This method must return a truthy value if the user can access the page, and False otherwise. It may also raise an exception, to indicate that the user cannot access the page. SeePAGE_VISIBILITY_EXCEPTIONSbelow.The Test FunctionDevelopers can calldjango_page_visibility.is_visible_to_user(path, user)(see the code for details) to test visibility. Or, in a template, you can use ouris_permitted_to_seefilter orpermitted_linktag.PAGE_VISIBILITY_EXCEPTIONSsettingBy default, we returnFalseif eitherdjango.http.Http404ordjango.core.exceptions.PermissionDeniedare raised. You can override this by setting (in your django settings)PAGE_VISIBILITY_EXCEPTIONSto a list of exception classes.We expect most users to override this setting. For example, if you are usingexceptional_authanddjango_early_return, then you'll want to set:PAGE_VISIBILITY_EXCEPTIONS=['django.core.exceptions.PermissionDenied','django.http.Http404','django_early_return.EarlyReturn','exceptional_auth.AuthException',]
Package: django-paginated
django-paginated================Installation------------```pip install django-paginated```and add `paginated` to project's `INSTALLED_APPS`Example-------To add pagination just change from:```pythondef events(request):events = Event.objects.all()context = {'events': events,}return render_to_response(request, 'events.html', context)```to```pythondef events(request):events, pagination = paginated(Event.objects.all(), request)context = {'events': events,'pagination': pagination,}return render_to_response(request, 'events.html', context)```and in template add line:```{{ pagination|safe }}```
Package: django-paginated-modelformset
An attempt to add pagination to Django Model Formsets.RequirementsPython 2.6+ or Python 3Django 1.6+InstallationInstall from PyPIpip install django-paginated-modelformsetUsagefrom django.forms.models import modelformset_factory
from paginated_modelformset import PaginatedModelFormSet
from myapp.models import MyModel

MyModelFormSet = modelformset_factory(MyModel, formset=PaginatedModelFormSet)

# In addition to standard arguments, provide a number of items per page and a page number.
formset = MyModelFormSet(per_page=25, page_num=1)PaginatedModelFormSet uses the samePaginatorclass that is used for standard pagination. APageobject is accessible as a page attribute of the formset and you can use it in templates like this:<div class="pagination">
    <span class="step-links">
        {% if formset.page.has_previous %}
            <a href="?page={{ formset.page.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ formset.page.number }} of {{ formset.page.paginator.num_pages }}.
        </span>

        {% if formset.page.has_next %}
            <a href="?page={{ formset.page.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>AlternativesSee thisStackOverflow questionfor an alternative solution.
Package: django-paginated-urls
Helpers for returning users to the correct page of a view using pagination.Note: this is work in-progress that hasn’t been battle-tested (yet). Use at your own risk.DocumentationThe full documentation is athttps://django-paginated-urls.readthedocs.org.QuickstartInstall django-paginated-urls:pip install django-paginated-urlsThen use it in a project:import paginated_urlsFeaturesTODOCookiecutter Tools Used in Making This Packagecookiecuttercookiecutter-djangopackageHistory0.1.0 (2015-09-08)First release on PyPI.
Package: django-pagination
How to use django-paginationdjango-paginationallows for easy Digg-style pagination without modifying
your views.There are really 5 steps to setting it up with your projects (not including
installation, which is covered in INSTALL.txt in this same directory.)List this application in theINSTALLED_APPSportion of your settings
file.  Your settings file might look something like:INSTALLED_APPS = (
    # ...
    'pagination',
)Install the pagination middleware.  Your settings file might look something
like:MIDDLEWARE_CLASSES = (
    # ...
    'pagination.middleware.PaginationMiddleware',
)If it’s not already added in your setup, add the request context processor.
Note that context processors are set by default implicitly, so to set them
explicitly, you need to copy and paste this code into your under
the value TEMPLATE_CONTEXT_PROCESSORS:("django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request")Add this line at the top of your template to load the pagination tags:{% load pagination_tags %}Decide on a variable that you would like to paginate, and use the
autopaginate tag on that variable before iterating over it.  This could
take one of two forms (using the canonicalobject_listas an example
variable):{% autopaginate object_list %}This assumes that you would like to have the default 20 results per page.
If you would like to specify your own amount of results per page, you can
specify that like so:{% autopaginate object_list 10 %}Note that this replacesobject_listwith the list for the current page, so
you can iterate over theobject_listlike you normally would.Now you want to display the current page and the available pages, so
somewhere after having used autopaginate, use the paginate inclusion tag:{% paginate %}This does not take any arguments, but does assume that you have already
called autopaginate, so make sure to do so first.That’s it!  You have now paginatedobject_listand given users of the site
a way to navigate between the different pages–all without touching your views.Optional SettingsIn django-pagination, there are no required settings.  There are, however, a
small set of optional settings useful for changing the default behavior of the
pagination tags.  Here’s an overview:PAGINATION_DEFAULT_PAGINATIONThe default amount of items to show on a page if no number is specified.PAGINATION_DEFAULT_WINDOWThe number of items to the left and to the right of the current page to
display (accounting for ellipses).PAGINATION_DEFAULT_ORPHANSThe number of orphans allowed.  According to the Django documentation,
orphans are defined as:The minimum number of items allowed on the last page, defaults to zero.PAGINATION_INVALID_PAGE_RAISES_404Determines whether an invalid page raises anHttp404or just sets theinvalid_pagecontext variable.Truedoes the former andFalsedoes the latter.
Package: django-pagination-fork
How to use django-paginationdjango-paginationallows for easy Digg-style pagination without modifying
your views.There are really 5 steps to setting it up with your projects (not including
installation, which is covered in INSTALL.txt in this same directory.)List this application in theINSTALLED_APPSportion of your settings
file.  Your settings file might look something like:INSTALLED_APPS = (
    # ...
    'pagination',
)Install the pagination middleware.  Your settings file might look something
like:MIDDLEWARE_CLASSES = (
    # ...
    'pagination.middleware.PaginationMiddleware',
)If it’s not already added in your setup, add the request context processor.
Note that context processors are set by default implicitly, so to set them
explicitly, you need to copy and paste this code into your under
the value TEMPLATE_CONTEXT_PROCESSORS:("django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request")Add this line at the top of your template to load the pagination tags:{% load pagination_tags %}Decide on a variable that you would like to paginate, and use the
autopaginate tag on that variable before iterating over it.  This could
take one of two forms (using the canonicalobject_listas an example
variable):{% autopaginate object_list %}This assumes that you would like to have the default 20 results per page.
If you would like to specify your own amount of results per page, you can
specify that like so:{% autopaginate object_list 10 %}Note that this replacesobject_listwith the list for the current page, so
you can iterate over theobject_listlike you normally would.Now you want to display the current page and the available pages, so
somewhere after having used autopaginate, use the paginate inclusion tag:{% paginate %}This does not take any arguments, but does assume that you have already
called autopaginate, so make sure to do so first.That’s it!  You have now paginatedobject_listand given users of the site
a way to navigate between the different pages–all without touching your views.Optional SettingsIn django-pagination, there are no required settings.  There are, however, a
small set of optional settings useful for changing the default behavior of the
pagination tags.  Here’s an overview:PAGINATION_DEFAULT_PAGINATIONThe default amount of items to show on a page if no number is specified.PAGINATION_DEFAULT_WINDOWThe number of items to the left and to the right of the current page to
display (accounting for ellipses).PAGINATION_DEFAULT_ORPHANSThe number of orphans allowed.  According to the Django documentation,
orphans are defined as:The minimum number of items allowed on the last page, defaults to zero.PAGINATION_INVALID_PAGE_RAISES_404Determines whether an invalid page raises anHttp404or just sets theinvalid_pagecontext variable.Truedoes the former andFalsedoes the latter.
Package: django-paginationlinks
Small package for creating a list of page links from a Django paginator object,
similar in style to the Django admin - showing the start and end pages, but
only showing a limited list of pages in the middle.InstallationUsingpip:$pipinstalldjango-paginationlinksEdit your Django project’s settings module, and addpaginationlinks:INSTALLED_APPS=[# ...'paginationlinks',]UsageLoad the template tag:{% load pagination_links %}Typical usage, which shows 1 page on each end, and 1 on each side of the current page:{% get_pagination_links paginator page_obj as pagination_links %}However the number of pages on each side can be customised, as well as how many pages at the end -
both are optional arguments:{% get_pagination_links paginator page_obj on_each_side=1 on_ends=2 as pagination_links %}A more fully featured example for a site:{% load pagination_links %}

{% if page_obj.has_other_pages %}
    {% get_pagination_links paginator page_obj as pagination_links %}
    <ul>
        {% for page_num in pagination_links %}
            {% if page_num.is_current %}
                <li class="current">{{ page_num.number }}</li>
            {% elif page_num.is_filler %}
                <li class="filler">—</li>
            {% else %}
                <li><a href="?page={{ page_num.number }}">{{ page_num.number }}</a></li>
            {% endif %}
        {% endfor %}
    </ul>
{% endif %}
Package: django-pagination-py3
django-pagination-py3A port ofericflo/django-paginationto Python 3. Updated to be compatible with Django 4.x and 5.0.For versions compatible with Django 3.x and Python 2.7+ please install or download version1.2.0fromReleasesorPypi.FeaturesReally easy to use at template level.It preserves all request's querystring parameters.Settings to customize behavior.Translated to fr, de, es, pt, pl and pt_BR.A fully working example project.InstallationInstall usingpipcommand:pipinstalldjango-pagination-py3...or clone the repo and install it usingpip:gitclonegit://github.com/matagus/django-pagination-py3.gitcddjango-pagination-py3
pipinstall-e.AddpaginationINSTALLED_APPS to yoursettings.py:INSTALLED_APPS=(# ..."pagination",)Add the middleware:MIDDLEWARE_CLASSES=(# ...'pagination.middleware.PaginationMiddleware',)Add this line at the top of your template to load the pagination tags:{% load pagination_tags %}Decide on a variable that you would like to paginate, and use the autopaginate tag on that variable before iterating
over it. This could take one of two forms (using the canonicalobject_listas an example variable):{% autopaginate object_list %}This assumes that you would like to have the default 20 results per page. If you would like to specify your own amount
of results per page, you can specify that like so:{% autopaginate object_list 10 %}Note that this replacesobject_listwith the list for the current page, so you can iterate over theobject_listlike you normally would.Now you want to display the current page and the available pages, so somewhere after having used autopaginate, use the
paginate inclusion tag:{% paginate %}This does not take any arguments, but does assume that you have already called autopaginate, so make sure to do so first.That's it! You have now paginatedobject_listand given users of the site a way to navigate between the different
pages--all without touching your views.Running Testshatch run test:testwill run the tests in every Python + Django versions combination.hatch run test.py3.12-5.0:test: will run them for python 3.12 and Django 5.0. Please see possible combinations usinghatch env show("test" matrix).Licensedjango-pagination-py3is released under an BSD License - see theLICENSEfile for more information.AcknowledgementsDevelop & built usingPosts I learned from:Switching to HatchAutomate Hatch Publish with GitHub Actions
Package: django-paginator2
Simple Django PaginatorInstallationpip install django-paginator2UsageIn [1]: from paginator import pagination

In [2]: pagination(range(100), 1)
Out[2]: ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1)

In [3]: pagination(range(100), 1, strict=True)
Out[3]: ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 90)

In [4]: pagination(range(100), 1, 20, strict=True)
Out[4]: ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], 80)
Package: django-paging
A simple and efficient paginator.Jinja2Jinja2 is supported via Coffin:{% with paginate(request, my_queryset) as results %}
  {{ results.paging }}
  {% for result in results.objects %}
    {{ result }}
  {% endfor %}
  {{ results.paging }}
{% endwith %}DjangoDjango templatetags require django-templatetag-sugar:{% load paging_extras %}

{% paginate my_queryset from request as results %}
{{ results.paging }}
{% for result in results.objects %}
  {{ result }}
{% endfor %}
{{ results.paging }}