Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Marcus is billingual blog engine, written Ivan Sagalaev (https://softwaremaniacs.org/about/).
This fork over augmented and has the following features:
.. image:: https://raw.github.com/adw0rd/marcus/master/docs/screenshots/thumbnails/articles.png :target: https://github.com/adw0rd/marcus/blob/master/docs/screenshots/articles.png .. image:: https://raw.github.com/adw0rd/marcus/master/docs/screenshots/thumbnails/article.png :target: https://github.com/adw0rd/marcus/blob/master/docs/screenshots/article.png .. image:: https://raw.github.com/adw0rd/marcus/master/docs/screenshots/thumbnails/admin_articles.png :target: https://github.com/adw0rd/marcus/blob/master/docs/screenshots/admin_articles.png .. image:: https://raw.github.com/adw0rd/marcus/master/docs/screenshots/thumbnails/admin_article.png :target: https://github.com/adw0rd/marcus/blob/master/docs/screenshots/admin_article.png
https://pypi.python.org/pypi/django-marcus ::
mkvirtualenv marcus
pip install --process-dependency-links django-marcus # use "--process-dependency-links" for pip>=1.5
django-admin.py startproject <project_name>
Add to settings.py
::
import os
import imp
from django.utils.translation import ugettext_lazy as _
PROJECT_ROOT = os.path.dirname(__file__)
PROJECT_NAME = os.path.basename(PROJECT_ROOT)
STORAGE_ROOT = os.path.join('/storage', PROJECT_NAME)
LOCALE_PATHS = (
os.path.join(imp.find_module('marcus')[1], 'locale'),
)
ADMINS = (
('Admin', 'admin@example.com'),
)
// Please setup settings.MANAGERS for notify about new comments
MANAGERS = ADMINS
MARCUS_PAGINATE_BY = 20
MARCUS_ARTICLES_ON_INDEX = 10
MARCUS_COMMENTS_ON_INDEX = 10
MARCUS_COMMENT_EXCERPTS_ON_INDEX = 2
MARCUS_ITEMS_IN_FEED = 20
MARCUS_AUTHOR_ID = 1
MARCUS_TAG_MINIMUM_ARTICLES = 0
# Specify blog names:
MARCUS_TITLE = _('Blog')
MARCUS_SUBTITLE = _('Sample blog')
MARCUS_DESCRIPTION = _('')
MARCUS_KEYWORDS = _('')
# You can specify extras for markdown:
MARCUS_MARKDOWN_EXTRAS = ['code-friendly', 'wiki-tables']
# Specify a fields which will used in search:
MARCUS_SEARCH_FIELDS = [
'slug', 'title_ru', 'title_en', 'text_ru', 'text_en',
'categories__slug', 'categories__title_ru', 'categories__title_en',
]
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'marcus.context_processors.marcus_context',
],
},
},
]
MEDIA_ROOT = os.path.join(STORAGE_ROOT, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(STORAGE_ROOT, 'static')
STATIC_URL = '/static/'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'marcus'
)
Add to urls.py
::
from django.urls import include, path
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),
path('', include(('marcus.urls', 'marcus')), namespace='marcus'),
]
urlpatterns += staticfiles_urlpatterns()
And run so::
python ./manage.py runserver 8000
Marcus includes "wordpress_importer" it is command that imports your entries from the Wordpress to the Marcus. It has a built-in pipelines for additional filtering data. ::
MARCUS_WORDPRESS_IMPORTER = {
'ARTICLE_PIPELINES': (
'marcus.wordpress_importer.pipelines.CodecolorerToHighlightJsPipeline',
'marcus.wordpress_importer.pipelines.WpContentUploadsToMediaPipeline',
'marcus.wordpress_importer.pipelines.BbCodeDetector',
'marcus.wordpress_importer.pipelines.EscapeTheUnderscore',
# 'marcus.wordpress_importer.pipelines.ChangeUrlToArticleForImagePipeline',
# 'marcus.wordpress_importer.pipelines.RemoveImgClassPipeline',
# 'marcus.wordpress_importer.pipelines.HtmlToMarkdownPipeline',
),
# 'CATEGORY_PIPELINES': tuple(),
# 'TAG_PIPELINES': tuple(),
'COMMENT_PIPELINES': (
'marcus.wordpress_importer.pipelines.CodecolorerToHighlightJsPipeline',
),
'ALLOW_DOMAINS': ( # Used to determine the internal domain to import only local "wp-content/uploads", etc.
'my-old-blog-on-wordpress.org',
'www.my-old-blog-on-wordpress.org',
),
}
::
django-admin.py startproject project
cd project
pip install django-marcus
# Copy the settings to settings.py and you urls to you urls.py described above
python ./manage.py migrate
python ./manage.py createsuperuser
python ./manage.py runserver 8000
If you use MySQL and have problem with open an article by URL, it is likely that you did not work CONVERT_TZ
, it can be solved as follows::
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
BSD licensed.
FAQs
Bilingual blog on Django
We found that django-marcus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.