Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django Blog Zinnia 2022 / Django 4.0 Support PR #587

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/django-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Django CI

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ django-apps-src
docs/build
demo/demo.db*
django_blog_zinnia.egg-info/
.idea
dist/
demo_static/
26 changes: 26 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = ">=2.2"
django-contrib-comments = "~=2.1.0"
django-mptt = "~=0.13.4"
django-xmlrpc = { git = "https://github.com/arrobalytics/django-xmlrpc.git" }
django-tagging = { git = "https://github.com/arrobalytics/django-tagging.git" }
mots-vides = { git = "https://github.com/arrobalytics/mots-vides.git" }
beautifulsoup4 = "~=4.3"
regex = ">=2021.11.10"
pillow = "~=8.4.0"
markdown = "~=3.3.6"
textile = "~=4.0.2"
pyparsing = "~=3.0.6"

[dev-packages]
sphinx = "*"
pipenv-setup = "*"
gunicorn = "*"

[requires]
python_version = "3.9"
868 changes: 868 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

88 changes: 69 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,62 @@
.. figure:: zinnia/static/zinnia/logo/dbz_logo_text.png
:scale: 50
:align: center


This project is a friendly fork of the `original Django Blog Zinnia`_ project by Julien Fache `@Fantomas42`_.

Despite multiple attempts to contact `Julien Fache`_, the original Zinnia repository
is no longer active and maintained by its author. Virtually no activity since March 2020
has been recorded, and the project is no longer compatible with modern versions of Django 3 & 4.\

In order to recover the project's legacy, and to provide a community maintained
alternative, this fork this has been created.\

Please head over to `Docs.DjangoBlogZinnia.com`_ for documentation and
other resources.\

Installation
============

Using pip:

``pip install git+https://github.com/arrobalytics/[email protected]``.

Using pipenv, add Django Blog Zinnia to your Pipfile dependencies:

``django-blog-zinnia = { git = "https://github.com/arrobalytics/[email protected]" }``

Then run:

``pipenv install``


RoadMap
=======

As a priority, this fork will be focused on updating Zinnia to work with modern versions of Django and
in removing/replacing all deprecated features.

Once the project is updated, the following activities are planned for future releases:

* Inspection, evaluation and update of Zinnia's dependencies.
* Extension of Entry Model to create and support multiple image sizes for SEO and performance purposes.
* Implementation of a browser-based Entry editor to eliminate the need to write plain Markdown on the Django Admin site for creating Entries.
* Develop a new Zinnia default theme based on modern CSS frameworks such as Bulma, Bootstrap, etc.
* Update Tests and make use of GitHub actions for testing.
* Update documentation.

===================================
Django Blog Zinnia |latest-version|
Django Blog Zinnia
===================================

|travis-develop| |coverage-develop|

Simple yet powerful and really extendable application for managing a blog
within your Django Web site.
Simple yet powerful and really extendable application for managing a blog within your Django Web site.

Django Blog Zinnia is a community maintained fork of the abandoned Django Blog Zinnia project by `@Fantomas42`_.
Zinnia has been made for publishing Weblog entries and designed to do it well.

Basically any feature that can be provided by another reusable app has been
left out.
Why should we re-implement something that is already done and reviewed by
others and tested?

|paypal|
Basically any feature that can be provided by another reusable app has been left out.
Why should we re-implement something that is already done and reviewed by others and tested?

Features
========
Expand Down Expand Up @@ -54,10 +96,13 @@ More than a long speech, here the list of the main features:
* `Compass`_ and `Sass3`_ integration
* `Windows Live Writer`_ compatibility




Examples
========

Take a look at the online demo at: http://demo.django-blog-zinnia.com/
Take a look at the online demo at: http://demo.djangoblogzinnia.com/
or you can visit these websites who use Zinnia.

* `Fantomas' side`_
Expand Down Expand Up @@ -95,9 +140,10 @@ More information and help available at these URLs:
.. |paypal| image:: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif
:alt: Make a free donation with Paypal to encourage the development
:target: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=68T48HR8KK9KG
.. _`Sitemaps`: http://docs.django-blog-zinnia.com/en/latest/getting-started/configuration.html#module-zinnia.sitemaps
.. _`Advanced search engine`: http://docs.django-blog-zinnia.com/en/latest/topics/search_engines.html
.. _`Custom templates for various contents`: http://docs.django-blog-zinnia.com/en/latest/getting-started/configuration.html#templates-for-entries

.. _`Sitemaps`: http://docs.djangoblogzinnia.com/en/latest/getting-started/configuration.html#module-zinnia.sitemaps
.. _`Advanced search engine`: http://docs.djangoblogzinnia.com/en/latest/topics/search_engines.html
.. _`Custom templates for various contents`: http://docs.djangoblogzinnia.com/en/latest/getting-started/configuration.html#templates-for-entries
.. _`Markdown`: http://daringfireball.net/projects/markdown/
.. _`Textile`: http://redcloth.org/hobix.com/textile/
.. _`reStructuredText`: http://docutils.sourceforge.net/rst.html
Expand All @@ -108,7 +154,7 @@ More information and help available at these URLs:
.. _`Bit.ly`: https://github.com/Fantomas42/zinnia-url-shortener-bitly
.. _`Twitter`: https://github.com/Fantomas42/zinnia-twitter
.. _`Gravatar`: http://gravatar.com/
.. _`Django-CMS`: http://docs.django-blog-zinnia.com/en/latest/getting-started/configuration.html#django-cms
.. _`Django-CMS`: http://docs.djangoblogzinnia.com/en/latest/getting-started/configuration.html#django-cms
.. _`Entry model extendable`: http://django-blog-zinnia.rtfd.org/extending-entry
.. _`WYMeditor`: https://github.com/django-blog-zinnia/zinnia-wysiwyg-wymeditor
.. _`TinyMCE`: https://github.com/django-blog-zinnia/zinnia-wysiwyg-tinymce
Expand All @@ -126,9 +172,13 @@ More information and help available at these URLs:
.. _`Programeria`: https://programeria.pl/
.. _`Tihomir Blajev Blog`: http://www.tihoblajev.com/weblog/
.. _`Branchspot`: https://www.branchspot.com/blog/
.. _`Code repository`: https://github.com/Fantomas42/django-blog-zinnia
.. _`Documentation`: http://docs.django-blog-zinnia.com/
.. _`Code repository`: https://github.com/arrobalytics/django-blog-zinnia
.. _`Documentation`: http://docs.djangoblogzinnia.com/
.. _`Travis CI server`: http://travis-ci.org/Fantomas42/django-blog-zinnia
.. _`Coverage report`: https://coveralls.io/r/Fantomas42/django-blog-zinnia
.. _`Google Group`: http://groups.google.com/group/django-blog-zinnia/
.. _`GitHub Issues`: https://github.com/Fantomas42/django-blog-zinnia/issues/
.. _`GitHub Issues`: https://github.com/arrobalytics/django-blog-zinnia/issues/
.. _`original Django Blog Zinnia`: https://github.com/Fantomas42/django-blog-zinnia/
.. _`@Fantomas42`: https://github.com/Fantomas42/
.. _`Julien Fache`: https://github.com/Fantomas42/
.. _`Docs.DjangoBlogZinnia.com`: https://docs.djangoblogzinnia.com
50 changes: 37 additions & 13 deletions demo/settings.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
"""Settings for Zinnia Demo"""
import logging
import os

logger = logging.getLogger(__name__)

gettext = lambda s: s # noqa

DEBUG = True
DEBUG = False
ALLOWED_HOSTS = [
'127.0.0.1'
]

DATABASES = {'default':
{'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(os.path.dirname(__file__), 'demo.db')}
}
DATABASES = {
'default':
{
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(os.path.dirname(__file__), 'demo.db')
}
}

TIME_ZONE = 'Europe/Paris'
TIME_ZONE = 'US/Eastern'

STATIC_URL = '/static/'
STATIC_ROOT = './demo_static/'

STATIC_URL = os.environ.get('STATIC_URL')
if not STATIC_URL:
logger.warning(
msg=f'WARNING: STATIC_URL is /static/'
)
STATIC_URL = '/static/'

MEDIA_URL = '/media/'

SECRET_KEY = 'jo-1rzm(%sf)3#n+fb7h955yu$3(pt63abhi12_t7e^^5q8dyw'
SECRET_KEY = os.environ.get('SECRET_KEY')
if not SECRET_KEY:
logger.warning(
msg=f'WARNING: SECRET_KEY environment variable not set. '
f'Using insecure configuration.'
)
SECRET_KEY = 'NeverUseThisSecretKey1234'

USE_TZ = True
USE_I18N = True
Expand Down Expand Up @@ -47,11 +69,11 @@
('tr', gettext('Turkish')),
('sv', gettext('Swedish')),
('is', gettext('Icelandic')),
('hr_HR', gettext('Croatian')),
('pt_BR', gettext('Brazilian Portuguese')),
('fa_IR', gettext('Persian')),
('fi_FI', gettext('Finnish')),
('uk_UA', gettext('Ukrainian')),
# ('hr_HR', gettext('Croatian')),
# ('pt_BR', gettext('Brazilian Portuguese')),
# ('fa_IR', gettext('Persian')),
# ('fi_FI', gettext('Finnish')),
# ('uk_UA', gettext('Ukrainian')),
('zh-hans', gettext('Simplified Chinese')),
)

Expand Down Expand Up @@ -100,3 +122,5 @@
'tagging',
'zinnia'
)

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
48 changes: 21 additions & 27 deletions demo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@
from functools import partial

from django.conf import settings
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
from django.contrib.sitemaps.views import index
from django.contrib.sitemaps.views import sitemap
from django.views.defaults import bad_request
from django.views.defaults import page_not_found
from django.views.defaults import permission_denied
from django.views.defaults import server_error
from django.urls import include, re_path
from django.views.defaults import bad_request, page_not_found, permission_denied, server_error
from django.views.generic.base import RedirectView
from django.views.static import serve

from django_xmlrpc.views import handle_xmlrpc

from zinnia.sitemaps import AuthorSitemap
from zinnia.sitemaps import CategorySitemap
from zinnia.sitemaps import EntrySitemap
from zinnia.sitemaps import TagSitemap


urlpatterns = [
url(r'^$', RedirectView.as_view(url='/blog/', permanent=True)),
url(r'^blog/', include('zinnia.urls')),
url(r'^comments/', include('django_comments.urls')),
url(r'^xmlrpc/$', handle_xmlrpc),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', admin.site.urls),
re_path(r'^$', RedirectView.as_view(url='/blog/', permanent=True)),
re_path(r'^blog/', include('zinnia.urls')),
re_path(r'^comments/', include('django_comments.urls')),
re_path(r'^xmlrpc/$', handle_xmlrpc),
re_path(r'^i18n/', include('django.conf.urls.i18n')),
re_path(r'^admin/doc/', include('django.contrib.admindocs.urls')),
re_path(r'^admin/', admin.site.urls),
]

sitemaps = {
Expand All @@ -40,23 +34,23 @@
}

urlpatterns += [
url(r'^sitemap.xml$',
index,
{'sitemaps': sitemaps}),
url(r'^sitemap-(?P<section>.+)\.xml$',
sitemap,
{'sitemaps': sitemaps}),
re_path(r'^sitemap.xml$',
index,
{'sitemaps': sitemaps}),
re_path(r'^sitemap-(?P<section>.+)\.xml$',
sitemap,
{'sitemaps': sitemaps}),
]

urlpatterns += [
url(r'^400/$', partial(bad_request, exception=None)),
url(r'^403/$', partial(permission_denied, exception=None)),
url(r'^404/$', partial(page_not_found, exception=None)),
url(r'^500/$', server_error),
re_path(r'^400/$', partial(bad_request, exception=None)),
re_path(r'^403/$', partial(permission_denied, exception=None)),
re_path(r'^404/$', partial(page_not_found, exception=None)),
re_path(r'^500/$', server_error),
]

if settings.DEBUG:
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve,
{'document_root': settings.MEDIA_ROOT})
re_path(r'^media/(?P<path>.*)$', serve,
{'document_root': settings.MEDIA_ROOT})
]
7 changes: 7 additions & 0 deletions demo/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo.settings')

application = get_wsgi_application()
Loading