Coder Social home page Coder Social logo

django-markdown-app's People

Contributors

alexey-sveshnikov avatar alkalit avatar aykut avatar cptlemming avatar defbyte avatar dfeinzeig avatar dryja avatar ei-grad avatar evidens avatar fjcaetano avatar haard avatar harabchuk avatar jtrain avatar klen avatar neoascetic avatar rhblind avatar rspeed avatar salmanulfarzy avatar sv0 avatar syavorsky avatar tomoconnor avatar wldcordeiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-markdown-app's Issues

Flatpages middleware

ciao, thanks for taking over maintenance of the app.

unless i missed something, flatpages markdown content isn't rendered to html. so i came up with this middleware:

from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.views import flatpage, render_flatpage
from django.contrib.sites.shortcuts import get_current_site
from django_markdown.utils import markdown


def get_flatpage_object(request):
    url = request.path
    if not url.startswith('/'):
        url = '/' + url
    site_id = get_current_site(request).id

    try:
        f = FlatPage.objects.get(url=url, sites=site_id)
    except FlatPage.DoesNotExist:
        if not url.endswith('/') and settings.APPEND_SLASH:
            request.path += '/'
            return get_flatpage_object(request)
        else:
            return None
    return f


class MarkdownFlatpagesMiddleware:
    def process_view(self, request, view_func, view_args, view_kwargs):
        if view_func is not flatpage:
            return None

        f = get_flatpage_object(request)
        if f is None:
            return None

        f.content = markdown(f.content)
        return render_flatpage(request, f)

shall i make a pr with this?

on the other hand, i feel that the flatpages-app itself should support custom processors, as it already does preprocess content.

I hope this app support three backquote syntax

Feature Request

希望这个应用能增加代码语法的解析。例如 ```html

I expect this app may add code syntax parser feature like three backquote code-lang.

目前这个应用没有支持三个反引号的语法解析。

This app does not support three backquote syntax now.

Media merging changes seem to cause failure with Django 2.2

Django 2.2 form Media got new merging rules and specially in admin it affects widgets that needs to add form media.

See https://docs.djangoproject.com/en/2.2/releases/2.2/#merging-of-form-media-assets for more details.

Currently using MarkdownModelAdmin with Django 2.2.1 causes:

Uncaught TypeError: Cannot read property 'fn' of undefined
    at jquery.markitup.js:28
    at jquery.markitup.js:665
editor.js:1 Uncaught TypeError: jQuery is not a function
    at editor.js:1

version 0.9.4 not compatible with Django < 2.0, previous versions un-published

Hi. I've hit an issue with this project because the latest version 0.9.4 is not compatible with Django <= 2.0. The failure is

from django.urls import path
ImportError: cannot import name 'path'

I note in the requirements on PyPI, you now say version 0.9.4 requires "Django (<=2.1,>=2.0)". That's fine. Normally I would fix this by pinning to an older version until we are able to upgrade our application. However it also seems that you've also removed all previous version of django-markdown-app from PyPI (or at least they have been removed):

screenshot at 2018-02-14 15 09 21

Removing old versions of a package is generally considered bad package maintenance practice as it is likely to break build/deployment script for users of your package who have pinned to the deleted versions.

I also had a look to see if I could submit a PR to add backward-compatiblity with older django versions (1.11 is still well inside its support window - many user won't be able to upgrade to 2.0 yet), but the code on master in this repo doesn't match what I downloaded from PyPI.

Key asks are:

  1. Any word on what has happened here?
  2. Would it be possible to re-publish a version which supports Django < 2.0 to PyPI?
  3. How could someone help fix this?

code blocks not working

the admin form doesn't do anything when trying to add a code block and if i add it manually it doesn't render it properly in template

Error with Django 1.11

With 1.11 I get the error "context must be a dict rather than Context."

According to the release notes templates no longer accept Context objects:

Changing django_markdown/utils.py line 48 from:

ctx = Context(dict(
   selector=selector, extra_settings=simplejson.dumps(options)),
  autoescape=False)

to

ctx = dict(selector=selector, extra_settings=simplejson.dumps(options))

Seems to resolve the error.

Staticfiles templatetags is failing in Django 3.0

Features Removed: staticfiles.templatetags

Traceback (most recent call last):
File "lib/python3.7/site-packages/django/template/backends/django.py", line 121, in get_package_libraries
module = import_module(entry[1])
File "lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "lib/python3.7/site-packages/django_markdown/templatetags/django_markdown_static.py", line 7, in
from django.contrib.staticfiles.templatetags.staticfiles import static as _static # noqa
ModuleNotFoundError: No module named 'django.contrib.staticfiles.templatetags'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "lib/python3.7/site-packages/django/core/management/base.py", line 395, in check
include_deployment_checks=include_deployment_checks,
File "lib/python3.7/site-packages/django/core/management/base.py", line 382, in _run_checks
return checks.run_checks(**kwargs)
File "lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "lib/python3.7/site-packages/django/contrib/admin/checks.py", line 76, in check_dependencies
for engine in engines.all():
File "lib/python3.7/site-packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "lib/python3.7/site-packages/django/template/utils.py", line 90, in
return [self[alias] for alias in self]
File "lib/python3.7/site-packages/django/template/utils.py", line 81, in getitem
engine = engine_cls(params)
File "lib/python3.7/site-packages/django/template/backends/django.py", line 25, in init
options['libraries'] = self.get_templatetag_libraries(libraries)
File "lib/python3.7/site-packages/django/template/backends/django.py", line 43, in get_templatetag_libraries
libraries = get_installed_libraries()
File "lib/python3.7/site-packages/django/template/backends/django.py", line 108, in get_installed_libraries
for name in get_package_libraries(pkg):
File "lib/python3.7/site-packages/django/template/backends/django.py", line 125, in get_package_libraries
"trying to load '%s': %s" % (entry[1], e)
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django_markdown.templatetags.django_markdown_static': No module named 'django.contrib.staticfiles.templatetags'

ImportError: No module named 'django_markdown'

Hallo,

Thank you for creating this application.

After inserting django_markdown to installed apps, I receive the error:

ImportError: No module named 'django_markdown'

I am using Django 1.9.9 on Python 3.4.2 and:

$ pip freeze
...
django-markdown-app==0.8.6
django-markdown-deux==1.0.5
Markdown==2.6.6
markdown2==2.3.1

9.3.1 doesn't support multiple markdown fields in admin.

Interesting problem I've found is, If I have multiple markdown fields in my model and thus in my admin, only the first field will have the editor initialized. There's multiple jsons embedded in the html with the same id which is the main problem. Also because I have multiple markdown fields in the admin, webpage tries to load same js file over and over too. This was not the case in 0.9.2 but you removed that version from pypi and my production servers are having serious issues right now. I can't deploy any new server with 0.9.2 and 0.9.3.1 breaks the admin. What should I do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.