Saravanan666/pypi-org huggingface dataset:
Package: django-selenium-pdfmaker
django-selenium-pdfmakerA Light Django Application which uses selenium to convert any html page to pdf. Using this approach you can easily make pdf of HTML pages with charts, tables and having their loaded Styles.InstallInstall easily via pip:pip install django-selenium-pdfmakerThen add package namedjango_selenium_pdfmakerto the INSTALLED_APPS of django.UsageTo use this module:fromdjango_selenium_pdfmaker.modulesimportPDFMakerpdfmaker=PDFMaker()res=pdfmaker.get_pdf_from_html(url='https://google.com',filename='output',write=True)andresincludes:{"status":true,"raw":"pdf in binary format","pdf":"ConvertedPDF instance if write flag is True.","message":""}statusistruewhen converting to pdf is successful, else will befalse.
For example when url path is unreachablestatuswill befalse.rawis binary data of pdf before storing in file. Will hold data ifstatus == truepdfisConvertedPDFobject ifstatusistrue.messagewill hold reason whystatusisfalse.SettingsCHROMEDRIVER_PATHOverride this variable to address the binary file of chromedriver of your own.SELENIUM_DELAYTo set delay on selenium requests (default 3). it will last that amount of time crawling
requested page before closing the session and create pdf of it.Installation ChromeBe noted to use this package google-chrome in your os. To install on ubuntu use following commads:sudocurl-sS-o-https://dl-ssl.google.com/linux/linux_signing_key.pub|sudoapt-keyaddsudobash-c"echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list"sudoapt-yupdatesudoapt-yinstallgoogle-chrome-stableExceptions1- Message: session not created: This version of ChromeDriver only supports Chrome version 90 Current browser version is 103.0.5060.53 with binary path /usr/bin/google-chromeIf you faced a problem like this, you should address the correct chromedriver binary in your codes.
To do that download the proper chromedriver version and place in your OS. Then address it with following option in
yoursettings.pyfile:CHROMEDRIVER_PATH='/usr/bin/chromedriver'Also you can use below script to automatically fix this problem:pipinstallwebdriver-managerThen use the driver in python as followsfromseleniumimportwebdriverfromwebdriver_manager.chromeimportChromeDriverManagerdriver=webdriver.Chrome(ChromeDriverManager().install())You can find the solutionlink
Package: django-selenosis
selenosisnounsel·e·no·sis /sɛliːˈnəʊsɪs/.poisoning due to excessive intake of selenium.django-selenosis (formerly django-admin-testutils) contains helpers to make
writing selenium unit tests for Django, and in particular the Django admin,
easier. It is based on the code that supported selenium unit tests indjango-nested-admin.The test runner is designed to work similarly to the Django framework’s own
runtests.py. The best guide on usage can be found in the unit tests for this
repository. Specifically, look atruntests.pyandselenosis/tests/test.py.Development and TestingInstallchromedriverYou can use homebrew or manually downloadchomedriver:homebrew:brew install --cask chromedriverManually:export PATH="$PWD:$PATH"
export CHROMEDRIVER_VERSION=$(curl -q http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
curl -O http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_mac64.zip
unzip chromedriver_mac64.zip
rm chromedriver_mac64.zip
chmod +x chromedriverRuntoxTo TestRun all tests:tox -- --selenium=chrome-headlessRun only a specified test environment:tox -e py37-dj22 -- --selenium=chrome-headlessIf you would like to observe the browser during a test run, simply remove-headlessin the above examples.
Package: django-sem
==================SignedEmailMessage==================SignedEmailMessage is a django package modifying the original, built-in EmailMessageby adding a possibility to add signing certificats.INITIAL ACTIONS===============1. Include SEM in your settings' installed apps.INSTALLED_APPS = (...'SEM',...)2. Add default charset and your authentication certificate to your settings.DEFAULT_CHARSET = 'utf-8'AUTH_CERT = "media/cert.pem"This is the highest available cert in cery-chain.TYPICAL USAGE=============from SEM import SEMailmsg = SEMail.SignedEmailMessage(subject, message_body, sender, recipient_list, attachments=attachments,from_key=from_key, from_cert=from_cert)msg.send()Where from_key and from_cert are routes to your key and cert:from_key = "media/mail_key.pem"from_cert = "media/mail.pem"REQUIREMENTS============Django >= 1.1.1M2Crypto >= 0.21.1CONTRIBUTION============This package is fully dependent and bases on M2Crpyto.
Package: django-semantic-admin
Django Semantic UI admin themeA completely free (MIT)Semantic UIadmin theme for Django. Actually, this is my 3rd admin theme for Django. The first was forgettable, and the second was withPure CSS. Pure CSS was great, but lacked JavaScript components.Semantic UI looks professional, and has great JavaScript components.Log in to the demo with usernamedjangoand passwordsemantic-admin:https://semantic-admin.comDocumentation is onGitHub Pages.Why?Looks professional, with a nice sidebar.Responsive design, eventables can stackresponsively on mobile.JavaScript datepicker and timepicker components.JavaScript selects, including multiple selections, which integrate well with Django autocomplete fields.Semantic UI has libraries forReactandVue, in addition to jQuery. This means this package can be used to style the admin, and custom views can be added with React or Vue components with the same style.InstallInstall from PyPI:pip install django-semantic-adminAdd tosettings.pybeforedjango.contrib.admin:INSTALLED_APPS=["semantic_admin","django.contrib.admin",...]Please remember to runpython manage.py collectstaticfor production deployments.UsageInstead ofadmin.ModelAdmin,admin.StackedInline, oradmin.TabularInline:classExampleStackedInline(admin.StackedInline):passclassExampleTabularInline(admin.TabularInline):passclassExampleAdmin(admin.ModelAdmin):inlines=(ExampleStackedInline,ExampleTabularInline)Inherit from theirSemanticequivalents:fromsemantic_adminimportSemanticModelAdmin,SemanticStackedInline,SemanticTabularInlineclassExampleStackedInline(SemanticStackedInline):passclassExampleTabularInline(SemanticTabularInline):passclassExampleAdmin(SemanticModelAdmin):inlines=(ExampleStackedInline,ExampleTabularInline)Awesome optional featuresOptional integration withdjango_filter:To enable this awesome feature, addfilterset_classto your Django admin:fromsemantic_admin.filtersimportSemanticFilterSetclassDemoFilter(SemanticFilterSet):classMeta:model=Demofields=("demo_field",)classDemoAdmin(SemanticModelAdmin):filterset_class=DemoFilterHTML preview in Djangoautocomplete_fields:To enable this awesome feature, add thesemantic_autocompleteproperty to your Django model:classDemoModel(models.Model):@propertydefsemantic_autocomplete(self):html=self.get_img()returnformat_html(html)Optional integration withdjango-import-export:To enable this awesome feature, instead ofimport_export.ImportExportModelAdmin, etc:fromimport_export.adminimportImportExportModelAdminclassExampleImportExportAdmin(ImportExportModelAdmin):passInherit from theirSemanticequivalents:fromsemantic_admin.contrib.import_export.adminimportSemanticImportExportModelAdminclassExampleImportExportAdmin(SemanticImportExportModelAdmin):passContributingInstall dependencies withpoetry install. The demo is built withinvoke tasks. For example,cd demo; invoke build.NotesPlease note, this package usesFomantic UIthe official community fork of Semantic UI.
Package: django-semanticui-form
Semantic UI for Django Form.A simple Django template tag to work withSemantic UIThis project is a fork fromdjango-bootstrap-formbytzangms.UsageAddsemanticuiformto yourINSTALLED_APPS.At the top of your template load in our template tags:{% load semanticui %}Then to render your form:<form class="ui form">
    <legend>Form Title</legend>
    {% csrf_token %}
    {{ form|semanticui }}
    <button class="ui button" type="submit">Submit</button>
</form>To make the form with inline element, change the|semanticuitemplate
tag to|semanticui_inline.:<form class="ui form">
    <legend>Form Title</legend>
    {% csrf_token %}
    {{ form|semanticui_inline }}
    <button class="ui button" type="submit">Submit</button>
    </form>DemoNot yet.
Package: django-sencha
RequirementsDjango1.5 or laterInstallation$ pip install django-senchaSetupJust add'sencha'to INSTALLED_APPS in
your settings.py:INSTALLED_APPS = (
    # ...

    'sencha',

    # ...
)Refer to Djangostatic filesdocumentation to configure and deploy static files.UsageYou can refer to sencha in your template with:{{ STATIC_URL }}sencha/<static_file_name>
Package: django-sendcloud2
提供django下sendcloud接口,支持python2/3，支持replytoQuick startInstall:pip install django_sendcloud2配置，在settings.py中:EMAIL_BACKEND = 'sendcloud.SendCloudBackend'
SENDCLOUD = {
    'email': {
        'api_user': '',
        'api_key': '',
    },
    'sms': {
        'sms_user': '',
        'sms_key': '',
        'muted': True
    },
}按照正常django方式发送邮件即可， 发送sms用`sms.send`
Package: django-send-email
# Email Command for DjangoThis app provides a simple management command for sending emails using your Django settings from the command line.## InstallPull down the app:$ pip install django-send-emailAdd it to your `INSTALLED_APPS`:INSTALLED_APPS = (...'django_send_email')## Sending Emailsdjango-send-email provides a management command named `send_email_message` to send emails from the command line.$ django-admin.py send_email_message subject message user1@example.com user2@example.comSubject, message and at least one recipient are required. You can pass `ADMINS` or `MANAGERS` as any one of the recipients and django-send-email will fetch the recipients from the proper Django setting.$ django-admin.py send_email_message subject message MANAGERS --bcc=ADMINSYou can also pass a filename as the message argument and django-send-email will use the file contents at the body of the email.$ django-admin.py send_email_message subject /path/to/message.txt user1@example.com user2@example.comAlternatively you can use `-` as the message argument to read from standard input.$ django-admin.py send_email_message subject - user1@example.com user2@example.com < /path/to/message.txt$ echo "some message text" | django-admin.py send_email_message subject - user1@example.com user2@example.com### Full UsageUsage: manage.py send_email_message [options] <subject> <message or file or "-"> <recipient1>...<recipientN>Sends an email to the specified email addresses.Message can be a string, filename or "-" to read from stdin.Options:-v VERBOSITY, --verbosity=VERBOSITYVerbosity level; 0=minimal output, 1=normal output,2=verbose output, 3=very verbose output--settings=SETTINGS   The Python path to a settings module, e.g."myproject.settings.main". If this isn't provided, theDJANGO_SETTINGS_MODULE environment variable will beused.--pythonpath=PYTHONPATHA directory to add to the Python path, e.g."/home/djangoprojects/myproject".--traceback           Print traceback on exception--noinput             Tells Django to NOT prompt the user for input of anykind.-f FROM_EMAIL, --from=FROM_EMAILEmail address to use to send emails from. Defaults touse settings.DEFAULT_FROM_EMAIL-r, --raise-error     Exceptions during the email sending process will beraised. Default to failing silently-n, --noprefix        Disables email subject prefix. Default behavior is toprepend settings.EMAIL_SUBJECT_PREFIX-b BCC, --bcc=BCC     Comma separated list of email addresses for BCC-c CC, --cc=CC        Comma separated list of email addresses for CC--version             show program's version number and exit-h, --help            show this help message and exit## TestingRunning the unittests is as simple as testing any other Django appdjango-admin.py test django_send_emailTo test the command on a development SMTP server, you can run the debug SMTP server from the `smtp` library.$ python -m smtpd -n -c DebuggingServer localhost:1025Just make sure that Django is configured correctly to point at localhost:1025
Package: django-sendfile2
This is a wrapper around web-server specific methods for sending files to web
clients.  This is useful when Django needs to check permissions associated
files, but does not want to serve the actual bytes of the file itself.  i.e. as
serving large files is not what Django is made for.Note this should not be used for regular file serving (e.g. CSS etc), only for
cases where you need Django to do some work before serving the actual file.Download:https://pypi.org/project/django-sendfile2/Source:https://github.com/moggers87/django-sendfile2Documentation:https://django-sendfile2.readthedocs.io/Supported Python VersionsPython 3.8, 3.9, 3.10, 3.11, and 3.10 are currently supported by this library.Supported Django VersionsDjango 3.2, 4.2, and 5.0 are currently supported by this library.ForkThis project is a fork ofdjango-sendfile. The original project
appears mostly dead and has a number of outstanding bugs (especially with
Python 3).FundingIf you have found django-sendfile2 to be useful and would like to see its continued
development, please considerbuying me a coffee.
Package: django-sendgrid
django-sendgrid is the easiest way to send e-mail with SendGrid. It uses the SendGrid SMTP API, as recommended.Although it’s rather simple to use, a example project is included to demonstrate usage.InstallationTo install with PyPi:pip install django-sendgridUsageAddsendgridto yourINSTALLED_APPS:INSTALLED_APPS = (
        # Existing apps
        "sendgrid",
)Add the following to yoursettings:SENDGRID_EMAIL_HOST = "smtp.sendgrid.net"
SENDGRID_EMAIL_PORT = 587
SENDGRID_EMAIL_USERNAME = "your_sendgrid_username"
SENDGRID_EMAIL_PASSWORD = "your_sendgrid_password"The API is similar to that of Django’s; create aSendGridEmailMessageand send it:>>> from sendgrid.message import SendGridEmailMessage
>>> email = SendGridEmailMessage('Subject', 'Body', 'ryan@ryanbalfanz.net', ['ryan@ryanbalfanz.net'])
>>> email.send()Additional Informationhttps://docs.djangoproject.com/en/1.3/topics/email/http://ryanbalfanz.github.com/django-sendgrid/http://pypi.python.org/pypi/django-sendgridhttp://djangopackages.com/packages/p/django-sendgrid/
Package: django-sendgrid-events
a simple app to provide and endpoind for and handle batch events from
SendGrid’s Event APIDocumentationDocumentation can be found online athttp://django-sendgrid-events.rtfd.org.Commercial SupportThis app, and many others like it, have been built in support of many of Eldarion’s
own sites, and sites of our clients. We would love to help you on your next project
so get in touch by dropping us a note atinfo@eldarion.com.
Package: django_sendgrid_local
Polls is a simple Django app to conduct Web-based polls. For each
question, visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_sendgrid',
]Include the polls URLconf in your project urls.py like this:url(r'^polls/', include('polls.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/polls/to participate in the poll.
Package: django-sendgrid-tracking
Django Sendgrid TrackingSendgrid Mail tracking for Django, store sendgrid tracking info into django models.This library allows to track the email sent using Sendgrid by storing information collected from a webhook into django models.Table of ContentsInstallationQuick StartCommon Use CasesAboutLicenseInstallationPrerequisitesPython version 3.6+Sendgrid account and API configurationEnvironment VariablesThis library usesdjango-sendgrid-v5which requires the following in yoursettings.py:EMAIL_BACKEND="sendgrid_backend.SendgridBackend"SENDGRID_API_KEY=os.environ["SENDGRID_API_KEY"]You can find more information and other settingshereInstall packageInstall the library with pip$pipinstalldjango-sendgrid-trackingQuick StartBelow the steps to start using django-sendgrid-tracking in your django project using your sendgrid account.Enable djangoTo enable django_sendgrid_tracking in your project you to add it to INSTALLED_APPS in your projects settings.py fileINSTALLED_APPS=(...'django_sendgrid_tracking'...)Run django migrate to create django-sendgrid-tracking related models$pythonmanage.pymigrateIn addition to that you need to expose for sendgrid the webhook endpointfromdjango.conf.urlsimporturlfromdjango_sendgrid_trackingimportviews...urlpatterns=[...url(r'sendgrid_webhook',views.event_hooks,name='sendgrid_webhook'),...]Enable sendgridNow you need to provide this endpoint URL to Sendgrid from the console
(Setting -> Mail Settings -> Event WebHook):In this case your webhook would be available athttp://www.mywebsite.com/sendgrid_webhook/N.B. remember to append a slash at the end of it since it will be a POST requestUse casesThe most simple use case would be to analyse internal statics or troubleshoot pitfall in the application flow.
As an example we can see for which reason a particular user didn’t confirm the email addresse.g.sent_email=SentMail.object.filter(to_email__mail=user.mail,categories__category_code='confirm_email')print(sent_email.open_flag)# True the user opened the emailprint(sent_email.click_flag)# False the user didn't click on the confirmation link# Maybe something is wrong with the content of the email?Another use case is in the case of referral program we can show the user the status of the sent invitatione.g.(example fromhttps://www.omologherifiuti.it)Aboutdjango-sendgrid-tracking is a library extracted from different website implemented by the author in djangoIf you’ve instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!Any contribution is appreciated!! (seeCONTRIBUTING)LicenseThe MIT License (MIT)
Package: django_sendmail_backend
Its a simple command line sendmail backend for Django# MotivationI like to usemsmtpto abstract the smtp server from my projects.
Because it is easy to set environment specifity mail server.# Installpip install django_sendmail_backend# UsageSet the EMAIL_BACKEND var in your settings moduleEMAIL_BACKEND = ‘django_sendmail_backend.backends.EmailBackend’# MTAYou will need any mta installed (like postfix or exim) and a executablesendmailcommand
in your bin path.Try to install [msmtp](http://msmtp.sourceforge.net/) for test## On Debian/Ubuntusudo apt-get install msmtp-mta
Package: django-sendmail-form
=====Django SendMail Form=====This Django app provides the ability to send an email containing info about an object, that is created using form.Example-----------1. Install the package using pip::pip install django-sendmail-form2. Add the "sendmail_form" to your INSTALLED_APPS setting::INSTALLED_APPS = (...'sendmail_form',)3. import the SendMailFormMixin::from sendmail_form.forms import SendMailFormMixin4. Inherit your form::class MyForm(SendMailFormMixin, forms.ModelForm):...subject_template = "My feedback on {site_name}"message_template = "Somebody left a message on {site}.<br>" \"You can read it in admin panel.<br>" \"{message}"5. Have fun!
Package: django-send-messages
# django-send-messages
A simple API to send messages，follow django mail design. It includes Yunpian backend and Wechat(weixin) backend. You can easily send sms message and wechat message by it. [Yunpian](http://www.yunpian.com) is a great sms cloud service. And [Wechat](https://mp.weixin.qq.com/) is the most famous social network in china.And it can easily be extended to other sms backend.Install``
pip install git+ssh://git@github.com/hwbuluo/django-send-messages.git
``UsageAddsmsto yourINSTALLED_APPSsetting and add aninclude('sms.urls')at any point in your url-conf.You can see the testproj for detail.Enjoy it!# About Contribution贡献代码指南我们非常欢迎大家来贡献代码，我们会向贡献者致以最诚挚的敬意,让我们一起创造出好用的开源云消息接入服务产品。目前我们只是引入了云片的短信服务，让Django开发者可以很容易的使用云片提供的服务进行短信发送，并提供了测试的mock backend，和接收云片的短信发送成功回执。但是还有一些云片的回调并未处理，具体可以参考[云片文档](http://www.yunpian.com/api/sms.html)，在view.py中进行添加。我们计划下一步引入微信的sendbackend，可以通过微信公众平台提供的模版消息接口，给指定人员发送消息，欢迎大家参与进来。一般可以通过在Github上提交[Pull Request](https://github.com/hwbuluo/django-send-messages)来贡献代码。## Pull Request要求代码规范遵从pep8，pythonic。代码格式提交前 请按 pep8 进行格式化。必须添加测试！- 如果没有测试，那么提交的补丁是不会通过的。创建feature分支- 最好不要从你的master分支提交 pull request。一个feature提交一个pull请求- 如果你的代码变更了多个操作，那就提交多个pull请求吧。清晰的commit历史- 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作，那么请把它们放到一起再提交pull请求。## 运行测试(Run tests)You can test the app:1. setup a virtualenv,and activate it.
``
virtualenv –distribute venv
``
2. install the dependency
``
pip install -r test-requirements.py
``
3. test it use py.test
``
py.test sms/tests.py
``
Package: django-sendpdf
Sendpdf is a simple Django app that can be used to generate PDF documents from html templates.It can handle images and css very well. The generated PDF can then be displayed in the browser for printing and saving.Alternatively, one can send the PDF to one or many email addresses.Has been tested with Django 3+. Versions prior to 2.0.0 has been tested with Django==1.9.Detailed documentation is in theofficial page.Checkout the latest code in the repowanderijames/django-sendpdfand use docker and docker compose to test its functionality.Quick startInstall django-sendpdf:$pipinstalldjango-sendpdfInstall wkhtmltopdf:Debian/Ubuntu:$sudoapt-getinstallwkhtmltopdfWarning!Version in debian/ubuntu repos have reduced functionality (because it compiled without the wkhtmltopdf QT patches), such as adding outlines, headers, footers, TOC etc. To use this options you should install static binary fromwkhtmltopdfsite or you can usethis script.Windows and other options: check wkhtmltopdfhomepagefor binary installersAdd “sendpdf” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'sendpdf',
)In your Django settings add the location of wkhtmltopdf, default location is/usr/local/bin/wkhtmltox/bin/wkhtmltopdf, like this:WKTHMLTOPDF_PATH = "/usr/local/bin/wkhtmltopdf"Include the sendpdf URLconf in your project urls.py like this:path(r'^sendpdf/', include('sendpdf.urls', namespace='sendpdf')),Runpython manage.py runserverto see some demos:Template exampleView PDF inlineDewnload PDFSend PDF
Package: django-sendsms
A simple api to send SMS messages with django. The api is structured the same way as Django’s own email api.Installationpip install django-sendsmsConfigure theSENDSMS_BACKEND(defaults to'sendsms.backends.console.SmsBackend'):SENDSMS_BACKEND = 'myapp.mysmsbackend.SmsBackend'Basic usageSending SMSs is like sending emails:from sendsms import api
api.send_sms(body='I can haz txt', from_phone='+41791111111', to=['+41791234567'])You can also make instances ofSmsMessage:from sendsms.message import SmsMessage
message = SmsMessage(body='lolcats make me hungry', from_phone='+41791111111', to=['+41791234567'])
message.send()Custom backendsCreating customSmsBackends:from sendsms.backends.base import BaseSmsBackend
import some.sms.delivery.api

class AwesomeSmsBackend(BaseSmsBackend):
    def send_messages(self, messages):
        for message in messages:
            for to in message.to:
                try:
                    some.sms.delivery.api.send(
                        message=message.body,
                        from_phone=message.from_phone,
                        to_phone=to,
                        flashing=message.flash
                    )
                except:
                    if not self.fail_silently:
                        raiseThen all you need to do is reference your backend in theSENDSMS_BACKENDsetting.Running testspython setup.py testOr better, install and run “tox”.ContributingPull requests are very welcome. Please make sure code is formatted using black and isort.
Package: django-sendsms-admin
A delivery backend for django-sendsms that delivers messages to the database instead of sending them. This is meant for
debugging. Also allows sending SMSs from the admin interface.Installationpip install django-sendsms-adminThen addsendsms_admintoINSTALLED_APPSand runsyncdbormigrate.
This already allows sending messages from admin. To enable the debug backend to
place all SMSs into the database:SENDSMS_BACKEND = 'sendsms_admin.backend.DatabaseSmsBackend'