
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
A Django app to manage a blog driven by articles written using a markup language
#################### django-rstblog ####################
django-rstblog
is a Django app to manage a blog driven by articles written
using reStructuredText_, or Markdown_ or HTML_.
The basic idea is to adopt a hybrid publication model, halfway between a static site (pure html) and a dynamic one (all inside a DB, as Wordpress_).
In practice, the author writes his article locally, at his/her PC, then
Finally he calls an address (URL) of the site that allows him to upload the article. If the user is not logged in to the site, this address asks for user and password.
When the article is uploaded to the site, rstblog
uses its attributes
to classify it in the database. The content of the article is not loaded
in the DB; when necessary, it is resumed from the file uploaded on the site.
If the author wants to modify the content of the article (or its attributes), he edits the file on his PC, then upload it again.
What are the reasons that led us to this design choice? The following:
sqlite3
), without using big programs (in the sense
that they commit a lot of resources) as MySQL_, or PostgreSQL_, ...The features that the project currently implements are:
What are the cons to the use of this environment? You must have a good knowledge of Python/Django to:
With a virtual env activated, load the needed requirements::
pip install django-rstblog
In your project setting.py file:
1.1. Add rstblog
to your INSTALLED_APPS like this::
INSTALLED_APPS = [
...
'django.contrib.sites', # django's sites framework
'fullurl', # django-fullurl
...
'rstblog',
]
1.2. check for presence of login parameters::
...
LOGIN_REDIRECT_URL = '/' # It means home view
LOGIN_URL = '/login/'
...
1.3. Add a RSTBLOG configuration section like this::
RSTBLOG = {
'ARTICLES_DIR': os.path.join(BASE_DIR, "contents", "articles"),
'START_CONTENT_SIGNAL': '.. hic sunt leones', # BEWARE: string on a single line, without other characters
'languages': { 'en': 'englis', # 1st position is default language (functioning on py 3.6+)
'it': 'italian', },
'types': { 'article': 'article', # 1st position is default type (ok on py 3.6+)
'page': 'page', },
'FIELDS': {'markup',
'image',
'atype',
'language',
'title',
'created',
'modified',
'slug',
'category',
'published',
'offer_home',
'summary',
'authors',
'translation_of', },
'LIST_FIELDS': {'authors',},
'DT_FIELDS': { 'created',
'modified', },
'BOOL_FIELDS': { 'published',
'offer_home', },
'HOME_ITEMS': 10,
}
1.4 check for presence of SITE_ID::
...
SITE_ID = 1
...
In your project urls.py file:
2.1. include the rstblog
URLconf::
from django.urls import include
...
path('blog/', include('rstblog.urls', namespace='rstblog')),
2.2. check for presence of login url::
from django.contrib.auth import views as auth_views
...
path('login/', auth_views.LoginView.as_view(), name='login'),
path('logout/', auth_views.LogoutView, {'next_page': settings.LOGIN_REDIRECT_URL}, name='logout'),
...
About your project templates:
3.1. it must have a base.html template with this blocks used from rstblog templates::
{% block title %}
{% block meta %}
{% block link %}
{% block content %}
3.2. check for the presence of templates/registration/login.html
used in login.
In your project directory (where live manage.py), create the
directory contents/articles
Run python manage.py migrate
to create the rstblog
models.
Start the development server and visit http://127.0.0.1:8000/admin/
to create at least a Category
with value uncategorized to load articles
(you'll need the Admin app enabled).
Start the development server and visit http://127.0.0.1:8000/blog/ to show an empty list of articles.
Prepare an article on your PC as this one::
:markup: restructuredtext :title: article :language: en :slug: article :category: uncategorized
.. hic sunt leones
This is the article content.
And this is a secod paragraph of the article.
Visit http://127.0.0.1:8000/blog/load-article to load the previous article.
Now, if you visit again http://127.0.0.1:8000/blog/ you get a list with an article, and if you click on title, you'll show it (url: http://127.0.0.1:8000/blog/show/article)
This work is distributed under a
MIT License <https://opensource.org/licenses/MIT>
_
license.
This project is hosted on GitHub <https://github.com/l-dfa/django-rstblog.git>
_
Here you will find the complete environment
needed to develop the django-rstblog
app. It means: not only the app, but
even a minimal django project that hosts it.
And the full documentation is
hosted on Read the Docs <https://django-rstblog.readthedocs.io/>
_.
.. _Python: http://www.python.org/ .. _Django: https://www.djangoproject.com/ .. _MySQL: https://dev.mysql.com/downloads/ .. _PostgreSQL: https://www.postgresql.org/community/
.. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: https://daringfireball.net/projects/markdown/syntax .. _HTML: https://www.w3.org/TR/2017/REC-html52-20171214/ .. _Wordpress: https://wordpress.org/
.. [1] Not so few: with hundreds articles, everything reacts well.
FAQs
A Django app to manage a blog driven by articles written using a markup language
We found that django-rstblog 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.