Saravanan666/pypi-org huggingface dataset:
Package: django-like-button
django-like-button makes it easy to use a facebook like button in your django application. You just need to do the following.DocumentationDocumentation can now be found in ReadTheDocs here:https://readthedocs.org/projects/django-like-button/InstallationInstall django-like-button using easy_setup or pip:pip install django-like-buttonadd like_button to your INSTALLED_APPS in your django settings file:INSTALLED_APPS = (
    # all
    # other
    # apps
    'like_button',
)Add “FACEBOOK_APP_ID” setting to your django settings file with your facebook application Id.in settings.py:FACEBOOK_APP_ID = "your appID"
FACEBOOK_SHOW_SEND = "true"   # or "false, default is "true"
FACEBOOK_LIKE_WIDTH = "450"   # "numeric value for width", default is 450
FACEBOOK_SHOW_FACES = "true"  # or "false, default is "true"
FACEBOOK_FONT = "font"        # default is "arial"Add the template tag code into your base template before the body tag.In the template, in which you want to add button load tags:{% load like_button %}Where you need the like button:{% like_button_tag %}At the bottom of the page before the </body> tag put this (you only need to do this once):{% like_button_js_tag %}5. Add the url into your urls file.  This tries to address the issue identified
with facebooks like button here:http://stackoverflow.com/questions/2955012/facebook-javascript-sdk-fb-xd-fragmentin urls.py:url(r'', include('like_button.urls')),
Package: django-likeit
A simple app for Django that enables users to like and unlike any
object/item within any model. It’s developed on Python 3.5 & Python 3.6
for Django 1.10 and later.InstallationInstall django-likeit in your vilrtual env:pip install django-likeitAdd the app to your settings.pyINSTALLED_APPS=[..."like",...]Add likeit urls to your project’surls.pyfile:fromdjango.conf.urlsimporturl,includeurlpatterns=[...url(r'^like/',include('like.urls')),...]Migrations:python manage.py makemigrations like
python manage.py migrateMake sure you have jQuery ajax CSRF configuration right, and also you
included Font Awesome in your HTML.Usage:Template tags:Get the liked objects for a given user:{%withuser_likes<user>"app_label.model"aslike_list%}{%forlike_objinlike_list%}{# do something with like_obj #}{%endfor%}{%endwith%}Given an objectobjyou may show it like count like this:<p>LikeCount{{obj|likes_count}}</p>Get Like instance for an object (obj) and a user (user){%withobj|get_like_for:useraslike_object%}...{%endwith%}Like Button for an objectmy_obj:{%like_buttonmy_obj%}Likes ManagerCreate a Like instance for a user and object:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>song=Song.objects.get(pk=1)>>>like=Like.objects.create(user,song)or:>>>like=Like.objects.create(user,1,Song)or:>>>like=Like.objects.create(user,1,"music.Song")Get the objects liked by a given user:>>>fromdjango.contrib.auth.modelsimportUser>>>user=User.objects.get(username='jdoe')>>>Like.objects.for_user(user)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Now, get user liked objects belonging to a given model:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>Like.objects.for_user(user,model=Song)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Get the liked object instances of a given model liked by any user:>>>frommusic.modelsimportSong>>>Like.objects.for_model(Song)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Get a Like instance for a given object and user:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>song=Song.objects.get(pk=1)>>>like=Like.objects.get_like(user,song)Get all Like instances for a given object>>>frommusic.modelsimportSong>>>song=Song.objects.get(pk=1)>>>like=Like.objects.for_object(song)
Package: django-likeit-ptbr
django-likeit-ptbrA simple app for Django that enables users to like and unlike any object/item within any model.
It's developed on Python 3.5 & Python 3.6 for Django 2.0 and later. Adjustments made from original django-likeitInstallationInstall django-likeit in your vilrtual env:pip install django-likeit-ptbrAdd the app to your settings.pyINSTALLED_APPS=[..."like",...]Add likeit urls to your project'surls.pyfile:fromdjango.conf.urlsimporturl,includeurlpatterns=[...url(r'^like/',include('like.urls')),...]Migrations:python manage.py makemigrations like
python manage.py migrateMake sure you have jQuery ajax CSRF configuration right, and also you included Font Awesome in your HTML.Usage:Template tags:Get the liked objects for a given user:{%withuser_likes<user>"app_label.model"aslike_list%}{%forlike_objinlike_list%}{# do something with like_obj #}{%endfor%}{%endwith%}Given an objectobjyou may show it like count like this:<p>LikeCount{{obj|likes_count}}</p>Get Like instance for an object (obj) and a user (user){%withobj|get_like_for:useraslike_object%}...{%endwith%}Like Button for an objectmy_obj:{%like_buttonmy_obj%}Likes ManagerCreate a Like instance for a user and object:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>song=Song.objects.get(pk=1)>>>like=Like.objects.create(user,song)or:>>>like=Like.objects.create(user,1,Song)or:>>>like=Like.objects.create(user,1,"music.Song")Get the objects liked by a given user:>>>fromdjango.contrib.auth.modelsimportUser>>>user=User.objects.get(username='jdoe')>>>Like.objects.for_user(user)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Now, get user liked objects belonging to a given model:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>Like.objects.for_user(user,model=Song)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Get the liked object instances of a given model liked by any user:>>>frommusic.modelsimportSong>>>Like.objects.for_model(Song)>>>[<Like:Likeobject1>,<Like:Likeobject2>,<Like:Likeobject3>]Get a Like instance for a given object and user:>>>fromdjango.contrib.auth.modelsimportUser>>>frommusic.modelsimportSong>>>user=User.objects.get(username='jdoe')>>>song=Song.objects.get(pk=1)>>>like=Like.objects.get_like(user,song)Get all Like instances for a given object>>>frommusic.modelsimportSong>>>song=Song.objects.get(pk=1)>>>like=Like.objects.for_object(song)
Package: django-like-lookup
PostgreSQL LIKE lookup functionality for Django. Django does contain __startswith, __endswith and __contains lookups, but all of them does escape “%” and “_” wildcard characters. The__likelookup is often faster, than the__regexlookup, so it can be used in cases when conditions are simple enough.DocumentationThe full documentation is athttps://django-like-lookup.readthedocs.io.QuickstartInstall Django like lookup:pip install django-like-lookupAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'like_lookup',...)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2020-01-29)First release on PyPI.
Package: django-like-systems
django-like-systemAn easy way to add feedback "like/dislike"  to any of your models.RequirementsDjango 2.2+jQueryInstallationpip install django-like-systemUsageAdd 'django-like-system' to your INSTALLED_APPS:INSTALLED_APPS = (
...
'django-like-system',
...
)You must add LIKES_OBJS_DICT dictionary to your settings.py file. The keys in this dictionary - are the path to your model, value - list with class name:LIKES_OBJS_DICT = {'example.models': ['Test', 'Test2'],
                   'example1.models': ['Test3']}Your models to which you want to attach as feedback 'like/dislike'
should inherit class LikesTarget:from like_system.models import LikesTarget

# Create your models here.

class Test(LikesTarget):
    headline = models.CharField(max_length=500)

class Test1(LikesTarget):
  headline1 = models.CharField(max_length=500)Add jQuery and app.js in your html template:<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="{% static 'like_system.js' %}"></script>Your buttons like and dislike should have class css class 'like' and 'dislike'.
Like and dislike counters should have class 'likecount' and 'dislikecount'.
For live mapping, wrap the entire construction in a div
with css class 'likesystem':{% for obj in my_list %}
<div class='likesystem'>
  <p>{{obj.headline}}-{{obj.likesystem.total}}</p>
  <span class='likes' data-id={{obj.id}} data-type='test'>like</span>
  <span class='countlikes'>{{obj.likesystem.likes.count}}</span>      
  <span class='dislikes' data-id={{obj.id}} data-type='test'>dislike</span>
  <span class='countdislikes'>{{obj.likesystem.dislikes.count}}</span>
</div>
{% endfor%}
Package: django-lime
AS OF 2015-01-01 THIS PACKAGE IS NO LONGER SUPPORTED!Easy sending of mixed content (html + plain) emails for Django.PrerequisitesDjango 1.5.+Python 2.7.+, 3.3.+InstallationInstall in your virtual environment:$ pip install django-limeAddlimeto yourINSTALLED_APPSof your Djangosettingsmodule:>>> INSTALLED_APPS = (
>>>     # ...
>>>     'lime',
>>>     # ...
>>> )
>>>
>>> LIME_SITE_LOGO = 'img/logo.png' # Relative path to logo
>>> LIME_SITE_TEAM = ugettext("Example site team") # Team name (see the base email template)Copy the templates fromlimeto your main templates directory.DefineLIME_SITE_LOGOandLIME_SITE_TEAMvariables in yoursettingsmodule.Make sure yourdjango.contrib.sites.models.Sitehas data that makes sense, assite_nameanddomainvalues will be taken from there. Alternatively, you can define (override) those by defining the
following variables in yoursettingsmodule.LIME_SITE_NAMELIME_SITE_DOMAINUsage examplesInherit your app templates from lime base templates or your own copy of the lime templates (copied totemplatesdirectory). By default the following parameters are passed to your template:site_name: Taken from yourdjango.contrib.sites.models.Site.domain: Taken from yourdjango.contrib.sites.models.Sitesite_team: Site team name.site_logo: Relative URL to site logo.Sending of a mixed content e-mail is as simple as follows.subject(str): E-mail subject.from_email(str): From e-mail.to(str or list): E-mail or a list of e-mails to send the e-mail to.context(dict): Variables you want to have accessible in your e-mail templates.plain_template(str): Plain template name.html_template(str): HTML template name.bcc(str or list): E-mail or a list of e-mails to send the e-mail to (as BCC).>>> from lime import send_email
>>>
>>> send_email(
>>>     subject = _("You've got mail"),
>>>     from_email = 'ramzes.4@example.come', # From
>>>     to = 'someone.else@example.com', # To
>>>     context = {
>>>         'date_submitted': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S"),
>>>         'url': 'http://example.com/check-this-fantastic-link.html',
>>>         'full_name': 'John Doe',
>>>         'from_name': 'Ramzes the 4th',
>>>     },
>>>     plain_template = 'foo/emails/foo_test.txt', # Text template
>>>     html_template = 'foo/emails/foo_test.html' # HTML tempalte
>>> )Running example projectFor a working example (including set-up Django environment) check thehttps://bitbucket.org/barseghyanartur/django-lime(exampledirectory).Go to example/example directory$ cd example/exampleInstall requirements (in your virtual environment)$ pip install -r requirements.txtCopy local_settings.example to local_settings.py$ cp local_settings.example local_settings.pyCreate the database$ ./manage.py syncdbRun the project$ ./manage.py runserverLicenseGPL 2.0/LGPL 2.1SupportFor any issues contact me at the e-mail given in theAuthorsection.AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: django_limiter
Django Limiter is a Signed Cookie based RPS (Requests per second) limiter.How it works?If a user (or a parser) visits your site first time, he redirected to the special page and
receives an signed cookie with current timestamp. On this page he will be redirected by JavaScript to the URL
he requested before.If a user visits your site with Limiter’s cookie, Limiter checks the cookie and if the last request had little time,
Limiter throws HTTP Response with 429 status code (Too Many Requests)Otherwise nothing will happen.Client can’t properly change Limiter’s cookie and abuse (read more about signing here:https://docs.djangoproject.com/en/dev/topics/signing/)InstallationInstall from PyPI:$ pip install django_limiterAppend'django_limiter'to yourINSTALLED_APPS:INSTALLED_APPS=[# your apps'django_limiter',]Insert'django_limiter.middleware.RateLimiter'BEFOREany other middleware intoMIDDLEWAREsetting (orMIDDLEWARE_CLASSES):MIDDLEWARE=['django_limiter.middleware.RateLimiter',# Another middlewares]Addurl(r'^limiter/',include(django_limiter.urls))to your url config:importdjango_limiterurlpatterns=[url(r'^admin/',admin.site.urls),# Another url patternsurl(r'^limiter/',include(django_limiter.urls)),]ConfigurationHere is several settings you can set:LIMITER_COOKIE_NAME— The name of the cookie. Default:‘limiter’LIMITER_INTERVAL— The time (in seconds, can be float) client must wait before he can send next request. Default:0.333LIMITER_TEMPLATE_NAME— The name of the template for page to which the client gets temporarily. This page should redirect client to requested page afterLIMITER_INTERVALseconds pass. Template receives'timeout','path'and'request'context.LIMITER_EXCEPT— List of URLs Limiter must except. You shouldn’t add root ('/') into this list. Default:[]LIMITER_EXCEPT=['/my/custom/path',reverse_lazy('or-lazy-reverse')]
Package: django-lineage
Handling which navigation element is active in a particular template can become
annoying. Template blocks can be defined and later overriden to “activate” a
class on a particular navigational element,but thats gets ugly!Lineage makes things neaterby defining your conditions centrally, and it
looks like this:{% load lineage %}

<ul>
    <li class="{% ancestor '/home/' %}"><a href="/home/">Home</a></li>
    <li class="{% ancestor '/blog/' %}"><a href="/blog/">Blog</a></li>
    <li class="{% ancestor '/about/' %}"><a href="/about/">About</a></li>
</ul>When anancestortag is evaludated, it compares it’s argument to the page URL.
If the argument string matches the start of the current pages URL, it outputs
“active”.It’s that simple!Read on for accepted arguments:InstallationInstall using pip:pip install django-lineageAdd'lineage'toINSTALLED_APPSinsettings.py:INSTALLED_APPS = (
    'lineage',
)UsageTheancestortag needs to, of course, be loaded into your template:{% load lineage %}The simplest way to use Lineage is the aformentionedancestortag. Again if
the argument matches the start of the page URL it outputs “active”, this should
handle most use cases:{% ancestor '/arbitrary/path/' %}But wait…ancestorcan also handle variables, filters and all that stuff:{% ancestor some_variable|somefilter %}Or even full blownurltag type reverse resolution (Behind the scenes theurltag derives our expected argument - a URL path string.){% ancestor ‘core:model_detail’ model.pk %}Active?By defaultancestoroutputs “active” if it’s argument matches the start of
the page URL. You can globally set the output of theancestortag by addingLINEAGE_ANCESTOR_PHRASE = 'newphrase'tosettings.pyAdvancedIf fine-grain control is what your after, you’ll be looking for theifancestor/endifancestorcombo:{% ifancestor 'pattern_name' %}
    This text here is only renderd if the
    URL argument is an ancestor.
{% endifancestor %}It accepts the same exact arguments asancestor, but allows you to define,
on a per definition basis, what the output will be.AssumptionsLineage depends on sensible URL hierarchies, because it compares paths using
regex matching. The{% ifancestor '/base/' %}block will be true if the
current URL begins with that URL. For example/base/and/base/section/page/return true, but/other/path/and/base(missing trailing slash) will not.requestmust be present in the request context, since it’s used to determine
the current URL. Django hasa context preprocessorthat can insert it for
you.
Package: django-link
Django LinkModeled link objects which include linking to objects, views and static urls.ContentsDjango LinkInstallationUsageLicenseAuthorsChangelog2.0.00.1.10.1.0InstallationInstall or adddjango-linkto your Python path.Addlinkto yourINSTALLED_APPSsetting.Addurl(r'^link/',include("link.urls",namespace="link"))to yoururl patterns(only required if you intend on using the list/detail views)Note:django-linkrelies on"django.contrib.contenttypes"framework so
this will need to be included in yourINSTALLED_APPSsetting.Usagedjango-linkprovides a model to add links to your projects. It provides aget_absolute_urlmethod on the model which provides the url to either of these url types:Standard url string.Link to anobjectprovided by the contenttype framework.Link to a pre-existing view with configurable view params.To use include the link object in the context of your view and include the following code:{{ link.get_absolute_url  }}Or use the inclusion tag which has been provided:{% render_link slug %}To exclude certain apps from the view name choice field add the namespace in your settings:LINK ={"excluded-viewname-choices":["admin"]}LicensePlease see the License requirements in the LICENSE file of this repository.AuthorsPraekelt ConsultingJonathan BydendykChangelog2.0.0Add missing migrations.String representation for Python 3.Django 2 compatibility.0.1.1Django 1.11 support.0.1.0Initial release.
Package: django-linkedin-middleware
Django LinkedIn MiddlewareConnect to the LinkedIn API.Installation$pipinstalldjango-linkedin-middlewareJust adddjango-linkedin-middleware.middleware.LinkedinMiddlewareto yourMIDDLEWARE.UsageIn the request session will be found 3 differents label :linkedin_firstNamefor the user first namelinkedin_lastNamefor the user last namelinkedin_headlinefor the user headlineIn your HTML, you can directly add these label to display the data.SettingsLinkedin ConfigurationYou need to create an application on the linkedin developer pages tohttps://www.linkedin.com/developer/appsto receive your credentialsLINKEDIN_APPLICATION_KEY: the Client IDLINKEDIN_APPLICATION_SECRET: the Client SecretLINKEDIN_APPLICATION_RETURN_CALLBACK: the callback url (you should add the same url in the linkedin developer page)LINKEDIN_APPLICATION_PROFILE: a table of different application permissions. Here's a list of the permissions :['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share']. You could also add the permissionApplication ConfigurationPAGES_WITH_LINKEDIN_AUTH_REQUIRED: the list of all pages on which you should force an authentication. By default, it will be all the pages (example :['*'])PAGES_WITHOUT_LINKEDIN_AUTH_REQUIRED: the list of all pages on which the authentication is disable.ThanksI only made a middleware for simply connect to linkedin and display information in the session.
I based my work on thepython-linkedinproject.
Package: django-linkedin-posts
django-linkedin-postsSet upGet your Linkedin Access Tokenhttps://www.linkedin.com/developers/tools/oauth/token-generatorInstall from PyPIpython -m pip install django-linkedin-postsAdd the package to your settings INSTALLED_APPSINSTALLED_APPS=[..."django_linkedin_posts",...]Add the following setting variables## thid-party apps# django-linkedin-posts (our app)importosfromdotenvimportload_dotenv# python-dotenvload_dotenv()LINKEDIN_AUTHOR_TPYE="organization"# "organization" or "person"LINKEDIN_AUTHOR_ID=os.environ.get("LINKEDIN_AUTHOR_ID")LINKEDIN_ACCESS_TOKEN=os.environ.get("LINKEDIN_ACCESS_TOKEN")## The following keys are not needed at the moment## But they are planned to be used.## For example for updating the Access Token using the Refresh Token# LINKEDIN_CLIENT_ID = os.environ.get("LINKEDIN_CLIENT_ID")# LINKEDIN_CLIENT_SECRET = os.environ.get("LINKEDIN_CLIENT_SECRET")# LINKEDIN_REFRESH_TOKEN = os.environ.get("LINKEDIN_REFRESH_TOKEN")UsageCreate a simple Postfromdjango_linkedin_posts.modelsimportPost# create a post instance in the dbpost=Post.objects.create(comment="Hi, this is me publishing a post using django-linkedin-posts")# share it in Linkedinpost.share()Create a poll with optionsfromdjango_linkedin_posts.modelsimportcreate_poll_with_options# create a poll with its options.p=create_poll_with_options("hello","What's up?",["good","bad"])# share itp.share()
Package: django-linklist
Django app to render a list of links with meta information and screenshots.Please note that this repo contains the same code as cmsplugin-linklist.
We will remove the Link-model related code from that repo soon so that the
cmsplugin repo only contains the cmsplugin relevant code.PrerequisitesYou need at least the following packages in your virtualenv:Django 1.4SouthFilerPillow or PILEasy ThumbnailsInstallationTo get the latest stable release from PyPi:$ pip install django-linklist (not available at the moment)To get the latest commit from GitHub:$ pip install -e git://github.com/bitmazk/django-linklist.git#egg=linklistAdd the app to yourINSTALLED_APPS:INSTALLED_APPS = [
    ...
    'django',
    'filer',
    'easy_thumbnails',
    'linklist',
]Run the south migrations to create the app’s database tables:$ ./manage.py migrate linklistUsageAdd links to your project via the Django admin.Templatetagsget_linklistReturns a number of links:{% load linklist_tags %}
{% get_linklist 8 as linklist %}
{% for link in linklist %}
    // YOur HTML markup
{% endfor %}If you are using theLinkCategorymodel, you can get the links for a
cateogry like so:{% get_linklist 8 categories='slug' as linklist %}If you want to show links for several categories in one list:{% get_linklist 8 categories='foo,bar' as linklist %}RoadmapSee the issue tracker for current and upcoming features.
Package: django_linksets
## About LinksetsLinksets was originally built as a Django module to administer navigation menus with multiple levels inside templates, but it can also be used for simpler footer linksets, social media linksets, or anywhere you need an administrable list of links, with or without a hierarchy.## InstallationYou can include linksets directly into your site packages via pip:```pip install django-linksets```Or install as a library in venv/src by adding this line to your requirements.txt file:```-e git+https://github.com/gethee2anunnery/django-linksets.git#egg=django-linksets```## ConfigurationIf you installed linksets via your requirements file, you will need to add the venv/src directory to your project path:```VENV_SRC_DIR = os.path.join(APP_DIR, 'venv', 'src')```Then add linksets into your installed apps:```INSTALLED_APPS = ('linksets',)```Then create the database table:```python manage.py syncdb```## ImplementationAt minimum you will need to implement:* admin.py* models.py* utils.py* templatetags/links.pyCheck the template in the example directory for how to implement linksets in your templates.