klen / django_markdown

Django markdown support and wysiwig
GNU Lesser General Public License v3.0
391 stars 143 forks source link

Markdown widget’s not added in admin #72

Open sunnyar opened 8 years ago

sunnyar commented 8 years ago

Markdown widget’s media i.e. javascript and stylesheets are not getting added in admin after explicitly defining form_overrides in Django 1.10

`class Entry(models.Model): ... body = MarkdownField() ....

from django_markdown.widgets import AdminMarkdownWidget from django_markdown.models import MarkdownField

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

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37376452-markdown-widget-s-not-added-in-admin?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github).
Toltar commented 7 years ago

Getting the same problems but when Debug = False. I am not sure why it is not working in production while in turn, it works in development when Debug = True.

moonclearner commented 7 years ago
from django_markdown.models import MarkdownField
from django_markdown.widgets import AdminMarkdownWidget

Register your models here.
admin.site.register(MyModel, MarkdownModelAdmin)

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

It works for me

JiangPQ commented 7 years ago

Got the same problem in Django 1.10, no matter Debug = True or False. There is nothing happened after I register markdownModelAdmin to my model. The textarea shows just like before. Anyone knows why?