Simple Django Blog app using Markdown
Project description
# Simple Django Blog
Simple Django Blog app using Markdown
* Free software: MIT license
* Documentation: https://djcms-blog.readthedocs.io.
## Features
* Works on pure Django
* Markdown blog post format
* Built-in template
* Multiple languages support
* SEO tags supported to customize
## Usage
### Install
Add the following apps to your INSTALLED_APPS in `settings.py`
```
INSTALLED_APPS += [
'django.contrib.sitemaps',
'dj_markdown',
'simplemde',
'django.contrib.humanize',
'djcms_blog',
]
```
Add `django.middleware.locale.LocaleMiddleware` to MIDDLEWARE
```
MIDDLEWARE += [
'django.middleware.locale.LocaleMiddleware',
]
```
Define default language and supported languages.
```
LANGUAGE_CODE = 'en'
LANGUAGES = [
('es', 'ES'),
('en', 'EN'),
]
```
Update your `urls.py` adding blog urls.
```
from django.conf.urls.i18n import i18n_patterns
from django.contrib.sitemaps.views import sitemap
from djcms_blog.sitemaps import PostsSitemap
sitemaps = {
'blog': PostsSitemap,
}
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='sitemap'),
]
urlpatterns += i18n_patterns(
url(r'^', include('djcms_blog.urls')),
)
```
## Configuration
You can define the following blog settings in your settings.
**DEFAULT_BLOG_ID** Define the default blog id to be used in the urls and links.
**DEFAULT_URL** URL to open the blog
**BLOG_TITLE** HTML title
**ROOT_TITLE** Title for links
**DJCMS_BLOG_CACHE_TIME** Cache time used in public views.
**MARKDOWN_CODE_CSS_THEME** Code theme for markdown code in the blog.
**DEFAULT_COVER_IMAGE** Cover image used in blog
**DEFAULT_NAVBAR_IMAGE** Image used as icon in navigation
### Example
In `settings.py`
```
# Blog config
DJCMS_BLOG_CACHE_TIME = 0
DEFAULT_BLOG_ID = 1
```
## Contributing
Install dev dependencies
```
pip install -r requirements_dev.txt
```
Run tests
```
pytest . --cov=. --cov-report=term-missing
```
Static Analysis
```
flake8 .
```
## Credits
This package was created with **Cookiecutter** and the `audreyr/cookiecutter-pypackage` project template.
# History
0.1.0 (2018-06-05)
------------------
* First release on PyPI.
Simple Django Blog app using Markdown
* Free software: MIT license
* Documentation: https://djcms-blog.readthedocs.io.
## Features
* Works on pure Django
* Markdown blog post format
* Built-in template
* Multiple languages support
* SEO tags supported to customize
## Usage
### Install
Add the following apps to your INSTALLED_APPS in `settings.py`
```
INSTALLED_APPS += [
'django.contrib.sitemaps',
'dj_markdown',
'simplemde',
'django.contrib.humanize',
'djcms_blog',
]
```
Add `django.middleware.locale.LocaleMiddleware` to MIDDLEWARE
```
MIDDLEWARE += [
'django.middleware.locale.LocaleMiddleware',
]
```
Define default language and supported languages.
```
LANGUAGE_CODE = 'en'
LANGUAGES = [
('es', 'ES'),
('en', 'EN'),
]
```
Update your `urls.py` adding blog urls.
```
from django.conf.urls.i18n import i18n_patterns
from django.contrib.sitemaps.views import sitemap
from djcms_blog.sitemaps import PostsSitemap
sitemaps = {
'blog': PostsSitemap,
}
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='sitemap'),
]
urlpatterns += i18n_patterns(
url(r'^', include('djcms_blog.urls')),
)
```
## Configuration
You can define the following blog settings in your settings.
**DEFAULT_BLOG_ID** Define the default blog id to be used in the urls and links.
**DEFAULT_URL** URL to open the blog
**BLOG_TITLE** HTML title
**ROOT_TITLE** Title for links
**DJCMS_BLOG_CACHE_TIME** Cache time used in public views.
**MARKDOWN_CODE_CSS_THEME** Code theme for markdown code in the blog.
**DEFAULT_COVER_IMAGE** Cover image used in blog
**DEFAULT_NAVBAR_IMAGE** Image used as icon in navigation
### Example
In `settings.py`
```
# Blog config
DJCMS_BLOG_CACHE_TIME = 0
DEFAULT_BLOG_ID = 1
```
## Contributing
Install dev dependencies
```
pip install -r requirements_dev.txt
```
Run tests
```
pytest . --cov=. --cov-report=term-missing
```
Static Analysis
```
flake8 .
```
## Credits
This package was created with **Cookiecutter** and the `audreyr/cookiecutter-pypackage` project template.
# History
0.1.0 (2018-06-05)
------------------
* First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djcms_blog-0.2.2.tar.gz
(1.4 MB
view hashes)
Built Distribution
Close
Hashes for djcms_blog-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99dc8c87720ad17d271f469e0dd67de68cd36e20b0b456f8fecec8cf9124df97 |
|
MD5 | f7390ac239b94204dab0965da3da8be7 |
|
BLAKE2b-256 | 3513c8110f8bec2734af88e8be5eca4242fae4d70d13dff389b3e444c244bfd3 |