Configuration
DJ Press Settings
In your settings.py
file, create a DJPRESS_SETTINGS
dictionary to configure your blog. Here’s a basic example:
# DJPress settings
DJPRESS_SETTINGS = {
"SITE_TITLE": "My Awesome Blog",
"POST_PREFIX": "{{ year }}/{{ month }}",
}
Available Settings
Settings are grouped by functionality:
URL Structure
Setting |
Type |
Default |
Description |
---|---|---|---|
|
str |
|
Defines URL structure for posts. Use placeholders like |
|
bool |
|
Enable/disable date-based archives. |
|
str |
|
Prefix for archive URLs. |
|
bool |
|
Enable/disable category pages. |
|
str |
|
Prefix for category URLs. |
|
bool |
|
Enable/disable tag pages. |
|
str |
|
Prefix for tag URLs. |
|
bool |
|
Enable/disable author pages. |
|
str |
|
Prefix for author URLs. |
|
bool |
|
Enable/disable RSS feed. |
|
str |
|
Path for RSS feed. |
Content Display
Setting |
Type |
Default |
Description |
---|---|---|---|
|
str |
|
Website title used in templates. |
|
str |
|
Website description for metadata. |
|
int |
|
Number of posts displayed per page. |
|
str |
|
Text for “Read more” links. |
|
str |
|
HTML comment that marks where to truncate content. |
|
bool |
|
Enable/disable microformats in HTML. |
Media Settings
Setting |
Type |
Default |
Description |
---|---|---|---|
|
str |
|
Path pattern for uploaded files. |
Markdown Configuration
Setting |
Type |
Default |
Description |
---|---|---|---|
|
list |
|
List of Python-Markdown extensions to enable. |
|
dict |
|
Configuration options for markdown extensions. |
|
str |
|
Path to markdown renderer function. |
Caching
Setting |
Type |
Default |
Description |
---|---|---|---|
|
bool |
|
Enable/disable caching for categories. |
|
bool |
|
Enable/disable caching for tags. |
|
bool |
|
Enable/disable caching for recent posts. |
|
int |
|
Maximum number of tags to query for auto-suggestions. |
Plugin System
Setting |
Type |
Default |
Description |
---|---|---|---|
|
list |
|
List of plugin module paths to enable. |
|
dict |
|
Configuration options for plugins. |
Example Configurations
Minimal Blog
DJPRESS_SETTINGS = {
"SITE_TITLE": "My Personal Blog",
"POST_PREFIX": "{{ year }}/{{ month }}",
"THEME": "default",
}
News Site with Categories
DJPRESS_SETTINGS = {
"SITE_TITLE": "Daily News",
"POST_PREFIX": "news",
"CATEGORY_PREFIX": "section",
"RECENT_PUBLISHED_POSTS_COUNT": 10,
"THEME": "simple",
}
Technical Documentation Site
DJPRESS_SETTINGS = {
"SITE_TITLE": "Tech Docs",
"POST_PREFIX": "articles",
"MARKDOWN_EXTENSIONS": ["codehilite", "fenced_code", "tables"],
"MARKDOWN_EXTENSION_CONFIGS": {
"codehilite": {"css_class": "highlight", "linenums": True}
},
"CACHE_RECENT_PUBLISHED_POSTS": True,
}
Themes
There are two themes included with DJ Press: “default” and “simple”. They can be configured as follows:
# DJPress settings
DJPRESS_SETTINGS = {
"THEME": "simple",
}
To create your own theme, please read the Theme documentation