Saravanan666/pypi-org huggingface dataset:
Package: django-firebase-auth
Django Firebase AuthProject provide Django authentication middle ware using Firebase Authentication ServiceRequirementsDjangoFirebase Authentication ServiceInstallationpipinstalldjango-firebase-authGenerate Firebase CredentialsUsageSettings1. Setting credentialsCredentials from fileFIREBASE_CREDENTIALS_FILE='<YOUR FIREBASE CREDENTIALS PATH>'# 'firebase-credentials.json'or using credentials from json dict (where you can use as environment variables )Using credentials from json dictFIREBASE_CREDENTIALS_DICT={"type":"service_account","project_id":"<YOUR PROJECT ID>","private_key_id":"<YOUR PRIVATE KEY ID>","private_key":'<YOUR PRIVATE KEY>',"client_email":"<CLIENT EMAIL>","client_id":"<CLIENT ID>","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"<CERT URL>"}2. Add installed apps:INSTALLED_APPS=["...","django_firebase_auth",]3. Setting authentication backendREST_FRAMEWORK={"DEFAULT_AUTHENTICATION_CLASSES":("django_firebase_auth.firebase_auth.FirebaseAuthentication",),}Generate Firebase Credentials fileTo generate a private key file for your service account:In the Firebase console, open
Settings >Service Accounts.Click Generate New Private Key, then confirm by clicking Generate Key.Securely store the JSON file containing the key.Add Firebase credentials to settings.pyGenerate Firebase credentials from Firebase consoleTODO:Support supabaseOptimize session management
Package: django-firebase-cache
Django Firebase CacheInstallpipinstalldjango-firebase-cacheUsage# settings.pyCACHES={"firebase":{"BACKEND":"django_firebase_cache.RealtimeDatabaseCache","LOCATION":"django",# name of child key in Realtime Database"OPTIONS":{"databaseURL":"https://project-id.firebaseio.com/"},},"firestore":{"BACKEND":"django_firebase_cache.FirestoreCache","LOCATION":"django",# name of collection in Firestore},}
Package: django-firebase-custom-auth
Django Firebase Custom AuthDjango backend for Firebase custom authentication.RequirementsDjango 3Python 3SetupInstall dependencies.pip install djangorestframework firebase-adminInstall this package.pip install django-firebase-custom-authAdddjango_firebase_custom_authto yourINSTALLED_APPSin yoursettings.py.INSTALLED_APPS = (
    ...,
    'rest_framework',
    ...,
    'django_firebase_custom_auth',
)Add URL patterns.urlpatterns = [
    path('custom-auth/', include('django_firebase_custom_auth.urls')),
]Specify a file path service account info is stored.SERVICE_ACCOUNT_KEY_FILE_PATH = os.path.join(BASE_DIR, 'serviceAccountKey.json')(Optional) Provide a key to generate a custom token. The default value isid.
Make sure this value is a primary key your user model has.CUSTOM_TOKEN_KEY = 'uuid'Now you can send a user's credentials (username and password) from your Firebase client app to Django backend. And your server will return a custom token if the credentials are valid. And you can sign in with Firebase using the token. Below is an example in JavaScript.const url = "http://127.0.0.1:8000/custom-auth/login/"
const credentials = {
	username: username,
	password: password,
}

axios.post(url, credentials).then((resp) => {
	const token = resp.data.token

	firebase.auth().signInWithCustomToken(token)
		.then(() => {
			// Sign in with Firebase
		})
		.catch((err) => {
			// Handle an error
		})
})Use CaseLet's say your users will be added by admin manually and you want to authenticate users without email.
Since Firebase built-in authentication requires email and password, you need a server that provides a custom token to authenticate users with Firebase. This package can handle the custom authentication.
For more details, see these resources below.Authenticate with Firebase in JavaScript Using a Custom Authentication SystemHow do I create users without email in firebase?
Package: django-firebase-scrypt
django_firebase_scryptA Django password hasher based off scrypt to use for user accounts imported from Firebase.InstallationInstall dependencies according to your Python version and OS:# Debian/Ubuntu
$ sudo apt-get install build-essential libssl-dev python-dev

# Fedora, RHEL
$ sudo yum install gcc openssl-devel python-devel

# Alpine Linux (Docker Containers)
$ apk add gcc openssl-dev python-dev

# (If you're on Python3, install the Python3 versions of the above packages)

# Mac
# Without setting the flags below, install will fail to find the necessary files
$ brew install openssl
$ export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
$ export LDFLAGS="-L$(brew --prefix openssl)/lib $LDFLAGS"Then install this packagepip install django-firebase-scryptUsageAdd this to your hasherssettings.pylike soPASSWORD_HASHERS = (
  'django_firebase_scrypt.FirebaseScryptPasswordHasher',
  'django.contrib.auth.hashers.PBKDF2PasswordHasher',
  'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  'django.contrib.auth.hashers.SHA1PasswordHasher',
  'django.contrib.auth.hashers.MD5PasswordHasher',
  'django.contrib.auth.hashers.CryptPasswordHasher',
  'django.contrib.auth.hashers.Argon2PasswordHasher',
  'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
)

# Retrieve these from  the Firebase console - see https://firebaseopensource.com/projects/firebase/scrypt/
FIREBASE_SIGNER_KEY = "jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA=="
FIREBASE_SALT_SEPARATOR = "Bw=="
FIREBASE_ROUNDS = 8
FIREBASE_MEMCOST = 14You can also moveFirebaseScryptPasswordHasherto the bottom of your hashers if you only want to use it to validate
old, migrated hashes instead of generating them for new users.MigrationMigrate your Firebase users to Django.  You can do so as follows:# Grab your users and their password hashes using the auth:export command
$ auth:export users.jsonimport json

import django
django.setup()
from django.contrib.auth import get_user_model

from django_firebase_scrypt import FirebaseScryptPasswordHasher

User = get_user_model()

with open("users.json", "r") as user_file:
    firebase_users = json.load(user_file)["users"]

for firebase_user in firebase_users:
    django_password = f"{FirebaseScryptPasswordHasher.algorithm}${firebase_user['salt']}${firebase_user['passwordHash']}"
    django_user = User(email=firebase_user["email"], password=django_password, ...any_other_user_fields)
    django_user.save()
Package: django-firebird
Firebird SQL backend for djangoRepo Note:
Themasterbranch is anin developmentversion of django-firebird. This may be substantially different from the latestrelease of django-firebirdThis version of django-firebird is working withfbd[1], therefore it will work only with firebird 2.x and later.
The stable version corresponds with django 2.2 and live intostable/2.2.xbranch.
The current master branch of this repository is being developed under django 3.0.x. For previous Django stable version check
the branch list of this repository.fbdis the official stable python-firebird driver, also it has support for python 3.[1]http://pypi.python.org/pypi/fdb/RequirementsPython 3.xDjango 2.2.xfdb (http://pypi.python.org/pypi/fdb/)InstallationUsing pippip install django-firebirdFrom repositorygit clone git://github.com/maxirobaina/django-firebird.gitcd django-firebirdsudo python setup.py installManual InstallationInstructions for Ubuntu/Debian
I assume you have installed django from source with python setup.py installcd /usr/local/lib/python3.8/dist-packagessudo git clone git://github.com/maxirobaina/django-firebird.gitsudo ln -s django-firebird/firebird firebirdcd /usr/local/lib/python3.8/dist-packages/django/db/backendssudo ln -s /usr/local/lib/python3.8/dist-packages/django-firebird/firebirdConfigurationModify your setting.pyDATABASES = {
    'default': {
        'ENGINE' : 'firebird',
        'NAME' : '/var/lib/firebird/3.0/data/django_firebird.fdb', # Path to database or db alias
        'USER' : 'SYSDBA',           # Your db user
        'PASSWORD' : '*****',    # db user password
        'HOST' : '127.0.0.1',        # Your host machine
        'PORT' : '3050',             # If is empty, use default 3050
        #'OPTIONS' : {'charset':'ISO8859_1'}
    }
}Known bugs and issuesSome database migrations doesn’t work by default. Sometimes is better make intermediate migrations for solve problems.Some Query Expressions doesn’t work by default. We need to make some workaround, ie: Use Cast().Combined duration expressions need more research. No all combination of expressions works.ContributingCode and issues is in GitHub:https://github.com/maxirobaina/django-firebirdWe also have a mailing list:http://groups.google.com/group/django-firebird-dev
Package: django-fitbit
django-fitbit[![Build Status](https://travis-ci.org/orcasgit/django-fitbit.svg?branch=master)](https://travis-ci.org/orcasgit/django-fitbit) [![Coverage Status](https://coveralls.io/repos/orcasgit/django-fitbit/badge.png)](https://coveralls.io/r/orcasgit/django-fitbit) [![Requirements Status](https://requires.io/github/orcasgit/django-fitbit/requirements.png?branch=master)](https://requires.io/github/orcasgit/django-fitbit/requirements/?branch=master)Django-fitbit is a Django app for integrating a user’s Fitbit data into your
site.It handles the details of getting your app authorized to access your user’s
Fitbit data via the Fitbit web API.Getting HelpDocumentation is hosted on <http://django-fitbit.readthedocs.org>.This app is available onPyPIand can be installed withpip install django-fitbit.[PyPI](https://pypi.python.org/pypi/django-fitbit/)ContributingSee the [contributing docs](https://github.com/orcasgit/django-fitbit/blob/master/docs/index.rst)
Package: django-fixstaticurl
django-fixstaticurlDjango static tag ignores META.SCRIPT_NAME settings, so we get it fixed.Installpip install django-fixstaticurlSettingsInstall and config django-middleware-global-request properly, seehttps://pypi.org/project/django-middleware-global-request/Add fixstaticurl in settings.INSTALLED_APPSConfig nginx and uwsgi properly so that the META.SCRIPT_NAME is correct
Package: djangofixture
-*- rst -*-===============djangofixture===============Fixtures for Django.  See <http://pypi.python.org/pypi/fixtures> for moredetails about what we mean by "fixtures".Licensing=========All files are Copyright (C) 2012  Canonical Ltd.This program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, version 3 of the License.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program.  If not, see <http://www.gnu.org/licenses/>.Running=======This is how you do it::class MyTest(TestCase):def test_foo(self):django_url = self.useFixture(DjangoFixture()).base_urldo_stuff_to_django(django_url)Known problems and future work==============================* The port of the Django service is constant, so it is difficult to use thefixture in parallel.* Very minimal test coverage.  This was originally written to test somethingelse.* pkgme-service_ has ``DjangoSettings``, ``DjangoDatabase``, and``CeleryFixture``.  They are all probably useful and appropriate for here.Getting help============If you'd like help with djangofixture, you can find the developers onFreenode, hanging out in #pkgme.  Alternatively, join the mailing list andsend an email to it.
Package: django-fixture-generator
``django-fixture-generator``============================Requires Django 1.2.* Add ``"fixture_generator"`` to your ``INSTALLED_APPS`` setting.* Create a ``fixture_gen.py`` file in one of your apps.  It should looksomething like:from fixture_generator import fixture_generatorfrom django.contrib.auth.models import User, Groups@fixture_generator(User, requires=["my_app.test_groups"])def test_users():muggles, wizards = Group.objects.order_by("name")simon = User.objects.create(username="simon")adrian = User.objects.create(username="adrian")jacob = User.objects.create(username="jacob")simon.groups.add(wizards)adrian.groups.add(muggles)jacob.groups.add(muggles)@fixture_generator(Group)def test_groups():Group.objects.create(name="Muggles")Group.objects.create(name="Wizards")* Run ``manage.py generate_fixture my_app.test_users``.* Save the resulting fixture somewhere.
Package: django-fixtureless
django-fixtureless provides an easy way to create model objects within
your Django project for testing purposes.  This is done through
inspection of your database relationships.  All required fields are
randomly filled.  All foreign key relationships will create respective
objects in the same fashion.Note: django-fixtureless only supports Django 1.8 or higher and Python
2.7.x and Python 3.x._Django:http://djangoproject.com
Package: django-fixturemigration
fixturemigrationA django app that allows you to load a fixture in a particular migration
state.What’s the problem?If your django apps use fixtures then you already know that initial
loading of fixtures has been deprecated since django version 1.7. If you
want to load initial data you must use a data migration.Using adata
migrationis quite easy, you can add a RunPython migration that calls a function
like:def load_data(apps, schema_editor):
    Book = apps.get_model('library', 'Book')
    Book.objects.bulk_create([
        Book(name='The Litte Prince'),
        Book(name='The Ingenious Gentleman Don Quixote of La Mancha'),
    ])That works great but if you need to create many objects it could be a
pain to write this function. Some people try to load a full fixture file
from a migration by doing a RunPython migration with the following code:def load_data(apps, schema_editor):
    call_command('loaddata', 'books_data.json')Well, that seems to work but it has a serious problem. If your models
continue evolving you will add more schema migrations and everything
will seem to work right unless you try to migrate from scratch.When you arrive to the data migration the loaddata command will try to
deserialize the objects in your fixture using the current code in your
models but currently you are half way applying migrations and your old
fixture is not compatible with your models. Then you have to remove the
data migration, apply all the migrations, update your old fixture to the
new changes and load it manually.Si finally you’ll end mantaining a fixture file and loading it manually
after all migrations are applied.What’s the solution?Well, if you really want to load a fixture in a migration step then you
could use fixturemigration. It creates a migration step that will load
any fixture using the current migration state instead of getting the
final models.InstallationInstall fixturemigration from PyPI$ pip install django-fixturemigrationEdit your project’ssettings.py:INSTALLED_APPS = (
    ...
    'fixturemigration'
)Instructions to useCreate your fixture like you always do, right now fixturemigration
require that the fixture file will be in json format$ ./manage.py dumpdata --format=json --indent=4 app1 app2 > aap1/fixtures/20150723_data.jsonWe have entered the data in the name but you can use any name you
want.Add a special migration and tell it to load this fixture$ ./manage.py make_fixturemigration app1 --fixture 20150723_data.jsonNote that you need one app to store your new migration. The new
migration will have dependencies with the latest migration of each
app so when it load the fixture the state will be the same that when
it was created.
Package: django-fixtures-command
django-fixtures-commandSimple Django command that helps to organize your fixtures.UsageAddfixtures.pyfiles anywhere you want in your Django project. Put there the functions that handle fake data for development purposes.
The function must havefill_orflush_prefix and must be defined in thefixtures.pyfile to be found by./manage.py fixturescommand.CommandsDisplay all available fixtures along with their docstrings:./manage.py fixtures --allFill the database with fake data:./manage.py fixtures fill <fixture_name>Flush data from the database:./manage.py fixtures flush <fixture_name>ExampleIt is convenient to use some tool to generate fake data for fixtures like thefactory_boylibrary.deffill_profiles():"""Fill the database with fake user profiles."""inactive_profile=ProfileFactory.create(user__password=EXAMPLE_PASSWORD,user__is_active=False,)active_profile=ProfileFactory.create(user__password=EXAMPLE_PASSWORD,user__is_active=True)admin_profile=ProfileFactory.create(user__password=EXAMPLE_PASSWORD,user__is_superuser=True,user__is_staff=True,)print('Inactive profile:',inactive_profile.user.email,'password:',EXAMPLE_PASSWORD)print('Active profile:',active_profile.user.email,'password:',EXAMPLE_PASSWORD)print('Admin profile:',admin_profile.user.email,'password:',EXAMPLE_PASSWORD)defflush_profiles():"""Remove all user profiles."""Profile.objects.all().delete()InstallationInstall with pip:python -m pip install django-fixtures-commandThen add to your installed apps:INSTALLED_APPS=[...,'django_fixtures_command']
Package: django-flag-app
A pluggable django application that adds the ability for users to flag(report or moderate) your models.For complete documentation you may visitRead the Doc. or see thedocsdirectory.InstallationInstall usingpip$pipinstalldjango-flag-appIf you want, you may install it from the source, grab the source code and runsetup.py.$gitclonegit://github.com/abhiabhi94/django-flag-app.git$cddjango-flag-app$pythonsetup.pyinstallUsageAdd appTo enabledjango_flag_appin your project you need to add it toINSTALLED_APPSin your projectssettings.pyfile:INSTALLED_APPS=(...'flag',...)Add URLIn your rooturls.py:urlpatterns=patterns(path('admin/',admin.site.urls),path('flag/',include('flag.urls')),...path('api/',include('flag.api.urls')),# only required for API Framework...)MigrateRun the migrations to add the new models to your database:pythonmanage.pymigrateflagConnect the flag model with the target modelInmodels.pyadd the fieldflagsas aGenericRelationfield to the required model.E.g. for aPostmodel, you may add the field as shown below:fromdjango.contrib.contenttypes.fieldsimportGenericRelationfromflag.modelsimportFlagclassPost(models.Model):user=models.ForeignKey(User)title=models.CharField(max_length=200)body=models.TextField()# the field name should be flagsflags=GenericRelation(Flag)Importantthe name of the field should beflags.Use template tagIf you want to use web API, this step is not required. See further instructions atWeb API.render_flag_formtag requires 3 required positional arguments:Instance of the targeted model.User object.Request objectTo render theflagform for a the instancepost, place this inside your detail view, perhaps in some template of the sortpostdetail.html.{%render_flag_formpostuserrequest%}ContributingPlease see the instructions atContributing.rst.
Package: django-flaggit
django-flaggit enables content flagging.Installationpip install django-flaggitUsage:Addflaggitto yourINSTALLED_APPSIncludeflaggit.urlsinto your URLs if you plan on using the view
and template tag:urlpatterns = patterns('',
    url('^', include('flaggit.urls')),
)TestFollow above steps and runpython manage.py test flaggitAPIModelsflaggit.models.Flagflaggit.models.FlagInstanceUtilsflaggit.utils.flag(obj, user=None, ip=None, comment=None):Flag anobj, returns aFlagInstanceSignalsflaggit.signals.flagged(flag):Sent when something is flagged. Can be used to notify moderators.flaggit.signals.review(flag):Sent when something is in review.flaggit.signals.rejected(flag):Sent when some content was rejected.flaggit.signals.approved(flag):Sent when some content was approved.Here’s a template you can copy paste:import flaggit

def handle_flagged(sender, flag, created = False, **kwargs):
    if created:
        # send emails
        pass
    else:
        pass

def handle_review(sender, flag, **kwargs):
    pass

def handle_rejected(sender, flag, **kwargs):
    flag.content_object.delete()
    flag.delete()

def handle_approved(sender, flag, **kwargs):
    pass

flaggit.signals.flagged.connect(handle_flagged)
flaggit.signals.review.connect(handle_review)
flaggit.signals.rejected.connect(handle_rejected)
flaggit.signals.approved.connect(handle_approved)Template tags{% load flaggit_tags %}
{% flag_form object %}
{% flag_form object "your/custom/template.html" %}{% flag_form object %}:Renders a form to flagobject-`{% flag_form object “your/custom/template.html” %}:Renders the form with a custom template.@flashingpumpkin
Package: django-flags
Django-FlagsFeature flags allow you to toggle functionality in both Django code and the Django templates based on configurable conditions. Flags can be useful for staging feature deployments, for A/B testing, or for any time you need an on/off switch for blocks of code. The toggle can be by date, user, URL value, or a number ofother conditions, editable in the admin or in definable in settings.DependenciesInstallationDocumentationGetting helpGetting involvedLicensingCredits and referencesDependenciesPython 3.7+Django 2.2-4.0InstallationInstall Django-Flags:pipinstalldjango-flagsAddflagsas an installed app in your Djangosettings.py:INSTALLED_APPS=(...'flags',...)Documentationhttps://cfpb.github.io/django-flagsis the full documentation for Django-Flags, and includes how to get started, general usage, and an API reference.Getting helpPlease add issues to theissue tracker.Getting involvedGeneral instructions onhowto contribute can be found inCONTRIBUTING.LicensingTERMSLICENSECFPB Source Code PolicyCredits and referencesDjango-Flags was forked fromWagtail-Flags, which was itself forked fromcfgov-refresh.
Package: django-flantastic
flantasticAn app to found the best puddings of France!PurposeThis is a web application wich shows a map with points wich are bakeries. Each bakerie has notation based on some criterias, like taste, texture...The votes of users are processed to color the points on the map and shown the "best" bakeries.InstallationPython >=3.6Geodjango dependenciesStart a django app and then pip install django-flantastic.Then configure settings.py as you want, you can use postgis or Spatialite database as you wich.Optional setting are:FLANTASTIC_CLOSEST_ITEMS_NB:Choose how many items are shown each time user move the mapImport initial dataA script is ready to get bakeries from Christian Quest (Thank you!! ) geocoded SIRENE file data and import it into your database.pythonmanage.pymigrate
pythonmanage.pyimport_initial_data
Package: django-flashbriefing
AmazonAlexa Flash Briefingsfor Djangoflashbriefing provides models for feeds and feed items, a view to render the
JSON feed, and default admin configuration.InstallationIt’s onPyPI:pipenv install django-flashbriefingAdd toINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'flashbriefing',
    ...
)Add a route tourls.py:urlpatterns = [
    ...
    url(r'^briefings/', include('flashbriefing.urls')),
    ...
]Run migrations:python manage.py migrateFeed URLThe feed URL can found by clickingView on Siteon the Django admin Feed edit
page or by accessingget_absolute_url()on a feed instance. This is the
URL that will need to be registered with Amazon.Registering with AmazonLogin to theAmazon Developer Console.ClickAlexain the main navigation.UnderAlexa Skills Kit, clickGet Started.UnderSkill Type, selectFlash Briefing Skill API.UnderConfiguration, clickAdd new feedand add information about the feed, including the URL of the feed from the application.