well, guys, I've solved this problem, but in a bad way.

Since I'm running the site locally with the default django server, the
MEDIA_URL became a confusing thing to me. Luckily I have an Apache
server running on my machine, so I just set the MEDIA_URL to 'http://
localhost/media/' and copied the files needed in to it.

I think it's a bad way, even no way worse. But it works :)

On Sep 21, 12:22 pm, 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.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to