On Sep 21, 5:22 am, taijirobot <guangyudongb...@gmail.com> wrote: > Hi, guys, > > I'm learning django recently and I am trying to add a rich text editor > to the places where long formated text like blog post are needed (the > site is running on local machine with the default django server). > > I tried to use django-tinymce :http://code.google.com/p/django-tinymce/ > and all the things I did was: > > 1. download the django-tinymce package, extract, and run 'sudo python > setup.py install' > > 2. get a tinymce distribution(new enough) and copy the jscripts/ > tiny_mce to the media root of my local machine. > > my config: > MEDIA_ROOT = '/home/taijirobot/mysite/media/' > MEDIA_URL = '' > > 3. add 'tinymce' to INSTALLED_APPS in settings > > 4. Change the definition of the BlogForm (a form defined to generate > form for blog mode), like this: > ...... > class BlogPost(models.Model): > title = models.CharField(max_length=150) > body = models.TextField() > timestamp = models.DateTimeField(default=datetime.datetime.now) > class Meta: > ordering = ('-timestamp',) > ...... > class BlogForm(ModelForm): > body = forms.CharField(widget=TinyMCE(attrs={'cols':80, 'rows': > 30})) > class Meta: > model = BlogPost > exclude = ['timestamp'] > ...... > > The document says we can get a tinymce editor in the admin site after > this. But nothing different shows with mine. > > What might be the problem? > Is it because the wrong MEDIA_URL setting? Or I've missed something > when installing or using? > > Thank you.
Well, I would assume that MEDIA_URL is wrong - it's very unlikely you want it to be blank. But more to the point, what is serving the media and what URL is it serving it on? That's the value you should use for MEDIA_URL. -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---