First thing when you work with Java script is, make sure it is available. In
this case, where is your urls config.

>From these,

<script type="text/javascript"
src="/usr/share/tinymce/www/tiny_mce.js"></script>
<script type="text/javascript"
src="/usr/share/tinymce/www/textareas.js"</script>

Can you start web server and type
http://localhost/usr/share/tinymce/www/tiny_mce.js
and see if it return something rather than 400.

For me, I usually do things like this

Let say I have static folder under project path name "static", under static
I have css, js image.

In settings,
DIR = os.path.dirname(__file__)
MEDIA_ROOT = os.path.join(DIR, 'static')

In urls

urlpatterns += patterns('',

(r'^static/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.MEDIA_ROOT,
'show_indexes': True}),
)

I enable show_indexs just in case I want make sure I can see all file via
browser.

After you have it work, you can even grab java script from outside website
or on your media site to improve performance. For example,

<script type="text/javascript" src="
http://mymedia.com/js/tinymce/www/tiny_mce.js";></script>
<script type="text/javascript" src="http://mymedia.com/js
/tinymce/www/textareas.js"</script>

This can apply to css as well.

Hope this help,

Chatchai

2008/7/6 <[EMAIL PROTECTED]>:

> Hello,
>
> I'm working through James Bennett's Practical Django Projects. Have brought
> up the cms; would like to add Rich Text Editing, but the instructions in
> Bennet's book don't seem to work for me.
>
> Googling around, I find a number of recipes for adding RTE. Thought I try
> the approach suggested by the Django project:
> http://code.djangoproject.com/wiki/AddWYSIWYGEditor.
>
> But this doesn't work for me either.
>
> Here's my config:
>
> 1) tiny_mce.js is in: /usr/share/tinymce/www
> 2) TEMPLATE_DIRS in settings.py is set to:
>
> TEMPLATE_DIRS = (
>     '/home/lloyd/django/templates/cms/',
>  )
>
> 3) my template is in: ~/django/templates/cms/flatpages
> 4) I've copied change_form.html, the admin template, into:
> ~/django/templates/admin_copies
>
> 5) the admin template extension, change_forms.html, is in:
> ~/django/templates/admin/flatpages/flatpage
>
> ...and reads:
>
> {% extends "admin_copies/change_form.html" %}
> {% block extrahead %}{{ block.super }}
> <script type="text/javascript"
> src="/usr/share/tinymce/www/tiny_mce.js"></script>
> <script type="text/javascript"
> src="/usr/share/tinymce/www/textareas.js"</script>
> {% endblock %}
>
> With this configuration, everything works fine, except the tiny_mce editor
> fails to show on the admin page.
>
> Questions:
>
> 1) Am I missing or misunderstanding  a step?
> 2) Is there an effective debugging method that I can use in a case like
> this?
>
> Many thanks,
>
> Lloyd R. Prentice
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to