
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Blogging application for your Django site
Install from PyPi:
pip install django-xblog
Using git:
mkdir blog_project
cd blog_project
virtualenv .
. bin/activate
git clone git@github.com:rubeon/django-xblog.git
cd django-xblog
python setup install
This will install xblog and its requirements.
After the above, go through the usual process:
django-admin startproject mysite
cd mysite/
vi mysite/settings
Add the dependencies to INSTALLED_APPS
:
INSTALLED_APPS = [
...
# following are for xblog
'django.contrib.sites',
'markdown_deux',
'xblog',
]
# Define a site, if not done already!
SITE_ID=1
MIDDLEWARE = [
# add sites middleware
# ...
'django.contrib.sites.middleware.CurrentSiteMiddleware',
]
./manage.py migrate
./manage.py createsuperuser --username=admin --email=admin@example.com
Password:
Password (again):
Superuser created successfully.
./manage.py runserver
Add a place to your site's root urls.py
reach your blog, and don't forget to
add the xblog
namespace:
from django.urls import path, include
import xblog.urls
urlpatterns = [
path('admin/', admin.site.urls),
path('blog/', include(xblog.urls, namespace="xblog"),
]
XBlog uses the Django authentication framework to keep track of users. Users
are linked to Authors
, which can serve as the User profile model.
Author profiles are created automatically in the User
model's post_save
signal. See xblog/models.py:create_profile
for reference.
XBlog defines the following content blocks:
maincontent
- the main Blog content with archives, posts, etc.
rightnav
- Blog roll, archive links, etc.
leftnav
- navigation block including ...(FIXME: whut?)
extrahead
- adds meta tags depending on the content being shown:
<title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title>
{% block extrahead %}{% endblock %}
subpagetitle
- returns title of article or archive<title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title>
pagestyle
- can be placed in body
tag for CSS styling:<body class="{% block pagestyle}{% endblock %}">
blogheaders
- Returns metadata about blog, such as EditURI, author, etc., for you HTML <head>
section
navigation
- Can be pulled into your navigation block to allow blog-specific navigation elements:
<nav>
<ul>
<li>Top</li>
{% block navigation %}{% endblock %}
</ul>
</nav>
FAQs
A full-featured blogging application for your Django site
We found that django-xblog 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.