Saravanan666/pypi-org huggingface dataset:
Package: django-cloud-deploy
Django DeployDjango Deployis an experimental tool designed to make it easier to
deploy new and existingDjangoapplications
on public clouds
(e.g.Kubernetes Engine).Currently,Django Deploycan onlyDeploy toGoogle App Engine.Deploy toKubernetes Engine.Deploy applications created using its own template code.Django Deployis an experimental project not officially supported by Google.Here is an example usage:$ django-cloud-deploy new11 steps to setup your new project[1/11] In order to deploy your application, you must allow Django Deploy to access your Google account.
Press [Enter] to open a browser window to allow access
[2/11] Enter a Google Cloud Platform Project ID, or leave blank to use
[django-799931]: my-cool-site
[3/11] Enter a Google Cloud Platform project name, or leave blank to use
[Django Project]: My Cool Site
[4/11] In order to deploy your application, you must enable billing for your Google Cloud Project.
You have the following existing billing accounts:
1. My Billing Account
Please enter your numeric choice or press [Enter] to create a new billing account: 1
[5/11] Enter a password for the default database user "postgres"
Password:
Password (again):
[6/11] Enter a new directory path to store project source, or leave blank to use
[/usr/local/google/home/bquinlan/my-cool-site]:
[7/11] Enter a Django project name, or leave blank to use
[mysite]: mycoolsite
[8/11] Enter a Django app name, or leave blank to use
[home]: mycoolapp
[9/11] Enter a name for the Django superuser, or leave blank to use
[admin]: myname
[10/11] Enter a password for the Django superuser "myname"
Password:
Password (again):
[11/11] Enter a e-mail address for the Django superuser, or leave blank to use
[test@example.com]: myname@example.comGetting StartedFor the fastest path to a working Django application running in the cloud,
see theQuickstart.Deploy an existing applicationFor detailed instructions on how to deploy an existing Django project, see theHOWTO.Building a new applicationFor detailed instructions on how to create a new Django project and then deploy
and update it, see theHOWTO.Development Workflow (Linux)Verify that Python 3.5 or later is installed:python3-VClone the project and cd to it's directory:gitclonehttps://github.com/GoogleCloudPlatform/django-cloud-deploycddjango-cloud-deployCreate a new virtual environment:virtualenv-ppython3venvsourcevenv/bin/activateInstallDjango Deployin edit mode:pipinstall-e.Run it:django-cloud-deploynewCode modifications will be reflected in the next run ofdjango-cloud-deploy.ContributeCheck out ourCONTRIBUTINGto find out how you can help.LicenseThis project is licensed under the Apache License - see theLICENSEfile for detailsThis is not an officially supported Google product.StatusDjango Deployis an experimental project not officially supported by Google.
Package: django-cloud-deployer
Django Cloud DeployerThis package facilitates hybrid cloud deployment (IaaS/PaaS and FaaS) of Django web applications. By annotating project urls with the plugin's wrapper functions, a developer can indicate in which cloud deployment model each url resource should be executed.RequirementsTo use this package, you will need the following Software tools:GitnpmServerless Framework CLIYou will also need the CLI tools of the cloud providers you will be using:Heroku CLIAzure CLISetupFirst, install the package:pip install django-cloud-deployerThen, make sure to add the package (and its requirements) to your project's requirements file:pip freeze > requirements.txtUsageThe package features two functions,runInPaaSandrunInFaaS, that may be used to indicate in which cloud deployment model (PaaS or FaaS, respectively) a url resource should be executed.Example:# urls.pyfromdjango.urlsimportinclude,pathfromdjango_cloud_deployerimportrunInPaaS,runInFaaSfrom.importviewsurlpatterns=[path('',views.home,name='home'),runInPaaS(path('faq/',views.faq,name='faq')),runInPaaS(path('polls/',include('polls.urls'))),runInFaaS(path('auth/',include('auth.urls'))),]Note that, by default, url resources with run in FaaS.CLI toolThe package may be used as a CLI tool:$ python -m django_cloud_deployer

Usage: django_cloud_deployer <operation> 

Available operations:
- deploy 
- check_deploy
- destroyCheck DeployThecheck_deploycommand allows the developer to observe, based on the annotated urls, where each resource will be deployed and executed.Usage:$ python -m django_cloud_deployer check_deployExample:$ python -m django_cloud_deployer check_deploy

Please enter the name of the Django settings module (e.g., 'mysite.settings'):
> mysite.settings

The following urls will run in the FaaS provider:
^/?$
^auth/login/?$
^auth/logout/?$

The following urls will run in the PaaS provider:
^polls/?$
^polls/(?P<pk>[0-9]+)/?$
^polls/(?P<pk>[0-9]+)/results/?$
^polls/(?P<question_id>[0-9]+)/vote/?$DeployThedeploycommand allows the developer to deploy the django project, based on the annotated urls.Usage:$ python -m django_cloud_deployer deploy <paas provider> <faas provider>

Available PaaS providers:
- heroku
Available FaaS providers:
- azureNote that you will need to be logged in to the chosen PaaS and FaaS providers CLIs. If you are not, you will be asked to login first.After the deployment is completed, adjango_cloud_deployer.jsonconfiguration file will be produced:{"projectName":"...","paasConfig":{"provider":"...","resource":"...","url":"..."},"faasConfig":{"provider":"...","resource":"...","url":"..."}}DestroyThedestroycommand allows the developer to delete all the infrastructure resources created with the deployment of the Django project.Usage:$ python -m django_cloud_deployer destroy
Package: django-cloudflare
django-cloudflareA reusable Django middleware that allows you to easily extract Cloudflare headers.Resources:Source:https://github.com/tomwojcik/django-cloudflareDocumentation:https://django-cloudflare.readthedocs.io/Changelog:https://django-cloudflare.readthedocs.io/en/latest/changelog.htmlInstallation$ pip install-Udjango-cloudflareRequirementsPython 3.7+Dependenciesdjango>=3.2
Package: django-cloudflare-images
django-cloudflare-imagesThis is a Django library to add support to Cloudflare Images to the ImageField.It supports:Django 3Django 4Django 5Installationpipinstalldjango-cloudflare-imagesSetupYou need to add the following your settings.py:If you are running Django 4.2+:STORAGES={"default":{"BACKEND":"cloudflare_images.storage.CloudflareImagesStorage"}}Else:DEFAULT_FILE_STORAGE="cloudflare_images.storage.CloudflareImagesStorage"And then add the remaining of the configuration:CLOUDFLARE_IMAGES_ACCOUNT_ID="XXX"CLOUDFLARE_IMAGES_API_TOKEN="YYY"CLOUDFLARE_IMAGES_ACCOUNT_HASH="ZZZ"If you wish to use a default variant for a specific field you need to change yourImageFieldto aCloudflareImagesFieldsee example below:fromcloudflare_images.fieldimportCloudflareImagesFieldfromdjango.dbimportmodelsclassMyModel(models.Model):image=CloudflareImagesField(variant="custom")Please note that you will need to migrate your model(s) once you swapped the field(s). No SQL will actually be applied (you can check by runningsqlmigrate <module> <number>).If you wish to use a custom domain to serve your images you need to add the following to your settings.py:CLOUDFLARE_IMAGES_DOMAIN="example.com"If you wish to use a default variant other than "public" to serve your images you need to add the following to your settings.py:CLOUDFLARE_IMAGES_VARIANT="custom"DevelopmentInstalling for development:makeinstallCleaning the installation:makecleanFormat the code:makeformatRunning all tests:maketestCreate a sdist+bdist package in dist/:makepackage
Package: django-cloudflare-restrictor
OverviewThe django-cloudflare-restrictor package provides a convient way to restrict access to your application server, such that it will only respond to requests that come via cloudflare's network.InstallationInstall the package from pypipip install django-cloudflare-restrictorAdd toINSTALLED APPSin your settings fileINSTALLED_APPS = [
    'django_cloudflare_restrictor',
    ...And add toMIDDLEWAREin your settings fileMIDDLEWARE = [
    'django_cloudflare_restrictor.middleware.CloudflareRestrictorMiddleware',
    ...
 ]Set the additional settings as desiredCLOUDFLARE_RESTRICTOR_ENABLED = True
CLOUDFLARE_RESTRICTOR_ADDITIONAL_NETWORKS = ["127.0.0.0/8"]
CLOUDFLARE_RESTRICTOR_EXCLUDE_PATHS = [
    '^/cron/$',
]If you want to confirm that the IP blocks stored in the django-cloudflare-restrictor package are up to date you can use thecheck_cloudflare_ipscommand. This will log a warning if the IP addresses are out of date.python manage.py check_cloudflare_ipsBased on historical evidence, it appears that Cloudflare gives around 1 month's advance notice of IP address changes, by publishing the new addresses in advance on their site. Updates to these lists are very infrequent (approx once per every 2 years)
Package: django-cloudimage
A Django wrapper forhttps://cloudimage.ioInstallationInstall via pip:pip install django-cloudimageUsageAdd toINSTALLED_APPSinsettings.py'cloudimage',Add theCLOUDIMAGE_TOKENinsettings.pyAdd the include to urlpatterns inurls.pyurlpatterns = [url(r'^media/',include('cloudimage.urls')),]Load the template tag into a template{% load cloudimage %}Use theimagetag.{% image 'path/to/image.jpg' width=100 %}Visit theCloudImage
Docsfor all of the
options. Convert parameters to kwargs.OptionsCache Control headersIt is highly recommended that if you use this package your site should
be sitting behind a CDN. Not sure what this is, check outhttps://www.cloudflare.com/Add tosettings.pyTo set an expiration timeout use an integer in seconds. For example,
below the image is set to cache for an hour.CLOUDIMAGE_CACHE_CONTROL = 3600This will outputCache-Controlmax-age=3600in the response header.The advanced optionAny string you pass that doesn’t convert to an int will be set in the
header.CLOUDIMAGE_CACHE_CONTROL = "no-cache"This will outputCache-Controlno-cachein the response header.CaveatsKISSThe origional image must be accessable via a URL, so RSZ.IO can
access it. I usedjango-storageswith AWS S3 to serve my media.This is tested and used in production with Django 1.10 and 1.11 on
Python 3.5 and 3.6. But this should work on older versions of Django
and Python 2. Open an issue or pull request if not the case.VersioningThe package is following the Major.Minor.BugFix philosophy. So breaking
changes will increase the major number. New features will increase the
minor number.So it is safe to put this line in yourrequirements.txtAll new features, no breaking featuresdjango-cloudimage>=1.0.0,<2.0Just bugfixesdjango-cloudimage>=1.0.0,<1.1Release NotesThis project is using GitHub’s release feature. Find the release notes
herehttps://github.com/g3rd/django-cloudimage/releases
Package: django-cloudistatic
django-cloudistatic is a Django app to upload your staticfiles to Cloudinary and serve from there.
Cloudinary serves files using CDN, which will reduce the load on django server and pages will load
faster.Quick startAdd “djangocloudistatic” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'djangocloudistatic',
]Declare the following settings variables (you will get them from Cloudinary dashboard)CLOUDI_NAME = <Cloud name>
CLOUDI_API_KEY = <API Key>
CLOUDI_API_SECRET = <API Secret>IncludeSTATICFILES_DIRSandSTATIC_ROOTin settings.py file (Should be included beforeSTATIC_URL)
of your project. You may refer tohttps://docs.djangoproject.com/en/3.2/howto/static-files/for details.Modify theSTATIC_URLlike this:STATIC_URL=f'https://res.cloudinary.com/{CLOUDI_NAME}/raw/upload/v1/{STATIC_ROOT}/'Now runpython manage.py collectstaticcommand to collect all staticfiles to STATIC_ROOT
of your project.Finally, runpython manage.py cloudistaticto upload staticfiles to Cloudinary. Wait for a few minutes
and your staticfiles will be ready to be served from there. If you want to delete your local STATIC_ROOT (staticfiles will not be served from here now) after
uploading to cloud, then you should runpython manage.py cloudistatic--deletelocalinstead ofpython manage.py cloudistatic.For more info check out thedocumentation. And for questions about usage or
development you can create an issue on Github.
Package: django-cloudmailin
http://cloudmailin.com/Requirementsdjango >= 1.2.0Configurationsettings.pyAdd toINSTALLED_APPS:'cloudmailin'UsageMailHandler is a class based view. Since an application may have multiple
email addresses, they have to be registered with their own secret key and
callbacks. The callbacks can be reused if you want the same functionality for
different email addresses.from cloudmailin.views import MailHandler

mail_handler = MailHandler()
mail_handler.register_address(
    address='mysecretemail@cloudmailin.net',
    secret='mysupersecretkey',
    callback=my_callback_function
)The callback will receive the HTTP post variables as keyword arguments:def my_callback_function(**kwargs):
    # kwargs is a dict of cloudmailin post params
    passThen, in urls.py, register a URL pattern to act as the endpoint:url(r'^receive/mail/here/$', mail_handler)
Package: django-cloudmedia
Cloud media manager for djangoSupport for aliyun OSS, Tencent COS, Huawei OBSInstallpipinstalldjango-cloudmediaaddsettings.py:INSTALLED_APPS=['cloudmedia',...]UsageConfigureaddsettings.py:# set the default cloud object storageDEFAULT_FILE_STORAGE='cloudmedia.storage.obs.OBSStorage'COS_SECRET_ID=''COS_SECRET_KEY=''COS_REGION='ap-shanghai'COS_SCHEME='https'COS_BUCKET=''COS_BASE_URI=''# for image access domain# Ali OSS storageOSS_ACCESS_KEY_ID=''OSS_ACCESS_KEY_SECRET=''OSS_BUCKET=''OSS_END_POINT='oss-cn-shanghai.aliyuncs.com'OSS_BASE_URI=''# Huawei OBS storageOBS_ACCESS_KEY_ID=''OBS_ACCESS_KEY_SECRET=''OBS_BUCKET=''OBS_END_POINT='obs.cn-east-3.myhuaweicloud.com'OBS_BASE_URI=''Sync the database tablespythonmanager.pymigrateThen just access the django admin backend.
Package: django-cloudslave
I have a number of different applications that need to fire up instances in the
cloud to do various things. This module is supposed to be generically useful
for that purpose.What is it?It’s an incredibly simple way to fire up instances in the cloud with very
little effort. It fires up instances of a predefined flavor based on a
predefined image.What is it not?A generic wrapper around the various OpenStack client libraries. It does one
thing and does it well.How to use it?First, you configure a cloud:>>> from cloudslave.models import Cloud
>>> cloud = Cloud(user_name='user_name',
                  tenant_name='tenant_name',
                  password='v3rysecret',
                  endpoint='http://auth/url/v2.0',
                  region='XX-YY', # <-- Optional
                  flavor_name = 'm1.small',
                  image_name = 'regex that matches the name of the image (first match will be used)')
>>> cloud.slave()Then create a reservation:>>> res = cloud.create_reservation(5)  # Starts 5 instances
>>> res.start()
>>> res.update_state()
1
>>> res.get_state_display()
'Booting'
>>> res.update_state()
2
>>> res.get_state_display()
'Ready'
>>> [slave.run_cmd('hostname').strip() for slave in res.slave_set.all()]
['cloudslave-nthdnsrn', 'cloudslave-blhhmncq', 'cloudslave-vygfls4t']Lovely.Once you’re done with them, terminate the reservation:>>> res.terminate()That’s it.
Package: django-cloud-storage
Django Cloud StorageDjango Cloud Storage is a Python package that provides a custom storage backend designed for seamless integration with
proprietary cloud storage service.Installationpipinstalldjango-cloud-storageConfigurationIn your Django settings file, set the following values:STORAGE_URL='https://your-cloud-service.com'STORAGE_API_TOKEN='your-api-token'UsageTo integrate the Cloud Storage with a Django model, follow these steps:Import the required models and CloudStorage:fromdjango_cloud_storage.storageimportCloudStorageDefine your Django model, usingCloudStorageas the storage backend for aFileField:classMyModel(models.Model):file_field=models.FileField(storage=CloudStorage)def__str__(self):returnself.file_field.name
Package: django-cloud-storages
Welcome to django-cloud-storagesdjango-cloud-storages is a package developed for django to work with cloud storages to store/upload media files.This package extends thedjango Storage classto provide file storage in cloud.At the moment this package support the following cloud storage services -AppWriteDropBoxInstallationUse pip to install from PyPI:pip install django-cloud-storagesIt will install all the cloud storage backends (available in this package), you can choose any of the storage backend as per your requirement.DocumentationThe documentation for the packagedjango-cloud-storageis available athttps://django-cloud-storages.readthedocs.io.ContributingTo contribute to django-cloud-storagescreate a forkon GitHub. Clone your fork, make some changes, and submit a pull request.IssuesUse the GitHubissue trackerfor django-cloud-storages to submit bugs, issues, and feature requests.
Package: django-cloudtask
django-cloudtaskA django package for managing long running tasks via Cloud Run and Cloud SchedulerShould I be using this package?Not yet - we're still trying to make this package usable by the general public.There are a lot of assumptions being made that might not be suitable for your project.UsageSetupincludedjango_cloudtaskin your installed apps.ConfigurationMake sure these are in your django settings:PROJECT_IDthe GCP projectPROJECT_REGIONGCP regionTASK_SERVICE_ACCOUNTService account which will be authenticated againstTASK_DOMAINdomain which receives tasks (cloud run)TASK_DEFAULT_QUEUEdefault queue tasks will be added toDefining a taskTasksmustbe defined in a file calledtasks.pyat the root level of an app directory.e.g.,my-project/
  app/
    tasks.py
    urls.py
    views.py
  manage.py
  settings.pyTasks are defined using the@register_taskdecorator.@register_task(should_retry: bool, queue: str, schedule: str):should_retry:Will retry the task if there was an uncaught exception:queue:What Queue this task belongs to (Queues are set up in GCP):schedule:Cron-like string defining when this task should be executedNote: a scheduled task cannot have any arguments (but can have kwargs with defaults).e.g.,from django_cloudtask import register_task

@register_task
def my_task(some, args, kwarg=False):
   ...

@register_task(schedule="0 5 * * *")
def scheduled_task():
    ...Calling a taskTasks may be scheduled by callingenqueue(*args, **kwargs).argsandkwargsmust be JSON serialisable.Tasks may also be called directly which will execute in the current call stack.e.g.,# execute asynchronously
my_task.enqueue(1, "start the task", kwarg=True)


# execute immediately
scheduled_task()ContributingWe usepre-commit <https://pre-commit.com/>to enforce our code style rules
locally before you commit them into git. Once you install the pre-commit library
(locally via pip is fine), just install the hooks::pre-commit install -f --install-hooksThe same checks are executed on the build server, so skipping the local linting
(withgit commit --no-verify) will only result in a failed test build.Current style checking tools:flake8: python lintingisort: python import sortingblack: python code formattingNote:You must have python3.6 available on your path, as it is required for some
of the hooks.
Package: django-cloud-tasks
IntegrateGoogle Cloud Taskswith Django.Package provides easy to use decorator to create task handlers.App looks for tasks incloud_tasks.pyfiles in your installed applications and auto-registers them.Package is in early alpha and it does not have any real security at the moment. You need to authorize requests coming
to your instances yourself.PrerequisitesDjango 1.8+Python 3.4, 3.5, 3.6Dependenciesgoogle-api-python-clientDocumentationTODOInstallationInstall latest version from Github (PyPy package will be available as soon as stable version is released):pipinstall-egit+git@github.com:GeorgeLubaretsi/django-cloud-tasks.git#egg=django_cloud_tasksAdddjango_cloud_taskstoINSTALLED_APPS:INSTALLED_APPS=(# ...'django_cloud_tasks',# ...)Add configuration to your settingsDJANGO_CLOUD_TASKS={'project_location_name':'projects/{project_name}/locations/us-central1','task_handler_root_url':'/_tasks/',},# This setting allows you to debug your cloud tasks by running actual task handler function locally# instead of sending them to the task queue. Default: FalseDJANGO_CLOUD_TASKS_EXECUTE_LOCALLY=False# If False, running `.execute()` on remote task will simply log the task data instead of adding it to# the queue. Useful for debugging. Default: TrueDJANGO_CLOUD_TASKS_BLOCK_REMOTE_TASKS=FalseAdd cloud task views to your urls.py (must resolve to the same url astask_handler_root_url)# urls.py# ...fromdjango.urlsimportpath,includefromdjango_cloud_tasksimporturlsasdct_urlsurlpatterns=[# ...path('_tasks/',include(dct_urls)),]Quick startSimply import the task decorator and define the task insidecloud_tasks.pyin your app.
First parameter should always berequestwhich is populated after task is executed by Cloud Task service.You can get actual request coming from Cloud Task service by accessingrequest.requestin your task body and
additional attributes such as:request.task_id`,`request.request_headers`# cloud_tasks.py# ...fromdjango_cloud_tasks.decoratorsimporttask@task(queue='default')defexample_task(request,p1,p2):print(p1,p2)print(request.task_id)Pushing the task to the queue:frommy_app.cloud_tasksimportexample_taskexample_task(p1='1',p2='2').execute()Pushing remote task to the queue (when task handler is defined elsewhere):fromdjango_cloud_tasksimportremote_taskfromdjango_cloud_tasksimportbatch_executeexample_task=remote_task(queue='my-queue',handler='remote_app.cloud_tasks.example_task'):payload_1=example_task(payload={'p1':1,'p2':'2'})payload_2=example_task(payload={'p1':2,'p2':'3'})# Execute in batch:batch_execute([payload_1,payload_2])# Or one by one:payload_1.execute()payload_2.execute()You can also send tasks in batch if latency is an issue and you have to send many small tasks to the queue
(limited to 1000 at a time):frommy_app.cloud_tasksimportexample_taskfromdjango_cloud_tasksimportbatch_executetasks=[]foriinrange(0,420):task=example_task(p1=i,p2=i)tasks.append(task)batch_execute(tasks)It is also possible to run an actual function usingrunmethod ofCloudTaskWrapperobject instance that is returned after task is called (this can be useful for debugging):task=example_task(p1=i,p2=i)task.run()
Package: django-cloud-thumbnails
Django Cloud ThumbnailsDjango Cloud Thumbnails is a Django app that provides a custom image cropping backend fordjango-image-cropping.It uses custom Django storage backend -django-cloud-storage.InstallationInstall this package using pippipinstalldjango-cloud-thumbnailsAdddjango_cloud_thumbnailsto yourINSTALLED_APPSsetting like thisINSTALLED_APPS=[...,"django_cloud_thumbnails",]Set image cropping backendIMAGE_CROPPING_BACKEND='django_cloud_thumbnails.backend.CloudThumbnailsBackend'IMAGE_CROPPING_BACKEND_PARAMS={}Migrate your databasepythonmanage.pymigrate
Package: django-clubhouse
# Django-ClubhouseAn Open Source content management system build to compliment the [Mezzanine CMS](https://github.com/stephenmcd/mezzanine), by adding the concept of Modular Pages and block admin for multi-model change lists.## Installation+ Install django-clubhouse with `pip install django-clubhouse`+ Add `mezzanine.conf`, `mezzanine.core`, `mezzanine.generic`, `mezzanine.pages`, `mezzanine.twitter` to `INSTALLED_APPS` in your Django settings module+ Add `clubhouse.core`, `clubhouse.contrib`, `clubhouse.forms` to `INSTALLED_APPS` in your Django Settings module+ Add the following snippet to the end of the Django settings module:```pythontry:from clubhouse.utils.conf import set_dynamic_settingsexcept ImportError:passelse:set_dynamic_settings(globals())```