Saravanan666/pypi-org huggingface dataset:
Package: django-cities-tiny
django-cities-tiny -- *Simple django-cities alternative*=========================================================This add-on provides models and commands to import country/zone/city data into yourdatabase.The data is pulled from `GeoNames<http://www.geonames.org/>`_ and contains:- country names- administrative division zones- city namesSpatial query support is not required by this application.This application is very simple and is useful if you want to make a simpleaddress book for example. If you intend to build a fully featured spatialdatabase, you should use`django-cities<https://github.com/coderholic/django-cities>`_.This is a fork of django-cities-light by James Pic. The main difference ofdjango-cities-tiny is:- support for localized names (from alternateNames.txt)- support for administrative division zones (from admin1CodesASCII.txt,admin2Codes.txt, or from XX.txt)- required Django 1.0+, Python 2.3+ and no other dependencesInstallation------------Install django-cities-tiny::easy_install django-cities-tinyAdd `cities_tiny` to your `INSTALLED_APPS`.Now, run syncdb, it will create all required tables for models::./manage.py syncdbData update-----------Finnaly, populate your database with command::./manage.py citiestinyrefreshThis command is well documented, consult the help with::./manage.py help citiestinyrefreshLimiting data to import---------------------If you want to import only cities from France, USA and Belgium you could do assuch in your settings.py::CITIES_TINY_COUNTRIES = ('FR', 'US', 'BE')Configure logging-----------------To get output from citiestinyrefresh command simply pass the -v2 or or--verbosity=2 option. Also if you use Django 1.3+, you may configure loggingsystem in your settings.py, simply configure a handler and formatter for`cities_tiny` logger. For example::LOGGING = {'version': 1,'disable_existing_loggers': False,'formatters': {'simple': {'format': '%(levelname)s %(message)s'},},'handlers': {'console':{'level':'DEBUG','class':'logging.StreamHandler','formatter': 'simple'},},'loggers': {'cities_tiny': {'handlers':['console'],'propagate': True,'level':'DEBUG',},# also use this one to see SQL queries'django': {'handlers':['console'],'propagate': True,'level':'DEBUG',},}}
Package: django-city
一个基于django的城市模块快速开始:安装django-city:pip install django-city修改setttings.py:INSTALLED_APPS = (
    ...
    'city',
    ...
)在admin中使用:from city.admin import CityAdminMixin

class DemoAdmin(CityAdminMixin, admin.ModelAdmin):
    pass在views中使用:from city.views import CityViewMixin

class DemoView(CityViewMixin):
    pass版本更改:v0.0.2 添加`CityViewMixin`v0.0.1 第一版
Package: django-cjswidget
django-cjswidgetA replacement for the Select widget with fancy new features - powered bychoices.js!InstallAdd "cjswidget" to yourINSTALLED_APPS:INSTALLED_APPS=[...'cjswidget',]UseUse in place of a normal select widget, that's all!fromcjswidget.widgetsimportCJSWidgetclassMyForm(ModelForm):classMeta:model=Profilefields=('country','region')widgets={'country':CJSWidget(),'region':CJSWidget(options={'shouldSort':False}),}LicenseThis software is released under the MIT license.Copyright (c) 2019-2020 Luke Rogers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: django-cked
CKEditor and elFinder integration for Django Framework.Provides aRichTextFieldandCKEditorWidgetwith upload and browse support.CKEditor widgetelFinder widgetdjango-ckedworks with Django 2.2+ and Python 3.6+Installation and configurationSeesetup partin documentation.UsageSeeusage partin documentation.AuthorsSeeauthors linkin documentation.LicenseLicensed under BSD license. Seelicense linkin documentation.
Package: django-cked-fc
CKEditor and elFinder integration for Django Framework.Provides aRichTextFieldandCKEditorWidgetwith upload and
browse support.Installationpip install django-ckedorpip install -e hg+https://bitbucket.org/ssbb/django-cked#egg=django-ckedConfigurationAddckedto yourINSTALLED_APPSsetting.Then setELFINDER_OPTIONSin your settings:ELFINDER_OPTIONS = {
    ## required options
    'root': os.path.join(PROJECT_ROOT, 'media', 'uploads'),
    'URL': '/media/uploads/',
}And add CKEd URL include to your projecturls.pyfile:url(r'^cked/', include('cked.urls')),SettingsCKEDITOR_OPTIONS: CKEditor config. Seehttp://docs.ckeditor.com/#!/guide/dev_configurationELFINDER_OPTIONS: elFinder config. Seehttps://github.com/Studio-42/elFinder/wiki/Client-configuration-optionsUsageModel fieldfrom django.db import models
from cked.fields import RichTextField


class Entry(models.Model):
    text = RichTextField()Widgetfrom django import forms
from cked.widgets import CKEditorWidget

class MyForm(forms.Form):
    text = forms.CharField(widget=CKEditorWidget)NOTE: If you are using custom forms, dont’r forget to include form
media to your template:{{ form.media }}
Package: django-ckedit
Django CKEditor===============Django CKEditor contains the JavaScript WYSIWYG editor, [CKEditor](http://ckeditor.com/) and functionality for uploading and browsing files on your server.Installation------------Run `pip install django-ckedit`Add `ckeditor` to your `INSTALLED_APPS` setting:```pythonINSTALLED_APPS = (...'ckeditor',)```To your sites `url.py` add:```pythonurlpatterns = patterns('',...url(r'^ckeditor/', include('ckeditor.urls')),)```Views-----###uploadUploads a file from the CKEditor insert image dialog's upload section to a user-specified path using the [default storage](https://docs.djangoproject.com/en/dev/topics/files/#the-built-in-filesystem-storage-class).##browseDisplays image thumbnails from the CKEditor insert image dialog's browse section.Settings--------`CKEDTIOR_UPLOAD_DIRECTORY (default 'ckeditor')`The directory the uploads are saved to and files are browsed from.
Package: django-ckeditor5
Django CKEditor 5===# 介绍 #本项目整合了新版 [CKEditor 5](https://ckeditor.com/ckeditor-5/) 到Django. 老版本[django-ckeditor](https://github.com/django-ckeditor/django-ckeditor) 仍然在使用[CKEditor 4](https://ckeditor.com/ckeditor-4/).根据 [ckeditor.com](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/migrate.html)官方说明，CKEditor 5是一个你没有用过的船新版本。整体上仍然使用 [django-ckeditor](https://github.com/django-ckeditor/django-ckeditor/tree/master/ckeditor)项目的架构。不同点是：- `static/ckeditor5` 包含最新的CKEditor 5经典编辑器（版本会随时更新，尽量与官方同步），[CKEditor 5下载](https://ckeditor.com/ckeditor-5/download/).- 移除了`extraPlugins`，老的一些插件，如代码插入编辑，目前不可以使用，需要其他方案。- 修改了`static/ckeditor5/ckeditor-init.js`部分代码， 在 `initialiseCKEditor` 方法里:+ extraPlugins处理方法代码被删除+ CKEditor 5 使用 `ClassicEditor.create` 来初始化创建编辑器，而不是用4的 `CKEDITOR.replace`# 安装 #pip install django-ckeditor5升级pip install django-ckeditor5 -Ugithubpip install git+https://github.com/n37r06u3/django-ckeditor5# 配置 #添加app```INSTALLED_APPS = [...'ckeditor5']```基础配置```CKEDITOR5_CONFIGS = {'default': {'toolbar': ["undo", "redo", "bold", "italic", "blockQuote", "imageTextAlternative", "imageUpload", "heading","imageStyle:full", "imageStyle:side", "link", "numberedList", "bulletedList"],'height': '300px','width': '100%',},}```模型定义```from ckeditor5.fields import RichTextField```添加插件https://www.npmjs.com/package/ckeditor5-code-block# 测试 #下载源码解压cd ckeditor5_demopython manage.py migratepython manage.py createsuperuserpython manage.py runserverhttp://127.0.0.1:8000/admin/# 参考 #https://github.com/django-ckeditor/django-ckeditorhttps://ckeditor.com/ckeditor-4/https://github.com/pancodia/django-ckeditor5https://ckeditor.com/ckeditor-5/# 变更 #20190304 - v0.0.1 初始化项目 CKEditor 5集成v11.0.1, 新版本django2.1.7测试可用20190305 - v0.0.2 添加demo20190306 - v0.0.3 添加大小配置20190306 - v0.0.4 ckeditor5-build-classic11.0.1到v12.0.0 添加 https://www.npmjs.com/package/ckeditor5-code-block# TODO #添加图片上传插件添加html源码查看插件完善安装说明
Package: django-ckeditor-filebrowser-filer
A django-filer based CKEditor filebrowserSupported versionsPython: 3.7 to 3.11Django: 3.2 to 4.2django-filer: 2.0 and aboveDocumentationOriginal code is taken fromdjango-ckeditor-filerIt supports both ckeditor widget provided bydjango-ckeditorand the one provided
bydjangocms-text-ckeditor.Warningif you are using filer<1.2 this plugin requiresdjango CMScmsplugin_filer_image, thus you need to install and configure both according
to their respective documentation.QuickstartInstall django-ckeditor-filebrowser-filer:pip install django-ckeditor-filebrowser-filerAdd it to INSTALLED_APPS along with its dependencies:'filer',
'ckeditor_filebrowser_filer',Configure django-filerCanonical URLsAddckeditor_filebrowser_filerto urlconf:url(r'^filebrowser_filer/', include('ckeditor_filebrowser_filer.urls')),Currently onlyfilebrowser_filer/is supported as url pathAddFilerImagebutton to you CKEditor configuration:Add'FilerImage'to a toolbar inCKEDITOR_CONFIGSAdd'filerimage'in `` ‘extraPlugins’`` inCKEDITOR_CONFIGSAdd'image'in `` ‘removePlugins’`` inCKEDITOR_CONFIGSExample:CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'Custom',
        'toolbar_Custom': [
            ...
            ['FilerImage']
        ],
        'extraPlugins': 'filerimage',
        'removePlugins': 'image'
    },
}when usingdjangocms-text-ckeditoruseCKEDITOR_SETTINGSinstead ofCKEDITOR_CONFIGS.History0.5.0 (2023-09-27)BugfixesFix filer_version url and migrate to bump-my-version (#59)0.4.0 (2023-08-03)Added compatibility with Django 4.2Drop support for Django<3.20.3.0 (2019-03-23)Added compatibility with Django 2.00.2.5 (2018-03-29)Fixed error when editing an image0.2.4 (2018-01-09)Fixed filer version detectionAdded support for Django 1.110.2.3 (2017-04-19)Added russian translations0.2.2 (2017-03-14)Added french translations0.2.1 (2017-01-01)Added support for Django 1.100.2.0 (2016-10-22)Added support for canonical urls feature of filer 1.0Added support to django-ckeditor (without django CMS)Added support to filer up to 1.2Added support to ThumbnailOptionUpdated to work with djangocms-text-ckeditor 2.7Fixed support for advanced deployment structure0.1.1 (2014-09-27)Fix static files position0.1.0 (2014-01-27)First release on PyPI.
Package: django-ckeditor-filer
Adds a button in the ckeditor to load images into the filer.WYSIWYG-редакторы нужны для облегчения жизни простого пользователя, поэтому
грешно заставлять пользователя копировать URL изображения и вставлять в
формочку, как это делается в плагине Image редатора ckeditor. В django-ckeditor
есть функция загрузки изображений, но она просто загружает файлы в
media-каталог, что лишает пользователей возможности управлять ими из админки.
Не пользоваться удобствами django-filer не менее грешно! Этот django app призван
уберечь ваши проекты от грехопадения с помощью интеграции ckeditor и filer. Он
добавляет в панель insert кнопку Filer, которая почти полностью идентична кнопке
Image, но загружает изображения в Filer.Установка$ pip install django-ckeditor-filerПотом следует добавить ‘ckeditor_filer’ в INSTALLED_APPSВ ulrs.py вашего проектаurl(r'^ckeditor-filer/', include('ckeditor_filer.urls')),И в settings.pyCKEDITOR_CONFIGS = {
    'default': {
    'toolbar_MyToolbar': [
        {
            'name': 'insert',
            'items': ['Image', 'Filer', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']
        },
    ],
    'toolbar': 'MyToolbar',
    'extraPlugins': 'filer'
    }
}Совместимость с djangocms-text-ckeditorCKEditor в Django CMS подключается с помощью плагина djangocms-text-ckeditor.
Модуль можно использовать и с ним. Для этого понадобиться создать символьную
сслыку на каталог статики плагинаln -s <STATIC_ROOT>/ckeditor/ckeditor/plugins/filer/ <STATIC_ROOT>/djangocms_text_ckeditor/ckeditor/plugins/filer/Или прописать alias в конфигурации вашего web-сервера. Например для Nginxlocation /static/djangocms_text_ckeditor/ckeditor/plugins/filer/ {
    alias <STATIC_ROOT>/ckeditor/ckeditor/plugins/filer/;
}История изменений1.0.4 (2017-01-06)При создании в filer каталога изображений “ckeditor” его владельцем становится первый суперпользователь;Изменена иконка;Исправлена пара меток в английской локализации.1.2.0 (2019-07-28)Поддержка Django 2.1.
Package: django_ckeditor_improved
CKEditor bundled as a Django app.This is a fork from https://github.com/espenak/django_ckeditorfiles which has a few changes:* Change to the default ckeditor image plugin to add figure and figcaption support* Fix to using CKEditro in inlinesInstall=======```$ pip install django_ckeditor_improved```Screenshots-------Figure with Figcaption Dialog:![Screenshot of figure caption dialog](/../master/docs/1_dialog.png?raw=true "Figure caption dialog")![Screenshot of figure with caption in editor](/../master/docs/2_editor.png?raw=true "Figure with caption in editor")![Screenshot of figure caption code](/../master/docs/3_code.png?raw=true "Figure caption code")CKEditors Inline![Screenshot of ckeditors in inlines](/../master/docs/ckeditors_inline.png?raw=true "Inline editors")Set Up-------#settings.py1. Image picker set up at /admin/media/imagepicker/2. Custom ckeditor css file loaded from /static/admin/ckeditor.css```pythonCKEDITOR_BASIC = {'skin': 'moono','toolbar_Basic': [['Source', '-', 'Bold', 'Italic']],'toolbar_Full': [['Format', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript','Superscript','SpellChecker', 'SpecialChar', 'Undo', 'Redo'],['NumberedList', 'BulletedList', 'Blockquote'],['Link', 'Unlink', 'Anchor'],['Image', 'Iframe','Flash', 'Table', 'HorizontalRule', 'PageBreak'],['PasteText', 'PasteFromWord', 'RemoveFormat'],['showblocks', 'Source', 'Maximize'],],'extraPlugins': 'magicline','magicline_everywhere': 'true','magicline_color': '#4fb2d3','toolbar': 'Full','height': 600,'width': 1000,'filebrowserWindowWidth': 940,'filebrowserWindowHeight': 725,'filebrowserImageBrowseUrl': '/admin/media/imagepicker/','forcePasteAsPlainText' : 'true',}```#admin.py```pythonclass PageAdmin(admin.ModelAdmin):form = PageForm```#forms.py```pythonfrom django.conf import settingsfrom ckeditorfiles.widgets import CKEditorWidgetclass PageForm(forms.ModelForm):class Meta:model = Pagewidgets = {'content': CKEditorWidget(config=settings.CKEDITOR_BASIC)}```See https://github.com/espenak/django_ckeditorfiles for further setup and configuration instructions
Package: django-ckeditor-widget
A CKEditor widget for Django that includes an admin mixin.How to useInstall using pip:pip install django-ckeditor-widgetThen use as any other widget:from django import forms
from ckeditor_widget.widgets import CKEditorWidget

class MyForm(forms.Form):
    body = forms.TextField(widget=CKEditorWidget)https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#specifying-widgetsMake sure that CKEditor is provided in static files asckeditor/ckeditor.js.AdminThe app conveniently provides an admin mixin that uses CKEditor for all text fields.
Simply inherit from the mixin:from django.contrib import admin
from ckeditor_widget.admin import CKEditorAdminMixin
from myapp import models

@admin.register(models.Product)
class ProductAdmin(CKEditorAdminMixin, admin.ModelAdmin):
    passAkternatively, specifyformfield_overrides:formfield_overrides = {
    models.TextField: {'widget': CKEditorWidget}
}
Package: django-cl2csv
django-cl2csv===cl2csv is a tiny Django app for adding export functionality to the built-in admin list views. Fields can be hidden from export. The name is short for "Change list to Comma Separated Values".Installation---1. Install via pip:`$ pip install django-cl2csv`2. Add "cl2csv" to your INSTALLED_APPS setting like this:```pythonINSTALLED_APPS = (...'cl2csv',)```Usage--```pythonfrom cl2csv.options import ExportModelAdminclass DVDAdmin(ExportModelAdmin):hide_from_export = ('secret_vote',)```
Package: django-clacks
Django ClacksThe unseen, silent tribute to those we have lost.django-clackscontains boilerplate code for working with the nonstandard HTTP headerX-Clacks-Overhead.You can find out more about theX-Clacks-Overheadheader here:https://xclacksoverhead.org/home/aboutInstallationDjango Clacks is onPyPI. Install it withpip install django-clacksor add it with your dependency manager.QuickstartAddclacks.middleware.ClacksMiddlewareto yourMIDDLEWAREsetting:MIDDLEWARE=[# ..."clacks.middleware.ClacksMiddleware",# ...]By default, all responses will now have a headerX-Clacks-Overhead, with the contentGNU Terry Pratchett.You can modify the names used with theCLACKS_NAMESsetting. The following setting:CLACKS_NAMES=["Terry Pratchett","Joe Armstrong",]Will result in anX-Clacks-Overheadheader containingGNU Terry Pratchett, Joe Armstrong.
Package: django-clamd
This project integrates python-clamd with Django for easy scanning files for viruses on uploadInstall>From PyPi with pip:pipinstalldjango-clamdoreasy_installdjango-clamdYou can also install development version direclty from GitHub:pipinstallgit+https://github.com/vstoykov/django-clamd.gitAditioanlly if you want translations to work you need to add it to installed apps.INSTALLED_APPS=(...'django_clamd',...)UsageYou can use it in forms:fromdjangoimportformsfromdjango_clamd.validatorsimportvalidate_file_infectionclassUploadForm(forms.Form):upload_file=forms.FileField(validators=[validate_file_infection])Or you can add it as validator directly in your model:fromdjango.dbimportmodelsfromdjango_clamd.validatorsimportvalidate_file_infectionclassFileModel(models.Model):document=models.FileField(validators=[validate_file_infection])You will have automatically scanning of upladed files in Django Admin
and also when create ModelForm’s for that model.ConfigurationBy defaultdjango-clamdtries to be smart and with good defaults.
You can still configure how to connect to Clamd. Default values are:CLAMD_SOCKET='/var/run/clamav/clamd.ctl'CLAMD_USE_TCP=FalseCLAMD_TCP_SOCKET=3310CLAMD_TCP_ADDR='127.0.0.1'Note: When you are running on Fedora or CentOS andclamav-scannerpackage is installed then default value forCLAMD_SOCKETis:CLAMD_SOCKET='/var/run/clamd.scan/clamd.sock'You also can disable virus scanning for development with:CLAMD_ENABLED=FalseNote: This is primary for make it easy to run a project on development without
the need of installing Clamd on devlopment machine.Licensedjango-clamdis released as open-source software under the LGPL license.
Package: django-class-auth-views
related packagesdjango-password-resethas class based views to reset
forgotten passwords by email confirmation.A reimplementation ofdjango.contrib.auth.viewsas class based views. Hopefully at some point this project or
something similar will make it into django proper.CurrentlyLoginViewandLogoutVieware implemented.Installationpip install django-class-auth-viewsBasic usageInstead of includingdjango.contrib.auth.logininto yoururls.py, just use the one provided by this project.urls.py:from class_based_auth_views.views import LoginView, LogoutView
urlpatterns = patterns('',
    url(r'^login/$', LoginView.as_view(form_class=EmailAsUsernameAuthenticationForm), name="login"),
    url(r'^logout/$', LogoutView.as_view(), name="logout"),
)Be aware that the logout view requires aPOSTto actually logout. So theregistration/logout.htmltemplate
should contain a form with a submit button.Extending LoginView ExampleNow that LoginView is based on generic class based views it is much easier to extend. Say you need to implement a
2 step login procedure with a one time password:from django.contrib.auth import login

class PhaseOneLoginView(LoginView):
    def form_valid(self, form):
        """
        Forces superusers to login in a 2 step process (One Time Password). Other users are logged in normally
        """
        user = form.get_user()
        if user.is_superuser:
            self.save_user(user)
            return HttpResponseRedirect(self.get_phase_two_url())
        else:
            login(self.request, user)
            return HttpResponseRedirect(self.get_success_url())

    def get_phase_two_url(self):
        return reverse('phase_two_login')

    def save_user(self, user):
        self.request.session['otp_user'] = user


class PhaseTwoLoginView(FormView):
    form_class = OTPTokenForm

    def get_user(self):
        return self.request.session.get('otp_user', None)

    def clean_user(self):
        if 'otp_user' in self.request.session:
            del self.request.session['otp_user']

    def form_valid(self, form):
        code = form.cleaned_data.get('code')
        user = self.get_user()
        login(request, user)
Package: django-class-based-auth-views
related packagesdjango-password-resethas class based views to reset
forgotten passwords by email confirmation.A reimplementation ofdjango.contrib.auth.viewsas class based views. Hopefully at some point this project or
something similar will make it into django proper.CurrentlyLoginViewandLogoutVieware implemented.Installationpip install django-class-based-auth-viewsBasic usageInstead of includingdjango.contrib.auth.logininto yoururls.py, just use the one provided by this project.urls.py:from class_based_auth_views.views import LoginView, LogoutView
urlpatterns = patterns('',
    url(r'^login/$', LoginView.as_view(form_class=EmailAsUsernameAuthenticationForm), name="login"),
    url(r'^logout/$', LogoutView.as_view(), name="logout"),
)Be aware that the logout view requires aPOSTto actually logout. So theregistration/logout.htmltemplate
should contain a form with a submit button.Extending LoginView ExampleNow that LoginView is based on generic class based views it is much easier to extend. Say you need to implement a
2 step login procedure with a one time password:from django.contrib.auth import login

class PhaseOneLoginView(LoginView):
    def form_valid(self, form):
        """
        Forces superusers to login in a 2 step process (One Time Password). Other users are logged in normally
        """
        user = form.get_user()
        if user.is_superuser:
            self.save_user(user)
            return HttpResponseRedirect(self.get_phase_two_url())
        else:
            login(self.request, user)
            return HttpResponseRedirect(self.get_success_url())

    def get_phase_two_url(self):
        return reverse('phase_two_login')

    def save_user(self, user):
        self.request.session['otp_user'] = user


class PhaseTwoLoginView(FormView):
    form_class = OTPTokenForm

    def get_user(self):
        return self.request.session.get('otp_user', None)

    def clean_user(self):
        if 'otp_user' in self.request.session:
            del self.request.session['otp_user']

    def form_valid(self, form):
        code = form.cleaned_data.get('code')
        user = self.get_user()
        login(request, user)