Django-newsfeed (A news curator and newsletter subscription package deal for Django)

Django-newsfeed (A news curator and newsletter subscription package deal for Django)

django-newsfeed


https://travis-ci.com/saadmk11/django-newsfeed.svg?branch=master


What’s django-newsfeed?

django-newsfeed is a news curator and newsletter subscription package deal for django.
It is going to also be feeble to draw a news curator online page material which sends newsletters to their subscribers
also it’ll also be feeble to add a news subscription fragment to your online page material.

Aspects

  • Make monthly, weekly or on a regular foundation considerations with draft arena increase.
  • Make posts with rather about a categories.
  • Archive and demonstrate all of the failings for your online page material.
  • Newsletter e-mail subscription (ajax increase) with e-mail verification.
  • Newsletter e-mail unsubscription (ajax increase).
  • Sending newsletters for each and each arena to all of the subscribers.
  • Fully customizable templates.
  • Makes spend of Django’s interior instruments for sending e-mail.
  • Ambiance pleasant mass mailing increase.

Necessities

  • Python: 3.6, 3.7
  • Django: 2.2, 3.0, 3.1

Instance Venture

It is doubtless you’ll look the example project for this package deal right here.
It is a news-curator and newsletter subscription application that most effective makes spend of this package deal.
It also makes spend of celery, celery-beat and redis to send e-mail newsletters in the background.
The styles in the example project makes spend of bootstrap.

Documentation

Installation

Install django-newsfeed the spend of pip:

pip install django-newsfeed

Then add newsfeed to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'newsfeed',
]

Then add newsfeed to your tasks urls.py:

urlpatterns = [
    ...
    path('newsfeed/', include('newsfeed.urls', namespace='newsfeed')),
    ...
]

Utilization

Accessible views

We present these views out of the sector:

  • latest_issue: newsfeed/
  • issue_list: newsfeed/considerations/
  • issue_detail: newsfeed/considerations//
  • newsletter_subscribe: newsfeed/subscribe/
  • newsletter_subscription_confirm: newsfeed/subscribe/ascertain//
  • newsletter_unsubscribe: newsfeed/unsubscribe/

Templates

The elementary templates are provided for all of the views and emails with django-newsfeed.
It is doubtless you’ll override the templates to add your dangle manufacture.

Just appropriate add newsfeed itemizing interior your templates itemizing
add templates with the identical name because the confirmed tree beneath.
extra on template overriding on the django doctors

Template Tree for django-newfeed:

templates
    └── newsfeed
        ├── incorrect.html
        ├── e-mail
        │     ├── email_verification.html
        │     ├── email_verification_subject.txt
        │     ├── email_verification.txt
        │     └── newsletter_email.html
        ├── issue_detail.html
        ├── issue_list.html
        ├── issue_posts.html
        ├── latest_issue.html
        ├── messages.html
        ├── newsletter_subscribe.html
        ├── newsletter_subscription_confirm.html
        ├── newsletter_unsubscribe.html
        └── subscription_form.html

Subscription affirmation Email

We send subscription affirmation e-mail to the fresh subscribers.
that you can override these template to interchange the styles:

templates
    └── newsfeed
        ├── e-mail
        │     ├── email_verification.html
        │     ├── email_verification_subject.txt
        │     ├── email_verification.txt

Admin Actions

These actions will be found in from the admin panel:

  • publish considerations: The selected considerations shall be printed.
  • label considerations as draft: The selected considerations shall be marked as draft.
  • veil posts: The selected posts shall be hidden from the failings.
  • draw posts viewed: The selected posts will viewed on the failings.
  • send newsletters: Sends selected newsletters to all of the subscribers.

(send newsletters action ought to be overridden to spend a background project queue.
Peep the example project to peep an example the spend of celery)

Send Email Newsletter

We present a category to address sending e-mail newsletters to the subscribers.
We draw now not present any background project queue by default. However it in all fairness easy to region it up.

Peep the example project to peep an example the spend of celery and celery-beat.

It is doubtless you’ll override this template to interchange the kind of the newsletter:

templates
    └── newsfeed
        ├── e-mail
        │     └── newsletter_email.html

Settings Configuration

The beneath settings will be found in for django-newsfeed.
Add these settings to your tasks settings.py as required.

NEWSFEED_SITE_BASE_URL

  • default: http://127.0.0.1: 8000 (your sites URL)
  • required: Appropriate

This settings is required. You want to add your internet sites URL right here in production.
This is feeble to generate affirmation URL and unsubscribe URL for the emails.

NEWSFEED_EMAIL_CONFIRMATION_EXPIRE_DAYS

  • default: 3 (after chance of days affirmation link expires)
  • required: False

This settings tells django-newsfeed to lag out the affirmation link in specified chance of days.

NEWSFEED_EMAIL_BATCH_SIZE

  • default: 0 (chance of emails per batch)
  • required: False

This settings is helpful when there are a quantity of subscribers.
This settings tells django-newsfeed to send the specified chance of emails per batch.
if its zero (0) then all of the emails shall be sent collectively.

NEWSFEED_EMAIL_BATCH_WAIT

  • default: 0 (in seconds)
  • required: False

This settings tells django-newsfeed how long it’ll wait between
each and each batch of newsletter e-mail sent.

NEWSFEED_SUBSCRIPTION_REDIRECT_URL

  • default: /newsfeed/considerations/
  • required: False

This is most effective required whereas you usually are now not the spend of ajax keep a query to on the subscription develop.
The JavaScript code for ajax is incorporated with django-newsfeed and on by default.

NEWSFEED_UNSUBSCRIPTION_REDIRECT_URL

  • default: /newsfeed/considerations/
  • required: False

This is most effective required whereas you usually are now not the spend of ajax keep a query to on the unsubscription develop.
The JavaScript code for ajax is incorporated with django-newsfeed and on by default.

Contribute

Peep CONTRIBUTING.rst
for knowledge about contributing to django-newsfeed.

Learn Extra