Saravanan666/pypi-org huggingface dataset:
Package: django-wordpress-auth
IntroductionAllows for access in Django to a WordPress installation for checking for
things like login status and roles / capabilities.RequirementsPython Dependencies:phpserializeWordPress Dependencies:root CookieMembersInstallationAdd your WordPress’s auth keys and salts (found in wp-config.php) to your settings.py.WORDPRESS_LOGGED_IN_KEY="rs&^D%jPdu=vk|VVDsdfsdgsdgsdg9sd87f98s7h[Xm$3gT/@1xdasd"WORDPRESS_LOGGED_IN_SALT="3]x^n{d8=su23902iu09jdc09asjd09asjd09jasdV-Lv-OydAQ%?~"Add your WordPress database to DATABASES in settings.py.DATABASES={'default':{...# default django DB},'wordpress':{# must be named 'wordpress''ENGINE':'django.db.backends.mysql','NAME':'wordpress','USER':'...','PASSWORD':'...','HOST':'...','PORT':3306,}}Add the middleware to MIDDLEWARE_CLASSES in settings.py.
Make sure it’s placed somewhere after the session middleware.MIDDLEWARE_CLASSES=('django.contrib.sessions.middleware.SessionMiddleware',# ...'wordpress_auth.middleware.WordPressAuthMiddleware',)Finally, addwordpress_authto INSTALLED_APPS.INSTALLED_APPS=(# ...'wordpress_auth',)UsageTo restrict a view to a certain role, simply wrap the view in thewordpress_requires_roledecorator.fromwordpress_auth.decoratorsimportwordpress_requires_role@wordpress_requires_role('my_role')defmy_view():passYou can restrict a view to a capability as well.fromwordpress_auth.decoratorsimportwordpress_requires_capability@wordpress_requires_capability('my_capability')defmy_view():passFinally, the middleware provides access to the WordPress user viarequest.wordpress_user.Seemodels.pyfor full reference.  Some of the redundant naming conventions
in the WordPress database have been made simpler as well.
Package: django-wordpress-auth-lite
IntroductionAllows for access in Django to a WordPress installation for checking for
things like login status.RequirementsPython Dependencies:phpserializeWordPress Dependencies:root CookieAlternatives to Root CookieIf you are receiving warnings usingroot Cookie, please seethis issuefor alternative solutions.InstallationAdd your WordPress’s auth keys and salts (found in wp-config.php) to your settings.py.WORDPRESS_LOGGED_IN_KEY="rs&^D%jPdu=vk|VVDsdfsdgsdgsdg9sd87f98s7h[Xm$3gT/@1xdasd"WORDPRESS_LOGGED_IN_SALT="3]x^n{d8=su23902iu09jdc09asjd09asjd09jasdV-Lv-OydAQ%?~"Add your WordPress database to DATABASES in settings.py.DATABASES={'default':{...# default django DB},'wordpress':{# must be named 'wordpress''ENGINE':'django.db.backends.mysql','NAME':'wordpress','USER':'...','PASSWORD':'...','HOST':'...','PORT':3306,}}Add the middleware to MIDDLEWARE_CLASSES in settings.py.
Make sure it’s placed somewhere after the session middleware.MIDDLEWARE_CLASSES=('django.contrib.sessions.middleware.SessionMiddleware',# ...'wordpress_auth_lite.middleware.WordPressAuthMiddleware',)Finally, addwordpress_auth_liteto INSTALLED_APPS.INSTALLED_APPS=(# ...'wordpress_auth_lite',)UsageTo restrict a view to users that are authenticated with WordPress:wordpress_requires_roledecorator.fromwordpress_auth_lite.decoratorsimportwordpress_login_required@wordpress_login_requireddefmy_view():passFinally, the middleware provides access to the WordPress user viarequest.wordpress_user.Seemodels.pyfor full reference.  Some of the redundant naming conventions
in the WordPress database have been made simpler as well.
Package: django-wordpress-rest
Welcome to django-wordpress-rest!SummaryDjango-wordpress-rest is a Django application that syncs content from a WordPress.com site to a Django site.This is done using theWordPress.com REST API.
A separate copy of the content data is stored on the Django side, which allows for loose coupling and extensability.Full documentation is available onRead The Docs.QuickstartInstall the module:pip install django-wordpress-restAdd"wordpress"to yourINSTALLED_APPSsetting:INSTALLED_APPS = (
    # ...
    "wordpress",
    # ...
)Create the database tables that will persist the sync’d WordPress content:$ python manage.py migrateSync WordPress content using the management command. The<site_id>can be found using the/me/sites WordPress API call. This is useful for periodically updating the content with cron.$ python manage.py load_wp_api <site_id>AuthenticationIf you’d like to synchronize private content, create an OAuth2 access token using the instructions provided by WordPress:https://developer.wordpress.com/docs/oauth2/Add this token to your Djangosettings.pyfile. Use an environment variable to keep things secure:WP_API_AUTH_TOKEN = os.getenv("WP_API_AUTH_TOKEN")Load OptionsBring the site content up to date:# first run gets everything
$ python manage.py load_wp_api <site_id>

# second run gets content modified since previous run
$ python manage.py load_wp_api <site_id>Do a full sweep of the site content, inserting and updating as needed:# first run gets everything
$ python manage.py load_wp_api <site_id>

# second run gets/updates all content again
$ python manage.py load_wp_api <site_id> --fullLoad everything modified after a given date:$ python manage.py load_wp_api <site_id> --modified_after=2015-01-01Just load posts, not pages, attachments, or reference data:$ python manage.py load_wp_api <site_id> --type=postLoad posts with a specific status (note this requires authentication):$ python manage.py load_wp_api <site_id> --status=draftPurge local content before loading – careful!$ python manage.py load_wp_api <site_id> --purge --fullWebhookIf you’d like to use the webhook to sync a post immediately after it’s updated, include theurlsinto your project’surls.py, like so:from django.conf.urls import include

urlpatterns = [
    url(r'^wordpress/', include('wordpress.urls'))
]Add"after_response"to yourINSTALLED_APPSsetting (this allows asynchronous processing):INSTALLED_APPS = (
    # ...
    "after_response",
    "wordpress",
    # ...
)The webhook looks for your<site_id>in Django settings. So add this yoursettings.py, and use an environment variable to keep things secure:WP_API_SITE_ID = os.getenv("WP_API_SITE_ID")Finally from your WordPress.com site, submit a POST request with anIDdata element in the body to trigger a sync of a single post. Note this should be the WordPress Post ID, not the Django one!$ curl -X POST --data "ID=123456" http://mydjangosite.com/wordpress/load_postRunning the Tests$ pip install detox
$ detox
Package: django-workers
Django WorkersA simple background task worker that uses your Django database and admin for management. This
project is meant for small to medium scale uses. If you need something more, check out Celery.InstallDownload the packagepip install django-workersand add it to your Django installed appsINSTALLED_APPS=[# ...'workers',# ...]BasicsCreate atasks.pyfile in the Django app you'd like to have tasks in. These tasks will automatically
become available thanks to autodiscovery.fromworkersimporttask@task()defsay_hello(name):print('Howdy',name)Calling tasksTasks become simple Python callables. Calling them inserts that task to your Django database and
waits for a worker to pick it up.say_hello('Foo')# Sent to background automaticallyRunning the workersNow boot-up your workers to crunch some data. Workers poll the Database for new tasks they should
work on.python manage.py runworkersScheduled tasksSometimes you want to run a specific task every X seconds or at a later date. Thats what scheduled
tasks are for.Repeating scheduled tasksTasks specified with a schedule in seconds will repeat.fromworkersimporttask@task(schedule=10)defdo_something():print('I run every 10 seconds')@task(schedule=60*5)defdo_something_later():print('I run every 5 minutes')@task(schedule=60*60*8)defdo_something_even_later():print('I run every 8 hours')Date scheduled tasksTasks can be scheduled torun onceat a later date by passing a_schedule=<datetime>argument
when the task is called.fromdatetimeimportdatetime,timedeltafromworkersimporttasktrial_end_date=datetime.utcnow()+timedelta(days=14)@task()deftrial_ending():send_email('Your trial is ending!')# Specifying the `schedule` argument will tell the worker when this task should runtrial_ending(_schedule=trial_end_date)SettingsYou can optionally override these settings in your Djangosettings.pyfile:WORKERS_SLEEP(default 5) - Wait in seconds before checking for tasks, if none were foundWORKERS_PURGE(default 1,000) - How many recent task logs to keep in the adminTODO (not working)WORKERS_TIMEOUT(default 30) - Seconds a task can run before its killedWORKERS_RETRY(default 3) - Number of retries before giving upWORKERS_CONCURRENCY(default 1) - Number of worker processes to run
Package: django-workflow-activity
InstallInstall the package via pypi:pip install django-workflow-activityAdd the installed application in the django settings file:INSTALLED_APPS = (
    ...
    'workflow_activity'
)Migrate the database:python manage.py migrateUsageTo create workflows and permissions, see the following documentations:https://pythonhosted.org/django-workflowshttps://pythonhosted.org/django-permissionsTo use workflow activity methods on a class :from workflow_activity.models import WorkflowManagedInstance

class MyClass(WorkflowManagedInstance):
    ...To add a workflow to an object:myobj = MyClass()
myobj.set_workflow('My workflow')Now, you can use methods on your object like:myobj.last_state()
myobj.last_transition()
myobj.last_actor()
myobj.last_action()
myobj.allowed_transitions(request.user)
myobj.is_editable_by(request.user, permission='edit')
myobj.state()
myobj.change_state(transition, request.user)
...And managers like:MyClass.objects.filter()
MyClass.pending.filter()
MyClass.ended.filter()
...
Package: django-workflow-engine
Django Workflow Enginedjango-workflow-engineis a lightweight and reusable workflow engine for
Django applications. It enables you to better organise the business logic for
collaborating users.Installationpip install django-workflow-engineGetting startedAdd the application to your Django settingsINSTALLED_APPSlist:INSTALLED_APPS=[..."django_workflow_engine",]Add the built-indjango-workflow-engineview urls to your project'surls.pyas follows:fromdjango_workflow_engineimportworkflow_urls...urlpatterns=[path("workflow/",workflow_urls()),...]This will utilise alldjango-workflow-enginebuilt-in view classes. Default views are:list_view=FlowListViewList of workflow instances view.view=FlowViewWorkflow instance view.create_view=FlowCreateViewCreate workflow view.continue_view=FlowContinueViewWorkflow continuation view.diagram_view=FlowDiagramViewWorkflow diagram view.You can override any the built-in view classes with your own, for example to
provide your own view classes for flow list and flow view:urlpatterns=[path("workflow/",workflow_urls(list_view=MyFlowListView,view=MyFlowView,),),]Building your first workflowCreate aworkflows.pyin your project and add your uniquely named workflows.fromdjango_workflow_engineimportStep,Workflowonboard_contractor=Workflow(name="onboard_contractor",steps=[Step(...),Step(...),Step(...),],)onboard_perm=Workflow(name="onboard_perm",steps=[...],)Add you workflows to your Django settings as follows:DJANGO_WORKFLOWS={"onboard_contractor":"your_app.workflows.onboard_contractor","onboard_perm":"your_app.workflows.onboard_perm",}Each entry needs to be a valid module path where the final component is the
name of your workflow class.Finally, run thedjango-workflow-enginemigrations:$./manage.pymigrate
Package: django-workflow-fsm
Control FSMs from DjangoDocumentationThe full documentation is athttps://django-workflow-fsm.readthedocs.io.QuickstartInstall Django Workflow FSM:pip install django-workflow-fsmAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'workflow.apps.WorkflowConfig',...)Add Django Workflow FSM’s URL patterns:fromworkflowimporturlsasworkflow_urlsurlpatterns=[...url(r'^',include(workflow_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxYou need to have postgresql installed, with user/password postgres/postgres.You will also need REDIS installed and working. This package for testing
will use the default redis configuration, localhost, 6379 port and 0 database.CreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-05-31)First release on PyPI.
Package: django-workflows
Introductiondjango-workflows provides a generic workflow engine for Django.DocumentationFor more documentation please visit:http://packages.python.org/django-workflows/CodeThe code can be found on github:http://github.com/diefenbach/django-workflowsImplementationsIf you want to see a comprehensive implementation of django-workflows take
a look at the CMSLFCChanges1.1.1 (2014-06-26)Pins version for django-permissions to 1.11.1 (2014-06-25)Cleanup and performance improvements1.0 (2010-08-24)First final release1.0 beta 4 (2010-07-23)Changed: State.get_allowed_transitions: try to use the object’s has_permissions
method before using the one from the utils1.0 beta 3 (2010-07-07)Bugfix utils.get_allowed_transitions; issue #2Bugfix: get_workflow_for_object method; issue #31.0 beta 2 (2010-05-19)Bugfix: get_allowed_transitions; return only allowed permissions; issue #2.Added license1.0 beta 1 (2010-05-17)First beta release.1.0 alpha 4 (2010-04-16)Added get_initial_state methodMoved WorkflowBase to __init__.pyAdded related_name for permissions to WorkflowPermissionRelation1.0 alpha 3 (2010-03-22)Changes according todjango-permissions1.0a3 (Added roles)1.0 alpha 2 (2010-03-22)A lot of improvements1.0 alpha 1 (2010-03-13)Initial public release
Package: django-workflows-unistra
Introductiondjango-workflows provides a generic workflow engine for Django.DocumentationFor more documentation please visit:http://packages.python.org/django-workflows/CodeThe code can be found on github:http://github.com/diefenbach/django-workflowsImplementationsIf you want to see a comprehensive implementation of django-workflows take
a look at the CMSLFCChanges1.1.1 (2014-06-26)Pins version for django-permissions to 1.11.1 (2014-06-25)Cleanup and performance improvements1.0 (2010-08-24)First final release1.0 beta 4 (2010-07-23)Changed: State.get_allowed_transitions: try to use the object’s has_permissions
method before using the one from the utils1.0 beta 3 (2010-07-07)Bugfix utils.get_allowed_transitions; issue #2Bugfix: get_workflow_for_object method; issue #31.0 beta 2 (2010-05-19)Bugfix: get_allowed_transitions; return only allowed permissions; issue #2.Added license1.0 beta 1 (2010-05-17)First beta release.1.0 alpha 4 (2010-04-16)Added get_initial_state methodMoved WorkflowBase to __init__.pyAdded related_name for permissions to WorkflowPermissionRelation1.0 alpha 3 (2010-03-22)Changes according todjango-permissions1.0a3 (Added roles)1.0 alpha 2 (2010-03-22)A lot of improvements1.0 alpha 1 (2010-03-13)Initial public release
Package: django-workflow-system
Django Workflow SystemFinally, an awesome Django Workflow System.Full documentation for the package is currently being written....but for now, here's what you need to get up and running.NOTE: THIS PROJECT IS STILL IN BETA, BREAKING CHANGES COULD BE INTRODUCED AT ANY TIMERequirementsPython (3.5, 3.6, 3.7, 3.8)Django (3.1+)Wehighly recommendand only officially support the latest patch release of
each Python and Django series.Installationpip install django-workflow-systemPost-Install SetupDjango Settings Additions# You will need to add django_workflow_system and rest_framework to your installed appsINSTALLED_APPS=["django_workflow_system","rest_framework",...]# You will need to add some authentication classes for DRF, more info can be found at https://www.django-rest-framework.org/api-guide/settings/REST_FRAMEWORK={"DEFAULT_AUTHENTICATION_CLASSES":[# "rest_framework.authentication.BasicAuthentication","rest_framework.authentication.SessionAuthentication",],"DEFAULT_PERMISSION_CLASSES":["rest_framework.permissions.IsAuthenticated",],}In your main urls.py file you will need to add the following line:path('api/',include('django_workflow_system.api.urls'))'api/'can be whatever you want.
Package: django-world-languages
Django World Languages (DWL) provides you with language related models:LanguageFamily- Both ISO 639-5 and Glottolog language familiesDialect- Slightly different dictions and pronunciations of languagesLexicalSimilarity- Similarities between languagesand language metadata:UsedIn- Maps languages to countries they are spoken inCharacteristic- Common characteristics of languages (word type orders, number of speech sounds, subject/verb/object order, syllable patterns)ScriptandScriptStyle- Characters that are used in languagesDevelopmentNote- Development statuses of languages (tags, Bible translations, literacy rates)InstallationInstall it with pip:pipinstalldjango-world-languagesAddworld_languagesto theINSTALLED_APPSvariable in your project’ssettings.pyfile:INSTALLED_APPS=[# ...'world_languages',# ...]Create the database tables:pythonmanage.pymigrateworld_languagesConfigurationAll configuration options should be specified in theLANGUAGE_SETTINGSvariable in your project’ssettings.pyfile.PLUGINS- You can specify your own functions to run before and after a language is created. This should be specified as a dictionary mapping signal names to your custom function in dotted-module notation.ExampleLANGUAGE_SETTINGS={'PLUGINS':{'pre_language':'custom_app.utils.function_name'},# ...}FILES- You can also specify your own URLs where files are hosted.ExampleLANGUAGE_SETINGS={# ...'FILES':{'language':{'filename':'iso-languagecodes.txt','urls':[url_bases['geonames']['dump']+'{filename}'],'fields':['iso639-3','iso639-2','iso639-1','name',]},'glottolog':{'filename':'languages.yaml','urls':[url_bases['glottolog']['languoids']+'{filename}'],}}}Import DataOnce you have created the models and adjusted the settings to your liking, you
will need to import data into your database with the providedworld_languagesmanagement command:pythonmanage.pyworld_languages--import=allTODOTestsAdd import signals for all models, not justLanguageReporting BugsThis package uses regexes to parse downloaded YAML, HTML, and text files fromGlottolog,Wikipedia, andGeonames. If you find a bug, especially in the
import script, please open an issue onGithub.
Package: django-world-regions
Simple Django app to group countries in world’s regions likeNorthern America,Eastern Europe, etc.Regions data are based inhttp://techydiary.com/region-yaml-for-django-fixtures/thanks Stephen for that.Django Countriesis used to handle countries.NoteCurrently this package don’t use GeoDjango neither map data.Installationpip installdjango-world-regionsAddworld_regionstoINSTALLED_APPSpython manage.py migrateUsagefrom world_regions.models import Region

region = Region.objects.get(countries__country='US')
print region.name
Package: django-wrapper-tag
Wrapping template tag for djangoDocumentationWrapper tag provides base class for wrapping tag. Wrapping tag which can have defined keyword arguments, keyword
arguments group in declarative way, and provide multiple steps of template rendering.Example:from django import template
register = template.Library()

@wrapper_tag.register_tag(register)
class ExampleTag(wrapper_tag.Tag):

    title = wrapper_tag.Keyword(help_text=('title for example tag'))

    class Meta:
        template = "<div{{ title__rendered }}>{{ content }}</div>"

    def render_title(self, argument, data, context):
        if argument.name not in data:
            return
        return ' title="{title}"'.format(data[argument.name])And then simply use tag in template:{% example title="Some informational title" %}
    Content
{% end:example %}This will yield to:<div title="Some informational title">
    Content
</div>That was just a simple eample what wrapper tag can do. It can do much more than that.QuickstartInstall wrapper_tag:pip install django-wrapper-tagThen use it in a project:INSTALLED_APPS = (
    'wrapper_tag',
)FeaturesWrapper tag provides multiple features for tag and arguments.Automatically generates documantation about arguments to tag documentationDefine tag aliases and automatically register them as tags.Provide custom render method for tag (render_tag)whenTEMPLATE_DEBUGis enabled wrapper tag runs validations for callbacksTag arguments features:default values for argumentschoices for argumentsvalidators for argumentsRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-09-29)First release on PyPI.
Package: django-wrapwith
django-wrapwithA Django template tag for wrapping a template block in a reusable enclosing template.Provides a block tag calledwrapwithwhich behaves exactly likethe built-inincludetag, but injects the contents of the block into the included template.It is intended to make wrapper markup reusable, encouraging you to break your template into "components" which might have a particular enclosing structure but varying contents. It is particularly useful with design systems that provide components (cards, blockquotes, accordians etc) that have reusable structure but arbitrary content.A toy example: imagine your design includes a box component which has a coloured border, but can contain any other markup inside it.First, create a wrapper template,wrappers/box.html:<divstyle="border: 1px solid {{ bordercol }}">{{ wrapped }}</div>Note the special{{ wrapped }}variable, which will be replaced with your wrapped content.Then, in your main page template:{% load wrapwith %}<html><body><h1>welcome to my page</h1>{% wrapwith "wrappers/box.html" with bordercol="red" %}<p>this is inside a red box</p>{% endwrapwith %}

    {% wrapwith "wrappers/box.html" with bordercol="green" %}<p>this is inside a green box</p><p>and here's another paragraph inside the green box</p>{% endwrapwith %}</body></html>Optional: aliasing templatesIf you find writing out the full template path every time you use a component too verbose, you can define a dictionary of "aliases" in your Django settings, using the setting nameWRAPWITH_TEMPLATES. This dictionary can be nested. You can then use a dotted path into this dictionary in your templates.In yoursettings.py:WRAPWITH_TEMPLATES={"wrappers":{"box":"wrappers/box.html",},}In your template:{% wrapwith wrappers.box with bordercol="red" %}<p>this is inside a red box</p>{% endwrapwith %}Tested on Python 3 with all currently supported Django versions.Installationpip install django-wrapwithThen addwrapwithto yourINSTALLED_APPS.Code of conductFor guidelines regarding the code of conduct when contributing to this repository please reviewhttps://www.dabapps.com/open-source/code-of-conduct/
Package: django-writingfield
django-writingfield-------------------|Coverage Status||Build Status|`There is a demo running that you can try <http://django-writingfield-demo.herokuapp.com/>`__.django-writingfield is a custom form widget to enhances textareas in the django admin to give them a delicious fullscreen writing mode.For more information `read the docs <http://django-writingfield.readthedocs.org>`__Submitting pull requests~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Pull requests are super welcome, but please make sure to they're aimed to the develop branch : )Development - setting up Grunt~~~~~~~~~~~~~~~~~~~~~~~~~~~~~django-writingfield uses grunt for building, packaging and watching js/scss. If you wantto hack on django-writingfield then you'll find it hyper useful.|bitdeli|.. |Coverage Status| image:: https://coveralls.io/repos/jamiecurle/django-writingfield/badge.png?branch=develop.. |Build Status| image:: https://jenkins.curle.io/buildStatus/icon?job=django-writingfield-django-1.6.1.. |bitdeli| image:: https://d2weczhvl823v0.cloudfront.net/jamiecurle/django-writingfield/trend.png