# settings.py MEDIA_ROOT = '/absolute/path/to/media/directory/' MEDIA_URL = '/app_media/'
# urls.py (at the end) import settings if settings.DEBUG: urlpatterns += patterns('', (r'^app_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) Given the above, your *.js files should live in: /absolute/path/to/media/directory/tiny_mce/tiny_mce.js /absolute/path/to/media/directory/textareas.js Don't use of the dot (.) for the URL, as in "./app_media/" keith On Sep 3, 11:45 am, bin <[EMAIL PROTECTED]> wrote: > didn't work > > what should i fill in my MEDIA_URL in settings.py? > > is it like this: MEDIA_URL = './appmedia/' > > On 9月3日, 下午11时32分, lingrlongr <[EMAIL PROTECTED]> wrote: > > > woops.... try this: > > > js = ( > > 'tiny_mce/tiny_mce.js', > > 'textareas.js', > > ) > > > I believe this automatically references the MEDIA_URL, so you don't > > have to. > > > On Sep 3, 11:23 am, bin <[EMAIL PROTECTED]> wrote: > > > > I tried, but nothing happened at all. > > > > On 9月3日, 下午10时59分, lingrlongr <[EMAIL PROTECTED]> wrote: > > > > > You are including the tiny_mce library after you reference it. Try > > > > switching the order to: > > > > > js = ( > > > > '/app_media/tiny_mce/tiny_mce.js', > > > > '/app_media/textareas.js', > > > > ) > > > > > On Sep 3, 10:50 am, bin <[EMAIL PROTECTED]> wrote: > > > > > > Hi all > > > > > > i wanna embed a richtext field in my admin textfield. > > > > > today, i try to use tiny mce. but no matter whatever i did, it didnt > > > > > show up. > > > > > > i created a directory in my project folder, named appmedia, and copied > > > > > the tiny mce files and textareas.js into it. > > > > > this is my urls.py > > > > > > (r'^app_media/(?P<path>.*)$',\ > > > > > 'django.views.static.serve',\ > > > > > {'document_root': './appmedia'}), > > > > > > textareas.js: > > > > > tinyMCE.init({ > > > > > mode : "textareas", > > > > > theme : "advanced" > > > > > > }); > > > > > > In my models.py: > > > > > class test(models.Model): > > > > > #Fields > > > > > class Admin: > > > > > js = ( > > > > > '/app_media/textareas.js', > > > > > '/app_media/tiny_mce/tiny_mce.js', > > > > > ) > > > > > > all this done, nothing changed in my admin test's textfield, i dont > > > > > know why, who could help out... > > > > > > when i put the url in my > > > > > explorer:http://localhost:8000/app_media/textareas.js, > > > > > andhttp://localhost:8000/app_media/tiny_mce/tiny_mce.js, it can > > > > > locate the files, i think it's nothing about the urls, so, what's the > > > > > problem. > > > > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---