Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
remove Django 1.6 and 1.7 support
Browse files Browse the repository at this point in the history
version 0.9.0
  • Loading branch information
sv0 committed Nov 4, 2016
1 parent 58e4b4e commit 7141697
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 84 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ todo.txt

.coverage
.tox/
django_markdown.egg-info/
.cache/
.eggs/
django_markdown_app.egg-info/
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2016-11-04 sv0
* Remove Django 1.6 and 1.7 support
* Version 0.9.0

2016-07-24 sv0
* Add Django 1.10 support

Expand Down
2 changes: 1 addition & 1 deletion django_markdown/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Django-Markdown supports markdown in Django. """

__version__ = "0.8.6"
__version__ = "0.9.0"
__project__ = "django-markdown-app"
__author__ = "Kirill Klenov <[email protected]>"
__license__ = "GNU LGPL"
3 changes: 1 addition & 2 deletions django_markdown/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def test_preview_MARKDOWN_PROTECT_PREVIEW(self):
from . import settings
settings.MARKDOWN_PROTECT_PREVIEW = True

response = self.client.get('/markdown/preview/', data=self.data)

response = self.client.post('/markdown/preview/', data=self.data)
self.assertEqual(response.status_code, 302)

# for tests isolation reasons
Expand Down
14 changes: 3 additions & 11 deletions django_markdown/urls.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
""" Define preview URL. """

from django import VERSION
from django.conf.urls import url

from .views import preview


if VERSION >= (1, 8):
urlpatterns = [
url('preview/$', preview, name='django_markdown_preview')
]
else:
# django <= 1.7 compatibility
from django.conf.urls import patterns
urlpatterns = patterns(
'', url('preview/$', preview, name='django_markdown_preview')
)
urlpatterns = [
url('preview/$', preview, name='django_markdown_preview')
]
104 changes: 69 additions & 35 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
django-markdown-app
###################
Django-Markdown v. 0.9.0
########################

.. _description:

**Django markdown** is django application that allows use markdown wysiwyg in flatpages, admin forms and other forms.
Documentaton available at pypi_ or github_.
Expand All @@ -11,11 +13,13 @@ The reason of forking is the original project is not maintained anymore and the

.. contents::

.. _requirements:

Requirements
============

- python >= 2.5
- django >= 1.2
- python >= 2.7
- django >= 1.8
- markdown


Expand All @@ -30,6 +34,9 @@ Installation
Setup
=====

.. note:: 'django_markdown' require 'django.contrib.staticfiles' in INSTALLED_APPS


- Add 'django_markdown' to INSTALLED_APPS ::

INSTALLED_APPS += ( 'django_markdown', )
Expand All @@ -43,16 +50,40 @@ Setup
Use django_markdown
===================

#) Models: ::

from django_markdown.models import MarkdownField
class MyModel(models.Model):
content = MarkdownField()


#) Custom forms: ::

from django_markdown.fields import MarkdownFormField
from django_markdown.widgets import MarkdownWidget


class MyCustomForm(forms.Form):
content = forms.CharField( widget=MarkdownWidget() )
content = forms.CharField(widget=MarkdownWidget())
content2 = MarkdownFormField()


#) Custom admins: ::

from django_markdown.admin import MarkdownModelAdmin
adimin.site.register(MyModel, MarkdownModelAdmin)
admin.site.register(MyModel, MarkdownModelAdmin)


#) Admin Overrides: (If you don't want to subclass package ModelAdmin's) ::

from django.contrib import admin

class YourModelAdmin(admin.ModelAdmin):
formfield_overrides = {MarkdownField: {'widget': AdminMarkdownWidget}}


#) Flatpages: ::

Expand All @@ -64,45 +95,48 @@ Use django_markdown
flatpages.register()
urlpatterns += [ url(r'^admin/', include(admin.site.urls)), ]

#) JavaScript API: ::

// Editors manager ``miu`` methods
#) Template tags: ::

// Initialize editor using default settings extended with ``extraSettings``
miu.init(textareaId, extraSettings);
<textarea name="test" id="new"></textarea>
{% markdown_editor "#new" %}
{% markdown_media %}

// Get default mIu settings
miu.settings();

// Set default mIu settings
miu.settings(newSettings);
// Get all initialized aditors
miu.editors();
// Get certain editor
miu.editors(textareaId);
// Editor instance methods
// Dynamically add button at ``index`` position
editor.addButton(conf, index)
// Dynamically remove button at ``index`` position
editor.removeButton(index)

Settings
========

**MARKDOWN_EDITOR_SETTINGS** - holds the extra parameters set to be passed to ``textarea.markItUp()``

**MARKDOWN_EDITOR_SKIN** - skin option, default value is ``markitup``

Example: `settings.py` ::

MARKDOWN_EDITOR_SKIN = 'simple'

**MARKDOWN_EDITOR_SETTINGS** - holds the extra parameters set to be passed to textarea.markItUp()
**MARKDOWN_EXTENSIONS** - optional list of extensions passed to Markdown, discussed at https://pythonhosted.org/Markdown/extensions/index.html#officially-supported-extensions

Example: `settings.py` ::

MARKDOWN_EXTENSIONS = ['extra']

**MARKDOWN_EXTENSION_CONFIGS** - Configure extensions, discussed at https://pythonhosted.org/Markdown/reference.html#extension_configs

**MARKDOWN_PREVIEW_TEMPLATE** - Template for preview a markdown. By default `django_markdown/preview.css`

**MARKDOWN_STYLE** - path to preview styles. By default `django_markdown/preview.css`

**MARKDOWN_SET_PATH** - path to folder with sets. By default `django_markdown/sets`

**MARKDOWN_SET_NAME** - name for current set. By default `markdown`.

**MARKDOWN_PROTECT_PREVIEW** - protect preview url for staff only


Examples
========

Execute `make run` in sources directory. Open http://127.0.0.1:8000 in your
browser. For admin access use 'root:root' credentials.


Changes
Expand All @@ -128,11 +162,11 @@ Development of django-markdown-app happens at github: https://github.com/sv0/dja


Contributors
=============
============

* klen_ (Kirill Klenov)

* yavorskiy_ (Sergii Iavorskyi)
* yavorskiy_ (Sergii Iavorskyi)


License
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def _read(fname):
keywords='html markdown django',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django :: 1.6',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
Expand Down
12 changes: 4 additions & 8 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import os

from django import VERSION
from django.core.management import call_command

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')


if VERSION >= (1, 7):
from django.conf import settings
from django.apps import apps
from django.conf import settings
from django.apps import apps

apps.populate(settings.INSTALLED_APPS)
call_command('migrate', interactive=False)
else:
call_command('syncdb', interactive=False)
apps.populate(settings.INSTALLED_APPS)
call_command('migrate', interactive=False)

from django_markdown.tests import * # noqa
2 changes: 2 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

MEDIA_ROOT = TMPDIR

ALLOWED_HOSTS = ['*']

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
Expand Down
15 changes: 3 additions & 12 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
from django import VERSION
from django.conf.urls import include, url

if VERSION >= (1, 8):
urlpatterns = [
url(r'^markdown/', include('django_markdown.urls')),
]
else:
# django <= 1.7.*
from django.conf.urls import patterns
urlpatterns = patterns(
'',
(r'^markdown/', include('django_markdown.urls')),
)
urlpatterns = [
url(r'^markdown/', include('django_markdown.urls')),
]
24 changes: 12 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py27-d16,py27-d17,py34-d17,py34-d110,cov
envlist=py27-d18,py27-d19,py27-d110,py35-d18,py35-d19,py35-d110,cov

[pylama]
skip=example/*
Expand All @@ -26,35 +26,35 @@ commands=py.test
deps =
pytest

[testenv:py27-d16]
[testenv:py27-d18]
basepython = python2.7
deps =
django==1.6.7
django==1.8.15
{[testenv]deps}

[testenv:py27-d17]
[testenv:py27-d19]
basepython = python2.7
deps =
django==1.7
django==1.9.10
{[testenv]deps}

[testenv:py34-d17]
basepython = python3.4
[testenv:py35-d18]
basepython = python3.5
deps =
django==1.7
django==1.8.15
{[testenv]deps}

[testenv:py34-d110]
basepython = python3.4
[testenv:py35-d110]
basepython = python3.5
deps =
django==1.10
django==1.10.2
{[testenv]deps}


[testenv:cov]
deps =
coverage==4.1
django==1.10
django==1.10.2
{[testenv]deps}

commands =
Expand Down

0 comments on commit 7141697

Please sign in to comment.