Saravanan666/pypi-org huggingface dataset:
Package: django-discover-jenkins
[![Downloads](https://pypip.in/v/django-discover-jenkins/badge.png)](https://crate.io/packages/django-discover-jenkins) [![Build Status](https://drone.io/github.com/lincolnloop/django-discover-jenkins/status.png)](https://drone.io/github.com/lincolnloop/django-discover-jenkins/latest) [![PyPi Downloads](https://pypip.in/d/django-discover-jenkins/badge.png)](https://crate.io/packages/django-discover-jenkins/)A streamlined fork of django-jenkins designed to work with the default test command and the discover runner.[Read the Docs](https://django-discover-jenkins.readthedocs.org/)Why?The overall goal is to run tests on Jenkins the same way you do on your local machine. This project is designed to take advantage of [django-discover-runner](https://github.com/jezdez/django-discover-runner/), which is the default test runner in Django 1.6. Instead of using a setting to list which apps should be tested, or accepting Django-specific test labels, it uses the official test discovery feature of the new unittest2.Also, the original [django-jenkins](https://github.com/kmmbvnr/django-jenkins) project doesn’t take advantage of improvements to testing introduced in Django 1.4. Special management commands are no longer needed, as test runners themselves can add options that are handled by the built-intestcommand.What’s Changed?It doesn’t override the suite construction.Use the included test runner based on the django-discover-runner, or use the included mixin to add Jenkins functionality to your own runner. Your test suite will be built the same way on Jenkins as it is on your local machine.No management commands are provided.Since Django 1.4, the built in ‘test’ command has allowed the test runner to define additional options that the management command will accept.It doesn’t use signals.Instead of using the event/callback style of signals and usinginspect.getmembersto connect everything, the test runner simply checks for key methods on each task the same way Django’s request handler checks for methods on middleware.Not everything works yet.Only a subset of the django-jenkins tasks have been ported at this point. I’d love to accept your pull requests to add more of them.Who?First and foremost, the authors of [django-jenkins](https://github.com/kmmbvnr/django-jenkins) are responsible for the basis of most of this code. I ([Brandon Konkle](https://github.com/bkonkle)) just took it apart and put it back together again in a different way, then fixed or reworked some things. Thank you to the contributors of that project!For the full list of original authors and for the contributors to this project, see the AUTHORS.md file.
Package: django_discovery
This project provides a simple workflow for registering services in Django. It is highly opinionated and makes a lot
of assumptions.GoalWhen developing a Django application, you often need external services such as a database, a key-value store, a
message broker, etc. etc. I prefer to useDockerandDocker-Composeto have those services running when I develop my application.django-discoverymakes it easy to connect to those services, as long as you follow a specific workflow:Development is done on your own machine, with the services running under Docker;Testing is done by running both the services and the application using Docker Compose;The production environment provides an SRV-lookup capable DNS. Examples are:Running everything underKubernetesRunning everything on Docker, configured to use an SRV-capable DNS such asConsulRequirementsdjango-discoveryrequires Python 3 and Django 1.8 because we live in modern times.QuickstartThe following example assumes a Django application that requires a MySQL database. Add the following to yoursettings.py:from discovery import services

db = services.register('my_db', 'mysql', secrets=['mysql_user', 'mysql_database', 'mysql_password'])

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': db.secrets['mysql_database'],
        'USER': db.secrets['mysql_user'],
        'PASSWORD': db.secrets['mysql_password'],
        'HOST': db.host,
        'PORT': db.port,
    }
}

DEBUG = services.debug_modeYou can now run your application on localhost with your database under docker using the followingdocker-compose.yml:my_db:
    image: mysql:5.6
    ports:
        - ":3306"
    environment:
        MYSQL_ROOT_PASSWORD: supersecret
        MYSQL_DATABASE: database_name
        MYSQL_USER: database_user
        MYSQL_PASSWORD: alsosecretYou can also run your application in its entirety in docker, using for example the following docker-compose file:database:
    image: mysql:5.6
    environment:
        MYSQL_ROOT_PASSWORD: supersecret
        MYSQL_DATABASE: database_name
        MYSQL_USER: database_user
        MYSQL_PASSWORD: alsosecret

application:
    build: .
    links:
        - database:my_db
    ports:
        - "80:8080"
    env:
        DISCOVERY_MODE: envAnd still using the samesettings.py, you can even run your application under Kubernetes using the following
definitions:apiVersion: v1
kind: Service
metadata:
  name: my_db
spec:
  ports:
    - protocol: tcp
      port: 3306apiVersion: v1
kind: Endpoints
metadata:
  name: my_db
subsets:
  - addresses:
    - ip: 1.2.3.4
  - ports:
    - port: 3306apiVersion: v1
kind: Pod
metadata:
  name: my_application
  namespace: my_namespace
spec:
  containers:
     - name: my_application
       image: my/docker-image
       volumeMounts:
         - name: db_secrets
           mountPath: /etc/secrets/my_db
           readOnly: true
  volumes:
    - name: db_secrets
      secret:
        mysql_database: some_name
        mysql_user: some_user
        mysql_password: secret_passwordFull DocumentationWorking on it…LicenseThis project is licensed under the MIT license.
Package: django-discussion
Note: Requires authenticationInstallationpip install django-discussionConfigurationJS/CSSExample CSS and script references are commented out in the base template.
Example CSS is compiled from SASS, so make any changes in the SASS and re-compile the CSS file.The default AJAX/javascript require three jQuery libraries:jquery.autogrow.js
commit 8d632548aad3f07269adf03d4a47b7f2c3c7965chttps://github.com/jaz303/jquery-grab-bag/blob/master/javascripts/jquery.autogrow-textarea.jsjquery.placeholder.js
commit #47c4a3c89eed697d843a004034f7a33d555a1353https://github.com/danielstocks/jQuery-Placeholderjquery.form.js
v3.01https://github.com/malsup/form/SettingsDISCUSSION_UPLOAD_EXTENSIONSA Whitelist of file extensions that can be uploaded to a discussion.
If this is set to[], no uploads will be accepted.
If it is set toNone, the whitelist will not be used.Default:DISCUSSION_UPLOAD_EXTENSIONS = [
    'odt', 'odf', 'odp',  # Open/LibreOffice
    'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',  # MS Office
    'pdf', 'gif', 'jpg', 'jpeg', 'png',  # Other sane defaults...
]
Package: django-dishes
Django Dishes===============An application to make it easy to manage a food delivery service, including integration to allow clients to make their purchases online.URLs-----huegah.com/menus/add/<MMM-DD>/blog/<YYYY>/<slug>/about/Flow------ Menu for the week of Oct. 31 (Menu)- Roasted heritage duck breast with basmati rice and mixed veggies (Dish)- Roasted heritage duck breast (Main course)- Basmati rice (Side)- Mixed veggies (Side)- Ingredient- Name- Description- Category- RecipeIngredient- Ingredient  - haddock- Quantity  - 4- Unit - pieces- Note - 8 oz pieces- Recipe- TitleSlugDescription- Ingredients (RecipeIngredient)- RenderedDescription- Category- Notes (Note)- Type (Main course, side, starch, etc)- @shopping_list- @menu_frequency- Dish- Title (try to auto-build, but give opportunity to change it)- MainCourse (Recipe)- Side (Recipe)- Slug (main, side slug join)- Description- @on_active_menu? (Is the dish currently being offered, used as a check before filling orders)Menus are introduced on a given date, and deliveries occur on fixed dates with ordering deadlines.- Delivery- order_deadline- date- @- Menu- dishes (Dish)- publish_date- deliveries (Delivery)- Order- dishes- Delivery date- Customer- DeliveryAddress
Package: django-dispatcher
# django-dispatcherLogic engine for determining order of things to executeSometimes there's a series of things that must run in sequence. This is aconfiguration based approach enabling that.Typical Usage---1. Create some transition objects. They are basically Interfaces thatrequire some methods and properties to be defined and reward you withsome context built at an appropriate time.The required functions/params include:- final_state (String)- is_valid (Function returning Boolean)- context (Function returning Dict)```from dispatcher import Transitionclass Cart2DayReminder(Transition):final_state = CART_2_DAY_REMINDER_SENT@propertydef onlinebooking(self):if self._onlinebooking is None:self._onlinebooking = OnlineBooking.objects.get(pk=self.resources['online_booking'])return self._onlinebooking_onlinebooking = None@propertydef profile(self):if self._profile is None:self._profile = self.onlinebooking.user and self.onlinebooking.user.profilereturn self._profile_profile = Nonedef is_valid(self):if self.onlinebooking.date_updated < (datetime.now() - timedelta(days=2)):self.errors.append('The booking was created less than 2 days ago')return Falsereturn Truedef build_context(self):return {'booking_id': self.onlinebooking.id,'email_to': self.profile.email,}class Cart1WeekReminder(Transition):...```2. Create a config, listing the transitions that can happen```DISPATCHER_CONFIG = {'chains': [{'chain_type': 'abandoned_cart','transitions': {NEW: [Cart2DayReminder, Cart1WeekReminder],Cart2DayReminder.final_state: [Cart1WeekReminder, ],Cart1WeekReminder.final_state: [],}}]}```3. Initialize the dispatcher with the above settings. You'll have todetermine the `chain_type` on your own. Its name must be the same asthe above config. We include the `requests_by` to keep track of wherethe request originates from.```from dispatcher import Dispatcherdispatcher = Dispatcher(chain_type='abandoned_cart',chain_configs=DISPATCHER_CONFIG,requests_by='cart_abandonment_scripts'})```4. Provide the resources to query searching for a chain. The chainwill query using an `AND` statement, meaning all the resources mustbe present when retrieving the chain.```dispatcher.get_or_create_chain([('online_booking', '123456'),('customer', '57844')])```5. Provide a callback for the chain. Should a chain transition to a newvalid state, whatever callback you pass will be sent on. The callbacktakes the transition passed in and any callback arguments specified.```def some_callback(transition, \**callback_args):# so something magicaldispatcher.execute_chain(callback=some_callback, callback_args={})```
Package: django-disposable-email-checker
===============================
django-disposable-email-checkerDjango package to detect between ~890 & ~8,600 domains used by disposable email services.
You can validate any email against our internal list of ~890 domains used by
disposable email services. Optionally you can also check each domain against
theBlock-Disposable-Email.comAPI,
covering ~8,600 domains.This code was initially developed at:https://github.com/aaronbassett/DisposableEmailCheckerHowever PyPI ownership has been transferred tohttps://github.com/jheld/DisposableEmailCheckerand as such
all future contributions are expected to be made to the new github repo.SetupInstall the disposable email checker from PyPIpip install django-disposable-email-checkerThe disposable email checker comes with a list of ~890 emails. If you would like
to provide your own email list create a function which returns a list of domains
to block.fromdisposable_email_checker.emailsimportemail_domain_loaderdefcustom_email_domain_loader():# Anyone still using AOL will be too much of a customer service burdenreturn["aol.com",]+email_domain_loader()Then add the complete path including function name to your settingsDEC_LOADER="my.package.custom_email_domain_loader"If you would like to use theBDEintegration add your API key to your Django settingsBDEA_APIKEY="abcnotarealkey123"optionally you can configure the BDE API timeout in seconds (default 5)BDEA_TIMEOUT=2A default error message can be set globally for the validation checking (this is optional and if
left blank it will default to_('Blocked email provider.')):BDEA_MESSAGE='<blocked email message>'Adding to your modelsOnce you have completed setup add theDisposableEmailFieldto your models.fromdjango.dbimportmodelsfromdisposable_email_checker.fieldsimportDisposableEmailFieldclassMyModel(models.Model):email=DisposableEmailField()TheDisposableEmailFieldhas a few optional argumentswhitelist- A list of emails which will always be allowed. Defaults
to[]message- The error message used by ValidationError if validation
fails. Defaults to_('Blocked email provider.')code- The error code used by ValidationError if validation fails.
Defaults to "invalid".Using the validatorIf you want to use the validator by itselffromdjango.core.exceptionsimportValidationErrorfromdisposable_email_checker.validatorsimportvalidate_disposable_emailemail="emailaddress@readmetest.com"# replace with your own valuetry:validate_disposable_email(email)exceptValidationError:pass
Package: django-disqus-sync
django-disqus-sync=================This app is lightweight SEO optimizer for DISQUS comment system for your Djangoapplication.It features Django management command/Celery task to sync comments from DISQUS toyour database and to embed them to the page for web crawlers like Google. DISQUScomment system is JS based and Google still has issues indexing it.This app also features template tag to embed prerendered comments to your page.Installation & usage-----First, install using pip:```pip install django-disqus-sync```Next, you need to create DISQUS app in order to be able to use their API to downloadcomments.You can create your app here: https://disqus.com/api/applications/Then, configure in your django `settings.py` using keys you were given:```DISQUS_API_KEY = '...'DISQUS_API_SECRET = '...'DISQUS_WEBSITE_SHORTNAME = '[NAME OF YOUR DISQUS FORUM HERE]'```Also make sure you have **some cache configured** since this apps needs it tosave queries and load temporary URL to THREAD list.Next, you need to setup period updates of comments in your forum. Either set upa cron to run management command:```manage.py disqus_sync```Or, you can use Celery to run it. Celery task should be auto-registered and youonly need to configure Celerybeat to fire it up from time to time.Last, use the templatetag in your templates to embed comments:```{% load disqus_sync %}{% render_disqus_comments %}```That's it, comments should be rendered to your page. **They will not be seenin browser, because they are by default wrapped in "display: none;" div.**You can override template used to render the comments by creating`disqus_sync/comments.html`, `disqus_sync/comment.html` or both.
Package: django-distributed
django-distributedA multi database setup for Django.Tested withwww.lodlaw.com, our setup consists of:one write database based in Australia corresponding to an Australian cluserone read database based in Europe corresponding to an European clusterInstallingpip install django-distributedRequirementsRequired configsInsettings.pyof Django, you need to define the following variables for the follower configuration:VariableTypeDescriptionLEADER_DATABASEstrThe name of the leader database (i.e.default)FOLLOWER_DATABASESlist[str]A list of follower databases (i.e.['replica1', 'replica2'])REPLICATION_LAGnumberThe replication lag in seconds between the read and write instances.Database routerIn addition, you need to use our customDistributedRouterdatabase router. Insettings.py, add in:DATABASE_ROUTERS=('django_distributed.SessionCachedRouter',)MIDDLEWARE=('crum.CurrentRequestUserMiddleware',)+MIDDLEWARECustomize database routerOur database router is session-based. It means that we decide to which database to read from or write to based on the user session.However, if you want to use another session back end, you have two options with our setup:Extend the classCachedRouterand implement the methodget_cache_key. Define your custom cache key there; orExtend the classDistributedRouterand implement the methodis_recently_updated. Our distributed router logic will read from the write database if it is recently updated else replica database.Optional configsIf you want to use our own session engine, you can do so by specifying insettings.pySESSION_ENGINE='django_distributed.session_engine'Session engine explanationThis session engine is using both cache store and database store.Because replication is not fast enough, a session written in the leader database will not appear in the replicas right away. Hence, the user might get kicked out after logging in, as the session is not yet replicated. Of course, we could do R/W all on the master database, but it would be slow, since our R and W databases are located far away from each other.Therefore, we have created this session engine, it will first add the session to the cache first, in our case, memcached. Then it will update the database. Same for reading session, cache store goes first then database store. Nevertheless, what is different here from the Djangocached_dbis the write operation, it is offloaded to another thread.
Package: django-distributedlock
django-distributedlockA django app for functions or tasks that needs distributed lock, e.g. for management commands that used in cron jobsInstalationInstall withpipin your environment:$ pip install django-distributedlockAdd in yoursettings.pyinINSTALLED_APPSINSTALLED_APPS = (
...
'distributedlock',
...
)django-distributedlock can be work with django cache or a database model, you must to set the client in the variableDISTRIBUTEDLOCK_CLIENT, with the valuescacheordatabaseaccording your needs.:DISTRIBUTEDLOCK_CLIENT="cache"       # or "database"UseFor register a distrbuted function with decorator:from distributedlock import distributedlock

@distributedlock()
def my_task():
    print "running"or you can use the sentencewith:with distributedlock('my_key_task'):
    print 'running'TestsOnce installed in your django project:django-admin.py test distributedlockNeedsgeventinstalled only for tests purpose.Some ideas were take fromhttps://github.com/snbuback/DistributedLock© 2013 Scryent
License BSDCurrent code @https://github.com/15five/django-distributedlock
Package: django-districts
# Districts - AfricaDistricts - Africa is a Django app for managing regions, districts, counties, sub-counties, parishes, and their corresponding locations within the African continent.Detailed documentation is in the "docs" directory.## Quick start1. Install the Districts package using `pip` by running the following command:2. Add "districts" to your `INSTALLED_APPS` setting like this:INSTALLED_APPS = [...,"districts",]3. Include the districts URLconf in your project urls.py like this:path("districts/", include("districts.urls")),4. Run `python manage.py migrate` to create the districts models.5. Run `python manage.py load_districts_data` to load the Districts data to your model.6. Start the development server and visit `http://127.0.0.1:8000/districts/` to view the districts and the URLs.7. For instance, visit `http://127.0.0.1:8000/districts/region/` to access the regions within a country.
Package: django-ditto
Django DittoA collection of Django apps for copying things from third-party sites and services. Requires Python 3.9 to 3.12, and Django 4.1, 4.2 or 5.0.Read the documentation.See screenshots of a site using the supplied templates.Install usingpip:$ pip install django-dittoNOTE 1: It will installPillow, among other things, which has prerequisites of its own, such as libjpeg and zlib. Sorry.NOTE 2: As of 2023 I'm unsure how well the Twitter integration still works given the state of its API etc.Currently, Ditto can copy these things from these services:FlickrPhotosPhotosetsOriginal image and video filesUsersLast.fmScrobbles (Artist, Track and Album)PinboardBookmarksTwitterTweetsFavorites/LikesImages and Animated GIFs (but not videos)UsersThe Ditto apps provide:ModelsAdminManagement commands to fetch the data/filesViews and URLsTemplates (that useBootstrap 4)Template tags for common things (eg, most recent Tweets, or Flickr photos uploaded on a particular day)
Package: django-djaboto
===========django-djaboto===========A django application with assorted tools to help create and manage Django CMS projects and to then deploythem on AWS Ubuntu servers.  Additional OS targets may be added later.Django-djaboto heavily relies upon the AWS Python module Boto, and really only wraps it in a django command set for consistency.Dependencies============- boto>=2.4.1- Fabric>=1.4.2- Django>=1.4Changelog=========0.0.6a2 - Sorted the output of the 'cmsplugins' commandAdded 'cmsplugins' command to list all installed django-cms plugins0.0.5a1 - Added support for initial update to an existing instance with pre-existing sites.
Package: django-djaken
Djaken is a complete web-based notes application for Django.NewsVersion 2.0.2 released! (2018/12/15)Version 2.0rc1 released! (2018/12/06)Version 2.0b1 released! (2018/04/14)Changes in 2.0~:Replace Markdown with reStructuredText.Move inline images to seperate model (DB) field,
thus avoiding search and markup processing on bulky image data.
It also takes away the encoded image data from the markup text.GUI: several improvements (HTML templates and CSS).GUI: Edit Note; change “Save and Close” button to icon and have all three
save and close permutations at top and bottom of note.CODING: Change ‘Generic Views’ back to regular/full Django views.FIXED: Page reload after going back to unlock encrypted note re-submits
encryption key (password).Disable browser caching as much as possible.FeaturesIntuitive, simple and stream-lined user interface.Login/logout of the notes application.Create and edit notes in reStructuredText.Attach inline images (within a note).Notes can be marked ‘Not relevant’, and if so, are kept out of view by default.Encrypted notes (stored in database using an AES symmetric cipher).Keyword search of note title and content.Sort by modified/created date.Options / SettingsDJAKEN_BRANDING_TITLE (str:default=’Djaken Notes’)RequirementsDjango>=1.9docutils>=0.12pycrypto>=2.6Quick startAdd “djaken” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'djaken',
]Include the djaken URLconf in your project urls.py like this:url(r'^djaken/', include('djaken.urls')),Runpython manage.py migrateto create the djaken models.Start the development server and visithttp://127.0.0.1:8000/djaken/to start adding notes.Screen-shotsOnly viewable on GitHub project pageAll Notes (homepage)View NoteEdit NoteUnlock an encrypted note
Package: django-djam
django-djamDjam is a third-party admin with the following goals:Provide basic CRUD functionality similar to the current admin.Ease the transition by supporting auto-generation of an admin based
on installed ModelAdmins.Support most of the basic ModelAdmin options out-of-the-box.Make it easy to add new custom areas to the admin that don’t fit into the traditional CRUD model.Use the latest front-end tools and design patterns.The name is alliterative; the beginning of Djam is pronounced the same as the beginning of Django.Djam usesFont Awesome by Dave Gandy.Linksdocs:http://django-djam.readthedocs.org/code:https://github.com/pculture/django-djam/irc:#django-djam on irc.freenode.netbuild status: