Saravanan666/pypi-org huggingface dataset:
Package: django-mc
django-mc=========|pypi-badge| |build-status|.. |build-status| image:: https://travis-ci.org/team23/django_mc.svg:target: https://travis-ci.org/team23/django_mc.. |pypi-badge| image:: https://img.shields.io/pypi/v/django-mc.svg:target: https://pypi.python.org/pypi/django-mc**django-mc** let's you build a CMS system that evolves around a few key ideas:- Pages are Django models where every page represents the content of one URL.The content of a page is mostly build up using components.- Components are content fragments that can be part of a page, but usuallydon't have their own canonical URL. Examples for components might be animage, a pdf download, a block of text, a contact form, etc.django-mc expects that you define different "regions" in a page that can takecomponents. A region might be a segment of your frontend design like "header","footer", "sidebar" or "content", etc. This allows you to not only fill a pagewith components but also decide in which part ("region") of the page theyshould be placed.A page usually also has a layout assigned. A layout is also just a model thatmay define multiple components in different regions. The final contents of therendered page will then be a combination of the components from the page andfrom the page layout. The layout more or less defines the fallback componentsfor a region that should be displayed if one region in the page has nocomponents assigned.A model that can hold components (i.e. layouts and pages) is called acomponent provider (see ``django_mc.models.RegionComponentProvider``).django_mc is unopinionated about how you display and manage the data inside theuser facing backend. This means you can use whatever administration interfaceyou want. A good fit though might be ``django_backend``.Development-----------Create a virtual environment, then install ``django-mc`` and its dependencies with::Install the dependencies (including the test dependencies) with::pip install -r requirements.txtThen you can run all tests with::toxChangelog=========0.1.0------ Added ``django_mc.link`` sub-application.- Added ``AddComponentTypeToRegions`` and ``RemoveComponentTypeFromRegions``to make it super easy to add and remove component types to and from the list ofallowed components in a region.- Initial release.
Package: django-mcmo
© 2014-2017 Thomas KhynMCMO stands for ‘Management Command Multiple Override’. This django app allows
multiple apps to override the same management command without evicting any.Supports Django 1.8 to 1.11 and matching Python 2 and 3 versions.InstallationAs straightforward as it can be, using pip:pip install django-mcmoUsageIn yourmanage.pyfile, replace the line:from django.core import managementby:from mcmo import managementYou can now use applications that concurrently define overrides fordjango.core managementcommands. Both commands will be called.For example, if you are usingdjingaanddjango-extra_keywords, which
both override Django’smakemessagesmanagement command, both commands from
both applications will be called subsequently.The first command which will be called will be the one relative to the
application in the latest position in theINSTALLED_APPS.Alternative usageIn  your manage.py is automatically generated (e.g. if you are usingbuildoutwithdjangorecipebookordjangorecipe), simply make sure
that the statement:import mcmois executed before callingdjango.management.execute_from_command_line.Importing the package patches thedjango.core.managementmodule, which
functions are then enabled for multiple-override support.LimitationsThe same-name overrides should all derive from the same command class, or at
least from on of Django’s base command classes (AppCommandorLabelCommand).django-mcmowill raise a warning (but the execution will carry on) in case
of subclassing inconsistencies. For example, if the commandcmdinapp1inherits fromAppCommandand the commandcmdinapp2inherits fromLabelCommand. Indeed, as only one command is likely to be executed in that
situation, the obtained results may not be consistent as it will depend on the
relative position of the apps inINSTALLED_APPSor raise an exception
regarding arguments presence, absence or type.In practice, same-name commands will only be met when two 3rd party apps
override a Django core management command. They will therefore derive from the
same Command base class, and cause no issue in 99.9% of the cases.django-mcmomay also emit warning messages if the same option is
explicitly added in the same command of two distinct apps with command classes
not being subclasses of each other.
Package: django-mcq
Django Multiple Choice QuestionInstallationInstall django-mcqRunpip install django-mcq.Add'quiz'to yourINSTALLED_APPSsetting.INSTALLED_APPS = (
    ...
    'quiz',
    ...
)Add the following to your projectsurls.pyfile.urlpatterns = [
    ...
    path('quiz/', include('quiz.urls')),
]Create a templatequiz_base.htmlfile intemplatesfolder:<!doctype html>
<html lang="en">
    <head>
        {% block quiz_css %}{% endblock %}
    </head>
    <body>
        {% block quiz_body %}{% endblock %}
        {% block quiz_js %}{% endblock %}
    </body>
</html>Migrate database:python manage.py migrateLoad sample quizzes:python manage.py loaddata sample_quizzes.jsonNow login a user and navigate tohttp://127.0.0.1:8000/quiz/Packaging pypidelete files indistfolderincrement the version number in yoursetup.pyfile$ python3 -m buildtwine upload dist/*
Package: django-mdbook
Provides a simple view formdBooks, allowing them to exist within a
Django site. Note that because all requests are proxied through theMdBookView, it will be a bit slower than using Apache or Nginx directly;
however, using a Django view allows fine-grained access control.Example use:importos.pathfromdjango.contrib.auth.decoratorsimportpermission_requiredfromdjango.urlsimportpathfromdjango.views.genericimportRedirectViewfromdjango_mdbook.viewsimportMdBookViewdirectory=os.path.dirname(__file__)defrel_to_abs(path:str)->str:"""Given a path relative to this file, give its absolute name:param path: a relative path to resolve:return: an absolute path"""returnos.path.join(directory,path)urlpatterns=[path('doc/foo/',RedirectView.as_view(url='index.html',permanent=True),name='foo_doc_index'),path('doc/foo/<path:path>',permission_required('doc.foo_documentation')(# Note: book_root is the directory with book.toml, not the built directoryMdBookView.as_view(book_root=rel_to_abs('foo'))),name='foo_docs')]
Package: django-mdbsessions
django-mongo-sessionsForked version fromdjango-mongo-sessions.Explain why this fork was needed.Featuresfast NoSQL Django sessions backendinvalidation viaTTLInstallationInstall with pippipinstalldjango-mongo-sessionsInside settings.pySESSION_ENGINE='mongo_sessions.session'Available settingsThere is two ways to setup mongodb connection atsettings.py.
First, if already have mongo connection, like::importpymongofrompymongoimportMongoClientconnection=MongoClient()MONGO_CLIENT=connection.your_databaseMONGO_SESSIONS_COLLECTION='mongo_sessions'# default optionSecond, if you need to connect to mongodb, like::MONGO_PORT=27017MONGO_HOST='localhost'MONGO_DB_NAME='test'MONGO_DB_USER=FalseMONGO_DB_PASSWORD=FalseMONGO_SESSIONS_COLLECTION='mongo_sessions'# all this settings are defaults, you can skip anyexpireAfterSecondsindex value by default isSESSION_COOKIE_AGEyou can change::MONGO_SESSIONS_TTL = 60 * 60 # one hourbe sure, that you know what are you doing with it,SESSION_COOKIE_AGEwill get different expiration timeevery time you change one of this values,expireAfterSecondsindex
will be dropped and then will be indexed withensureIndexagain,
be careful hereit is good way to change expireAfterSeconds only by 1 running instanceTestspipinstalltox
tox
Package: django-mdeditor-widget
django-mdeditor-widgetA Markdown editor widget for textarea fields.Installation and usageInstall with pippip install django-mdeditor-widgetAdd "mdeditor" to your INSATLLED_APPS setting like:INSTALLED_APPS = [
    ...
    'mdeditor',
]In the form set the wdget to be "MDeditorWidget":self.fields['text'].widget = MDeditorWidget(attrs={'rows': '30'})
Package: django-mditor
不一样的极简第三方存储快速开始安装pipinstalldjango-mditor将mditor添加到您的 INSTALLED_APPS 设置中，如下所示：INSTALLED_APPS=[# ...'mditor',]将meida网址添加到您的设置中，如下所示：MEDIA_ROOT=os.path.join(BASE_DIR,'uploads')MEDIA_URL='/media/'像这样将 url 添加到您的url.py中：fromdjango.conf.urlsimporturl,includefromdjango.conf.urls.staticimportstaticfromdjango.confimportsettings# 省略 ...urlpatterns=[# 省略 ...url(r'mditor/',include('mditor.urls'))]ifsettings.DEBUG:# static files (images, css, javascript, etc.)urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)像这样写你的模型：fromdjango.dbimportmodelsfrommditor.fieldsimportMarkDownFieldclassArticle(models.Model):"""文章"""title=models.CharField('标题',max_length=100)body=MarkDownField('正文')常规操作：在 admin.py 中注册您的模型运行 python manage.py makemigrations 和 python manage.py migrate 来创建你的模型。登录 Admin ，您可以看到一个编辑器文本字段。自定义配置：settings.pyMDITOR_CONFIGS={"default":{"width":"auto","MinWidth":"535px","MaxWidth":"880px","height":"450px","preview":"false","split":"false","fullscreen":"false","upload_image_formats":["jpg","jpeg","gif","png","bmp","webp"],"image_folder":"mditor",}}问题？是否支持第三方存储？django-mditor 调用 setting.py 中DEFAULT_FILE_STORAGE，修改DEFAULT_FILE_STORAGE即可目前已测试 阿里云 OSS，其他尚未测试。如何将markdown内容渲染成html5？参考 markdown
Package: django-mdpages
Mdpages is a simple Django app to generate pages from Markdown files.Pages also can have a Table of Content automatically generated based
on headings.Quick startSupposing you want to create anAboutpage, having the markdown
file at/pages/content/about.md.Add “mdpages” to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'mdpages',]Set the location of the directory that will contain the Markdown
files in settings withMDPAGES_CONTENT_DIR:MDPAGES_CONTENT_DIR='{}/pages/content/'.format(BASE_DIR)Add the template that will contain the Markdown generated content,
you will have two variables available:bodyandtoc(for the
table of contents), for example create a template/templates/mdpages/page.htmlwith contents like:{%extends"base.html"%}{%blocktitle%}{{title}}{%endblock%}{%blockdescription%}{{description}}{%endblock%}{%blockcontent%}<divclass="container">{{toc|safe}}<hr>{{body|safe}}</div>{%endblock%}And add the template path to settingsMDPAGES_TEMPLATE_NAME:MDPAGES_TEMPLATE_NAME='mdpages/page.html'Create a view usingstaticages.views.MdPageViewspecifying
the name of the Markdown filemd_fileand thetemplate_name:frommdpages.viewsimportMdPageViewclassAboutView(MdPageView):md_file='language-learning.md'# any kind of extra content used in your templateextra_context={'title':'About page','description':'This is the about page of the site.'}Use it in yoururls.py:from.viewsimportAboutViewurlpatterns=[path('about',AboutView.as_view()),]ReferenceMarkdown libraryhttps://python-markdown.github.io/reference/
Package: django-mds
Contact informationsYou are a city, a mobility provider or you simply want to know more about our MDS tools: send us a mail atcontact@bluesystems.frdjango-mds - MDS compliant mobility data serviceACity of LA MDS Specification(Mobility Data Specification) compliant implementation of the Agency API for Python/DjangoGoals & non-goalsGoalsUltimately MDS complianceA way to test MDS ideas on a real implementation as we believe
it is hard to specify a quality API without a reference implementation alongsideDeveloper-friendly to be able for all stakeholders to contributeNon-goalsHigh-performance: we favor developer-friendliness over performance (this software being stateless, scaling is trivial anyway. Just the database needs to be correctly dimensioned)Full-featured UI: we provide an UI with required features, but this remains an API-first softwareData-analysis: analysis should be done by other apps consuming the consumer API of this app (the API must be designed to allow data consumption by third-party software)Tech & requirementsPython 3 withDjangoandGeoDjangoPostgresql withPostGISSwagger for interactive API documentation (available on /schema)How to runTest projectInstall and configure requirements (see above)Runpip install .[dev]to install dependenciesYou need the following env variables:MDS_DB_NAME,MDS_DB_USERandMDS_DB_PASSWORDTo initialize the database, runpython manage.py migrateTo start the project locally, runMDS_DEV_DEBUG=1 python manage.py runserverA sample environment configuration is provided in.env.exampleAuthenticationRequest authentication is done through JWT bearer token as specified inMDSJWT secret key or public key should be given through environment configurationMDS_AUTH_SECRET_KEYorMDS_AUTH_PUBLIC_KEYFrontendSee dedicated README infront/README.mdReleaseWe usesemantic versioningand zest.releaser for the actual release:fullreleaseJust follow the steps and hit Enter to answer Yes.
Package: django-mease
Work in progress.Websocket integration made easy for Django using Tornado, Redis PUB/SUB and easy to use callback registry mechanism.See a full working examplehereRTD INCOMING SHORTLYInstallationDependencies (Debian & Ubuntu)Measecomes with Redis PUB/SUB backend by default. If you want to use it, install these dependencies :sudo apt-get install redis-server python-dev
pip install redisInstall django-measepip install django-measeAdd mease to your INSTALLED_APPSINSTALLED_APPS=(# List of your installed apps'djmease',)UsageStart websocket serverpython manage.py run_websocket_serverRegister callbacksCreatemease_registry.pyfiles to register your callbacks (the file must be located in an installed app):fromdjmeaseimportmease@mease.openerdefopen_websocket(client,clients_list):client.storage["name"]="mymane"forcinclients_list:c.send("Someone joined")@mease.closerdefclose_websocket(client,clients_list):forcinclients_list:c.send("{name}left".format(name=client.storage["name"]))@mease.receiverdefreceive_websocket_message(client,clients_list,message):forcinclients_list:c.send(message)@mease.sender(routing=['websocket'])defsend_websocket_message(channel,clients_list,myobj):forcinclients_list:c.send(myobj.myattr)PublishUsemease.publishto publish from anywhere in your code :fromdjmeaseimportmeasemease.publish('websocket',"Hello world !")This will call all sender functions registered on the ‘websocket’ routing.
Package: django-measurement
Django MeasurementEasily use, manipulate, and store unit-aware measurement objects using Python
and Django.django.contrib.gis.measurehas these wonderful ‘Distance’ objects that can be used not only for storing a
unit-aware distance measurement, but also for converting between different
units and adding/subtracting these objects from one another.This module provides for a django model field and admin interface for storing
any measurements provided bypython-measurement.Example use with a model:fromdjango_measurement.modelsimportMeasurementFieldfrommeasurement.measuresimportVolumefromdjango.dbimportmodelsclassBeerConsumptionLogEntry(models.Model):name=models.CharField(max_length=255)volume=MeasurementField(measurement=Volume)def__str__(self):returnf"{self.name}of{self.volume}"entry=BeerConsumptionLogEntry()entry.name="Bear Republic Racer 5"entry.volume=Volume(us_pint=1)entry.save()These stored measurement objects can be used in all of the usual ways supported
bypython-measurementtoo:>>>frommeasurement.measuresimportMass>>>weight_1=Mass(lb=125)>>>weight_2=Mass(kg=40)>>>added_together=weight_1+weight_2>>>added_togetherMass(lb=213.18497680735112)>>>added_together.kg# Maybe I actually need this value in kg?96.699Documentation for django-measurement is available viaRead the Docs.Please post issues onGitHub.
Package: django-media
A reusable [Django](http://www.djangoproject.com/) application to store and manage media. This application was originally created by [Nathan Borror](http://nathanborror.com/) for [django-basic-apps](https://github.com/nathanborror/django-basic-apps), his collection of simple prebuilt Django applications.How it WorksModels are included for storing audio, photos, and video, as well as sets of these three objects. URLs (using generic views) and templates are included for displaying these objects.Requirements[Python Imaging Library](http://www.pythonware.com/products/pil/) is required for getting photo EXIF data.Installationdjango-media is available on PyPI and can be installed with PIP.pip install django-mediaAlternatively, you may download the source and install it.python setup.py installSetupAddmediato yoursettings.INSTALLED_APPS.### URLsIf you wish to use the default URL structure, you may do so by adding them to your project’s URL patterns. For example:urlpatterns = patterns(‘’,…
(r’^photos/’, include(‘media.urls.photos’)),
Package: django-media-cleaner
Searches and removes unused media files.InstallationInstallpip install django-media-cleanerAdd tosettings.pyINSTALLED_APPS=(...'django_media_cleaner',...)UsageTo find all unused media files, run command:./manage.py find_unused_mediaTo remove them:./manage.py find_unused_media --deleteHow to run testspython -m venv venv
source venv/bin/activate
pip install -r tests/requirements.txt
pip install -e .
py.test
Package: django-mediaelementjs
RequirementsDjango1.3 or laterInstallation$ pip install django-mediaelementjsSetupJust add'django.contrib.staticfiles'and'mediaelementjs'to INSTALLED_APPS in
your settings.py:INSTALLED_APPS = (
    # ...

    'django.contrib.staticfiles',
    'mediaelementjs',

    # ...
)Refer to Djangostatic filesdocumentation to configure and deploy static files.UsageYou can refer to MediaElement.js files in your template with:<script src="{{ STATIC_URL }}mediaelementjs/jquery.js"></script>
<script src="{{ STATIC_URL }}mediaelementjs/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="{{ STATIC_URL }}mediaelementjs/mediaelementplayer.min.css" />SeeMediaElement.jsdocumentation for
customization and usage examples.
Package: django-media-explorer
InstallationInstallpip install django-media-explorerUpdate settingsAdd these to your INSTALLED_APPS settings'rest_framework',
'micawber.contrib.mcdjango',
'media_explorer',
'ckeditor',Add these to your urls.pyurl("^ckeditor/", include("ckeditor.urls")),
url("^", include("media_explorer.urls")),Copy and paste this code into the bottom of your settings.py file.try:
    from media_explorer.settings import *
except ImportError:
    passThe DME application will try to resize your images during your upload. If you do not want to resize your images then set the settingDME_RESIZE = Falsesomewhere in your settings.py file (after the “media_explorer.settings” import).If you use your own JQuery in your admin pages and you do not want the DME application JQuery to conflict with yours then setDME_INCLUDE_JQUERY = False(since v0.3.6).Create tablesRun these migration commands to create your database tables.python manage.py makemigrations
python manage.py migrateHow it worksAdd the MediaImageField, MediaField and RichTextField fields to your model.from django.db import models
from media_explorer.fields import MediaImageField, MediaField, RichTextField

class Blog(models.Model):
    """
    Example Blog model
    """

    title = models.CharField(max_length=150)

    #Since v0.3.6
    #This behaves exactly as Django's ImageField with following differences:
    #1) You can add an optional max_upload_size=xxx to limit upload size
    #2) After image is saved you can see it listed at http://YOUR-DJANGO-SITE-URL/media_explorer
    #3) If the setting DME_RESIZE = True then image will be resized
    my_image = MediaImageField(max_upload_size=5242880,upload_to="my_dir")

    #Since v0.3.0
    #If you do not provide a type then media can be image/video/gallery
    lead_media = MediaField()

    #Since v0.3.0
    #Providing a type will restrict the element to this type
    video = MediaField(type="video")

    #Since v0.3.0
    #You will see a CKEditor WYSIWYG with DME plugin
    #NOTE: You cannot use more than one RichText field in a model
    entry = RichTextField()After you add media fields to your model you can add data via the admin page (See screenshot- the red-circled button is the DME plugin button. It will allow you to insert media elements into your WYSIWYG)After you add media you can access them by going tohttp://YOUR-DJANGO-SITE-URL/media_explorer/(See screenshot here).Go tohttps://github.com/oxfamamerica/django-media-explorerfor more documentation on how to add images, videos and galleries programatically via the API and how to display media in your templates.Go tohttps://github.com/oxfamamerica/media_explorer_exampleto download and run an example blog application.TestsRun this command to run all the DME tests.python manage.py test media_explorer.testsOr you can run the tests individually.python manage.py test media_explorer.tests.elements.tests
python manage.py test media_explorer.tests.galleries.tests
python manage.py test media_explorer.tests.customfields.tests
Package: django-mediafiles
IntroductionRequirementsBasic installationMoreIntroductiondjango-mediafilesisDjangoreusable application to manage media files in
your Django project. Nowdjango-mediafilessupports:Directories creating +, editing (chmod, chown, rename +), deleting +Files creating, uploading +, editing (chmod, chown), deleting +Recycle binThumbnail creation for imagesText files editing in browser +NOTE: Possibilities that supported current version ofdjango-mediafileslabeled by+.RequirementsPygments>= 1.0 needed for source code highlightBasic installationInstalldjango-mediafilesvia:# python setup.py installor addmediafilesdirectory to yourPYTHONPATH.2. Addmediafilesto your projectINSTALLED_APPSand set up serving
ofmediafilesmedia directory.3. Add(r'^mediafiles/',include('mediafiles.urls'))to your project
URLConf.4. That’s all :) Now login into Django admin CRUD and click onMedia
Files(or localized value) link. (Not worked yet, go to mediafiles url
to get access to it).MoreCheckdjango-mediafilesScreenshots@ Google Code.
Package: django-media-fixtures
django-media-fixturesSimple project to copy media files (intended for fixtures loads), pretty much as staticfiles does.DependenciesPython 3.5+Django 1.8+Note: The version (v1.x.x) dropped support of Python2! If you still need Python2, please check the last version ofv0.1.x seriesInstallationpipinstalldjango-media-fixtures==1.0.0Then, put ‘django_media_fixtures’ on your INSTALLED_APPS (on settings.py), just below ‘django.contrib.staticfiles’.UsageJust call manage command ‘collectmedia’, same as you do with collectstatic:pythonmanage.pycollectmediaAnd then all files on ‘media_fixtures’ folder in-apps will be copied to your MEDIA_ROOT.So, when you create your fixture (for any ways, even through shell), put your file path matching the same tree folder view as your media file.For instance,YourModel.objects.get_or_create(image="uploads/yourmodel/img/example.jpg")Where the file ‘example.jpg’ is on: yourappfolder/media_fixtures/uploads/yourmodel/img/example.jpgConfigurationsMEDIA_FIXTURE_FOLDERNAMEYou can change the media fixtures folder’s name on your apps, just putting this variable on settings.py.MEDIA_FIXTURE_FOLDERNAME='my_media_fixtures_folder'MEDIA_FIXTURES_FILES_FINDERSYou can change the media fixtures finders, to search media files on other folders not in-app, for instance.MEDIA_FIXTURES_FILES_FINDERS=('django_media_fixtures.finders.FileSystemFinder',# combined with MEDIA_FIXTURES_FILES_DIRS, choose specific folders'django_media_fixtures.finders.AppDirectoriesFinder',# default (if you do not set MEDIA_FIXTURES_FILES_FINDERS))MEDIA_FIXTURES_FILES_DIRSYou can list specific media folders that you want to include on search.MEDIA_FIXTURES_FILES_DIRS=["/home/user/myproject/mediafiles","/opt/webfiles/common/",]