Saravanan666/pypi-org huggingface dataset:
Package: django-facebook-users
Django Facebook Graph API Users===============================[![PyPI version](https://badge.fury.io/py/django-facebook-users.png)](http://badge.fury.io/py/django-facebook-users) [![Build Status](https://travis-ci.org/ramusus/django-facebook-users.png?branch=master)](https://travis-ci.org/ramusus/django-facebook-users) [![Coverage Status](https://coveralls.io/repos/ramusus/django-facebook-users/badge.png?branch=master)](https://coveralls.io/r/ramusus/django-facebook-users)Application for interacting with Facebook Graph API Users objects using Django model interfaceInstallation------------pip install django-facebook-usersAdd into `settings.py` lines:INSTALLED_APPS = (...'oauth_tokens','facebook_api','facebook_users',)# oauth-tokens settingsOAUTH_TOKENS_HISTORY = True                                        # to keep in DB expired access tokensOAUTH_TOKENS_FACEBOOK_CLIENT_ID = ''                               # application IDOAUTH_TOKENS_FACEBOOK_CLIENT_SECRET = ''                           # application secret keyOAUTH_TOKENS_FACEBOOK_SCOPE = ['offline_access']                   # application scopesOAUTH_TOKENS_FACEBOOK_USERNAME = ''                                # user loginOAUTH_TOKENS_FACEBOOK_PASSWORD = ''                                # user passwordUsage examples--------------### Fetch user by Graph ID>>> from facebook_users.models import User>>> user = User.remote.fetch(4)>>> user<User: Mark Zuckerberg>>>> user.__dict__{'_external_links_post_save': [],'_external_links_to_add': [],'_foreignkeys_post_save': [],'_state': <django.db.models.base.ModelState at 0xdf4514c>,'bio': '','birthday': '','cover': {'id': '989690200741','offset_y': 0,'source': 'http://m.ak.fbcdn.net/sphotos-a.ak/hphotos-ak-ash4/s720x720/311205_989690200741_1231438675_n.jpg'},'currency': None,'devices': None,'education': None,'email': '','favorite_athletes': None,'favorite_teams': None,'first_name': 'Mark','gender': 'male','graph_id': '4','hometown': None,'id': 11214,'installed': None,'interested_in': None,'languages': None,'last_name': 'Zuckerberg','link': 'http://www.facebook.com/zuck','locale': 'en_US','location': None,'middle_name': '','name': 'Mark Zuckerberg','payment_pricepoints': None,'picture': '','political': '','quotes': '','relationship_status': '','religion': '','security_settings': None,'significant_other': None,'third_party_id': '7joA1JrNkjG9e-A6yGLZyiTzdL4','timezone': None,'updated_time': datetime.datetime(2013, 3, 13, 20, 36, 43, tzinfo=tzutc()),'username': 'zuck','verified': False,'video_upload_limits': None,'website': '','work': None}Licensing---------This library uses the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).Please see the library's individual files for more information.
Package: django-facebook-utils
Django Facebook Utils=====================**License:** MITThe intent of this project is to provide some very basic utilities related to Facebook.At the moment there are only two features:* An utility that forces the update of an URL in the Facebook's share cache.* A Context Processor that allows you to hide Facebook [Open Graph Protocol](http://developers.facebook.com/docs/opengraphprotocol/) &lt;meta&gt; tags from other User Agents.Installation------------`pip install django-facebook-utils`or`pip install git+http://github.com/caioariede/django-facebook-utils.git#egg=facebook_utils`How to force an URL to be updated from Facebook's cache-------------------------------------------------------1. The `ping_facebook` command:`python manage.py ping_facebook http://example.com`See below **How to extend the ping_facebook command** to fit your needs.2. Calling the `ping_facebook` shortcut:from facebook_utils.shortcuts import ping_facebookif ping_facebook('http://example.com'):print('success')else:print('fail')This shortcut will only return `True` or `False`. If you need more information to debug, you can call `facebook_utils.utils.ping` or use the `ping_facebook` command with `--verbosity=2` (more verbose).Detecting Facebook requests---------------------------1. The `facebookexternalhit` context processor (for templates):Add `facebook_utils.context_processors.facebookexternalhit` to the [TEMPLATE_CONTEXT_PROCESSOR](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATE_CONTEXT_PROCESSORS) setting in `settings.py`:TEMPLATE_CONTEXT_PROCESSORS = (#  .. other stuff'facebook_utils.context_processors.facebookexternalhit',)In the template:{% if facebookexternalhit %}<meta property="og:title" content="The Rock"/><meta property="og:type" content="movie"/><meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/><meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>{% endif %}2. The `is_facebookexternalhit` shortcut:from facebook_utils.shortcuts import is_facebookexternalhitdef some_view(request):if is_facebookexternalhit(request):return HttpResponse('Hello, Facebook!')return HttpResponse('Hello visitor!')How to extend the ping_facebook command---------------------------------------You can easily extend the `ping_facebook` command to fit your needs.1. First of all, [start writing your own custom command](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/).2. Now extends the `ping_facebook` command:from facebook_utils.management.commands import BasePingCommand3. Finally, extend it to fit your needs:class Command(BasePingCommand):help = 'Ping some pages stored in database'def handle(self, **options):verbosity = options.get('verbosity')traceback = options.get('traceback')for page in Page.objects.all():page_url = page.get_absolute_url()self.do_ping(page_url, verbosity, traceback)
Package: django-facebox
This is aDjangointegration ofFacebox.Installationpipinstalldjango-faceboxExternal dependenciesjQuery - This is not included in the package since it is expected that in most scenarios this would already be available.SetupAddfaceboxtoINSTALLED_APPS:INSTALLED_APPS+=('facebox',)Be sure you have thedjango.template.context_processors.requestprocessorTEMPLATES=[{...'OPTIONS':{'context_processors':[...'django.template.context_processors.request',],},},]and just includefaceboxtemplates{%include"facebox/facebox_css.html"%}{# Before the closing head tag #}{%include"facebox/facebox_js.html"%}{# Before the closing body tag #}When deploying on production server, don’t forget to run :pythonmanage.pycollectstaticUsageExtend base template for ajax requests{%extendsrequest.is_ajax|yesno:"facebox/base.html,base.html"%}Addrel="facebox"to a link, and set the href to a page you want to display<ahref="{%url'remote.html'%}"rel="facebox">Click here</a>Please seeexampleapplication. This application is used to manually test the functionalities of this package. This also serves as a good example.You need only Django 1.4 or above to run that. It might run on older versions but that is not tested.Licensedjango-faceboxis released under the BSD license.
Package: django-facetools
Django Facetools provides a set of features to ease development of Facecbook
canvas apps in a Django project.Features:Replacementurltemplate tag as well as thereversefunction that convert
an internal url into it’s facebook canvas equivalent
(ex:http://my_app.mycompany.com/canvas/my_viewtohttps://apps.facebook.com/my_app/my_view)Ability to define facebook test users, their permissions, and their initial
friends per app.  The management commandsync_facebook_test_userslets you recreate
your test users in your facebook app with one call.FacebookTestCasecan be used in place of Django’sTestCase. Just
specify a test user’s name, much like a fixture, and the test client will mock
Facebook requests to your canvas app, complete with a valid signed request for the
specified test user.Integration with Facebook package Fandjango (https://github.com/jgorset/fandjango)You can read more athttp://readthedocs.org/docs/django-facetools/en/latest/
Package: django-fack
This is a simple FAQ application for a Django powered site, featuring:The basic Q&A model you’d expect.Question are grouped into topics.Topics can be ordered and arranged, as can questions within topics.Built-in views to drill down by topic and question, and individual
question detail pages (for permalinks).A view for users to submit new questions (with or without answers). These
go into moderation queue and need to be marked “active” before they’ll
show up on the site.There’s an example app (distributed with the source) to try out if you’d like
to get a taste of the app.For more details,see the documentationRequirementsDjango 1.3+, Python 2.6+.Installationpip installdjango-fackAdd"fack"to yourINSTALLED_APPSsetting.Wire up the FAQ views by adding a line to your URLconf:url('^faq/', include('fack.urls'))If you’d like to load some example data then runpython manage.py loaddata faq_test_data.jsonThe app’s written with quite a bit of customization in mind;see the customization documentationfor details.Example SiteThere is a stand-alone example site distributed with the source in theexample/directory. To try it out:Install django-Fack (see above).Runpython manage.py syncdbThis assumes that sqlite3 is available; if not you’ll need to change theDATABASESsetting first.Load some example data by runningpython manage.py loaddata faq_test_data.jsonRunpython manage.py runserverand you will have the example site up and
running. The home page will have links to get to the available views as well
as to the admin.The capability to submit an FAQ is available and works whether or not you are a
logged in user. Note that a staff member will have to use the admin and review
any submitted FAQs and clean them up and set them to active before they are
viewable by the end user views.ContributingTo run the tests, installtox(pip install tox) then runtox.Developmenttakes place on GitHub. Bug reports, pataches, and pull requests
are always welcome!
Package: django-factbook
FactBook is a simple Django app to store facts about the world. The initial
focus was to have an app for keeping up-to-date country and currency
information. Future plans extend to forex conversion, street adress look
and measurement conversions.Detailed documentation is in the “docs” directory.Quick startAdd “factbook” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'fact_book',
]Include the polls URLconf in your project urls.py like this:url(r'^fact_book/', include('fact_book.urls')),Runpython manage.py migrateto create the fact_book models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/fact_book/to get an overview.DevelopmentClone this repository:git clone https://github.com/obitec/django-factbook
cd django-factbookCreate a python virtual environment and activate:python -m venv venv
source venv/bin/activateUpdate pip and install development dependencies:pip install -U pip
pip install -r tests/requirements.txtBuild the app and documentation:invoke build --docsCreate a pull request :-)
Package: django-factory_boy
When testing adjangoapp, a common case is to create some data,
then test app behavior around that test data.
This is usuallydone with fixtures, butthis includes some pain.factory_boyis useful for concisely creating objects, particularly for test data.This project will supply factory_boy classes for each model Django ships.
The factories are named after the class it constructs.
For example, a factory fordjango.contrib.auth.models.Useris available atdjango_factory_boy.auth.UserFactory.Seefactory_boyfor detailed docs, but all fields are given default values which can be overriden by passing keyword arguments to the constructor.  For example:from django_factory_boy import auth as auth_factories
user = auth_factories.UserFactory(first_name="test")would result in a savedUserinstance whosefirst_nameis set to"test".The resulting objects are normaldjangomodel instances, so once they are constructed you can use them in the normal ways.Not alldjangomodels have been added yet; if you need one, open an issue or a pull request.  Currently supported:contrib.auth (UserFactory,GroupFactory,PermissionFactory)contrib.sites (SiteFactory)This project intends to support all Python versions which Django does - 2.6 - 3.4 as of Django 1.6.
It supports all Django versions from 1.6 onwards.
Package: django-factory-generator
django-factory-generatorGenerate (factory_boy) Model Factory for each model of your Django appChangelog1.0.4 fix has_choices property for Django 3.01.0.3 Remove useless print statements1.0.2 AddPointFieldFakerto supportPointField. Refactor the
way modules are imported on generated factories1.0.1 Add more accurate fakers forBigIntegerField,IntegerField,PositiveIntegerField,PositiveSmallIntegerFieldandSmallIntegerField1.0.0 Init projectRequirementsThis Django app generates factory_boy Model Factories from your
installed apps, so you need to havefactory_boyinstalled.InstallationInstall usingpip:pip install django_factory_generatorAddfactory_generatorto yourINSTALLED_APPSsettings.INSTALLED_APPS=(...'factory_generator',...)Generate factoriesGenerate factories with a single command line:python manage.py generate_factoriesThis will create amodel_factoriesdirectory with the following
structure :|__ model_factories/
    |__ app_label_foo/
        |__ __init__.py
        |__ model_foo.py
        |__ model_bar.py
        |__ base/
            |__ __init__.py
            |__ model_foo.py
            |__ model_bar.pyEach model results in two generated files :model_factories/app_label_foo/base/model_foocontaining theModelFooFactoryBaseclass definition generated from the modelModelFoo. This fileshould not be manually editedsince it
would be overriden each time the commandgenerate_factoriesis
run.model_factories/app_label_foo/model_foocontaining theModelFooFactoryclass which simply extendsModelFooFactoryBase. This file is generated once but not
overriden when you run thegenerate_factoriescommand again.This structure gives you the ability tooverridethe ModelFactory
that was automatically generated. You can then edit theModelFooFactoryto change / edit the base fields that were
generated.You can then import your model factories the following way:# app_label/tests.py
from django.test import TestCase

from model_factories.app_label import ModelFooFactory, ModelBarFactory

class FooTests(TestCase):

    def test_model_factory(self):
        modelfoo = ModelFooFactory(
            foo='bar',
        )
        modelbar = ModelBarFactory(
            bar='baz',
        )
        # Run your tests hereSettingsHere are all the settings you can use, with their default value :FACTORY_NORMALIZE_FIELD_MAP = {}
FACTORY_FIELD_FAKER_MAP = {}
FACTORY_IGNORE_FIELDS = []
FACTORY_ROOT_DIR = 'model_factories'
FACTORY_IGNORE_NON_EDITABLE_FIELDS = TrueTodoImprove documentationWrite unit testsvalidate compatibility with previous versions of Django and PythonSupportIf you are having issues, please let us know or submit a pull request.LicenseThe project is licensed under the MIT License.
Package: django-faicon
django-faiconIntegrates a Font Awesome 5 icon picker in the Django admin interface. Picker interface includes dynamic search on the icon name & terms, filter by styles and can handle thousands of icons easily. Package uses the free version of Font Awesome but you can easily drop in the Pro version if you have license.DocumentationInstallpipinstalldjango-faiconAddfaicontoINSTALLED_APPSinsettingsAddpath('faicon/', include('faicon.urls')),tourlpatternsinurls.pyAdd the field to your modelfromfaicon.fieldsimportFAIconFieldclassMyModel(models.Model):icon=FAIconField()SetupIf you want to use Font Awesome Pro or a different version than the one included, download it and put it in your project static directory and name itfontawesomeTo specify different locations for the icon files you can use these settings:FAICON_YAML_FILE='fontawesome/metadata/icons.yml'FAICON_CSS_URL='fontawesome/css/all.css'
Package: django-fail
Django Failprovides tools for testing your site under less-than-ideal
conditions.When working locally, response times are near instant, and there is no entropy
introduced by network hardware (e.g. proxies or load balancers) that may, for
some reason or other, fail.Django Failhelps you test what happens when some parts of your site don’t
load or load slowly. This can be particularly helpful for responses used in
Ajax-powered applications.@fail(status=500,content='',mimetype='text/html')The@fail()decorator makes a view return some kind of failure response,
instead of a real response.For the arguments,statusis the status code, normally500,contentis any content to return, normally'', andmimetypeis the mimetype of
the response, normallytext/html.The@fail()decorator can be globally disabled by addingFAIL_ON = Falsetosettings.py.@slow(delay=2)The@slow()decorator makes a response wait a while before returning. The
delay is in seconds and defaults to2.The@slow()decorator can be globally disabled by addingSLOW_ON = Falseto settings.py.
Package: django-failedloginblocker
A project that uses overrides the Django authentication function to trackfailed login attempts on a per-user basis.  Code is based on BruteBuster(http://code.google.com/p/django-brutebuster/) but is simplified because ofthe dropped requirement of tracking IP addresses.  Django-Axes is anothersource of inspiration (http://code.google.com/p/django-axes/).Installation1. Add failedloginblocker to your INSTALLED_APPS list in settings.py2. Add failedloginblocker.middleware.FailedLoginBlockerMiddleware toMIDDLEWARE_CLASSES in settings.py3. Run 'python manage.py syncdb'4. Restart your web server, if necessary.Settings (set in settings.py if you want to override the defaults)FLB_MAX_FAILURES - Number of failures to allow before blocking logins.Default is set to 5.FLB_BLOCK_INTERVAL - The interval from the last failed attempt to determinewhether the current login attempt is to count as a failure.By default, decorators.py clears the failed logins if this intervalhas expired.Default is set to 1440 minutes (or 1 day).
Package: django-fairepart
A generic application to import your contact from facebook, google, etc.InstallationDownload the package onGitHubor simply install it via PyPiAddfairepartto yourINSTALLED_APPSINSTALLED_APPS = (
    'fairepart',
)Sync your database usingsyncdbcommand from django command lineIncludefairepartin yoururls.pyfrom django.conf.urls import patterns, url, include

urlpatterns = patterns(
    '',
    (r'^',
    include('fairepart.urls')),
)Configure settings
Package: django-fakeauth
This is a fake authentication backend for django, you can use it like that (in
your settings):FAKEAUTH_TOKEN = 'superkey'

AUTHENTICATION_BACKENDS = ('django_fakeauth.FakeAuthBackend',) + AUTHENTICATION_BACKENDS
MIDDLEWARE_CLASSES.append('access.middleware.ACLMiddleware')

FAKEAUTH_TOKEN = os.environ.get('FAKEAUTH_TOKEN')
Package: django-fake-bot-detector
django-fake-bot-detectorDetect and block fake search bots 🤖OverviewMany nefarious internet bots, knowing they are not welcome, like to fake their user-agent
string so they can pretend they're just a friendly search bot (e.g. GoogleBot) hitting your site.Fortunately the major search bots are all verifiable by performing a reverse DNS lookup against
the request IP and checking the returned domain matches the expected domain
(e.g.crawl-66-249-66-1.googlebot.com). This simple middleware for Django does exactly that.InstallationInstall from PyPI:pip install django-fake-bot-detectorAdd the middleware insettings.py:MIDDLEWARE = [
    ...
    'fakebotdetector.middleware.FakeBotDetectorMiddleware',
    ...
]SettingsYou can use the following in your settings.pyNameDescriptionDefaultFAKE_BOT_DETECTOR_ENABLEDEnables the fake bot detectorTrueFAKE_BOT_RESPONSE_CODEThe HTTP status code to send for blocked requests403Pro tip:if you are running django behind an NGINX proxy, you can set FAKE_BOT_RESPONSE_CODE to 444 to have
NGINX close the connection immediately without sending an HTTP response at all.Django SignalsAfake_bot_hitsignal is sent every time the middleware blocks a bot.To listen for the signal, set up a receiver:from django.dispatch import receiver
from fakebotdetector.signals import fake_bot_hit

@receiver(fake_bot_hit)
def fake_bot_hit_receiver(sender, bot_ip, bot_useragent, fqdn_expected, fqdn_received, **kwargs):
    print('Received a fake bot hit from {}'.format(bot_ip))
Package: django-fake-database-backends
MotivationsThis project intends to propose django database backends which can be used to generated SQL, without actually having the databases set up.
The main use case is using the built-in django commandmanage.py sqlmigrate.These backends are not intended to be used for any production, migration or storage.
They will nicely fail when you try to actually establish an actual database connection.The need for this library comes from the tests ofdjango-migration-linterwhich needed to generate SQL from a backend that was not sqlite3, but without having to install a database client library.Installationpip install django-fake-database-backendsUsageIn your project settings file, presumablysettings.py, use one of the available backends:DATABASES = {
    'default': {
        'ENGINE': 'django_fake_database_backends.backends.mysql',
    }
}Available backendsdjango_fake_database_backends.backends.mysqldjango_fake_database_backends.backends.sqlite3django_fake_database_backends.backends.postgresqlMore will come in the future.TestsThe test suite usestoxand can be invoked using.
Package: django-fakeimg
django-fakeimg==============A django port of fakeimg.plInstallation============Run `pip install django-fakeimg`.Add `fakeimg` to your `INSTALLED_APPS` setting:INSTALLED_APPS = (...'fakeimg',)Example usage=============In a template,<img src="{% url fakeimg_placeholder 100 %}" /><img src="{% url fakeimg_placeholder 100 200 %}" /><img src="{% url fakeimg_placeholder 100 200 'ccc' 'ddd'%}" /><img src="{% url fakeimg_placeholder 100 %}?text=Hello&fond=lobster" />