Sorry for the mix up. The log messages I pasted in are from yet another test config, but they're the same return codes I get, and the same addslash behavior... I'll see what I can do to figure out why the url wouldn't be matching. Thanks.
On Oct 7, 9:30 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 7, 2008 at 9:07 AM, Brian K. Jones <[EMAIL PROTECTED]> wrote: > > > > > > > This scenario has been brought up before, but I'm having a problem > > that hasn't yet been reported. I was unable to reply to the whole list > > in the google groups interface - only "Reply to author" was available. > > Here's the thread for reference: > > >http://groups.google.com/group/django-users/browse_thread/thread/c1f1... > > > In short, I'm going through the Practical Django Projects book, trying > > to get the tiny_mce configuration on pages 24 and 25 to work, and I'm > > having zero luck. I'm using Django 1.0, and the development server, on > > a mac, running Leopard. > > > It looks like I have the urls.py and change_form.html set up properly, > > but the problem is that whether I try to load the admin page, or I try > > to access tiny_mce.js directly in my browser from the django > > development server, the dev server is redirecting me (302) to the same > > path I ask for, except with a "/" at the end. So I get this in my > > log: > > > [07/Oct/2008 08:48:31] "GET /tiny_mce.js HTTP/1.1" 302 0 > > [07/Oct/2008 08:48:31] "GET /tiny_mce.js/ HTTP/1.1" 404 1708 > > > Of course, that's no good, but I have no idea where the magical > > setting is to change that. > > You probably don't want to change that. It's the APPEND_SLASH setting that > is doing this and the fact that it is coming into play means there's a > problem elsewhere: namely the incoming url for tiny_mce.js is not being > matched by anything in your urlconf. This one in particular is missing the > tiny_mce/ prefix that your static server urlpattern is expecting. Is this > one coming in from your manual testing or from an actual page request? The > change_form template fragment you show does have the /tiny_mce/ prefix so > I'm puzzled how it would be missing from that page request. > > I don't have time to comb through all of what you provided, but the problem > you want to solve is making the initial request coming in match something > that will be served by your static server configuration, not turning off > APPEND_SLASH. Solve the first problem and you won't see the 2nd behavior. > > Karen > > > I've tried removing/replacing trailing > > slashes all over the place, to no avail, so I imagine this is > > something in the settings.py file that's hurting me. Here are my > > files: > > > urls.py: > > ================================ > > from django.conf.urls.defaults import * > > > # Uncomment the next two lines to enable the admin: > > from django.contrib import admin > > admin.autodiscover() > > > urlpatterns = patterns('', > > # Example: > > # (r'^cms/', include('cms.foo.urls')), > > > # Uncomment the admin/doc line below and add > > 'django.contrib.admindocs' > > # to INSTALLED_APPS to enable admin documentation: > > (r'^admin/doc/', include('django.contrib.admindocs.urls')), > > > # Uncomment the next line to enable the admin: > > (r'^admin/(.*)', admin.site.root), > > (r'', include('django.contrib.flatpages.urls')), > > (r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve', > > {'document_root':'/Users/jonesy/django/tinymce/jscripts'}), > > ) > > ================================== > > > change_form.html (just the relevant section) > > ================================== > > {% extends "admin/base_site.html" %} > > {% load i18n admin_modify adminmedia %} > > > {% block extrahead %}{{ block.super }} > > <script type="text/javascript" src="../../../jsi18n/"></script> > > <script type="text/javascript" src="/tiny_mce/tiny_mce.js"></script> > > <script type="text/javascript"> > > tinyMCE.init({ > > mode: "textareas", > > theme: "simple" > > }); > > </script> > > > {{ media }} > > {% endblock %} > > ====================================== > > > settings.py > > ====================================== > > # Django settings for cms project. > > > DEBUG = True > > TEMPLATE_DEBUG = DEBUG > > > ADMINS = ( > > # ('Your Name', '[EMAIL PROTECTED]'), > > ) > > > MANAGERS = ADMINS > > > DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', > > 'postgresql', 'mysql', 'sqlite3' or 'oracle'. > > DATABASE_NAME = 'cms' # Or path to database file if using > > sqlite3. > > DATABASE_USER = 'jonesy' # Not used with sqlite3. > > DATABASE_PASSWORD = 'whatever' # Not used with sqlite3. > > DATABASE_HOST = 'localhost' # Set to empty string for > > localhost. Not used with sqlite3. > > DATABASE_PORT = '' # Set to empty string for default. Not > > used with sqlite3. > > > # Local time zone for this installation. Choices can be found here: > > #http://en.wikipedia.org/wiki/List_of_tz_zones_by_name > > # although not all choices may be available on all operating systems. > > # If running in a Windows environment this must be set to the same as > > your > > # system time zone. > > TIME_ZONE = 'America/New_York' > > > # Language code for this installation. All choices can be found here: > > #http://www.i18nguy.com/unicode/language-identifiers.html > > LANGUAGE_CODE = 'en-us' > > > SITE_ID = 1 > > > # If you set this to False, Django will make some optimizations so as > > not > > # to load the internationalization machinery. > > USE_I18N = True > > > # Absolute path to the directory that holds media. > > # Example: "/home/media/media.lawrence.com/" > > MEDIA_ROOT = '' > > > # URL that handles the media served from MEDIA_ROOT. Make sure to use > > a > > # trailing slash if there is a path component (optional in other > > cases). > > # Examples: "http://media.lawrence.com", "http://example.com/media/" > > MEDIA_URL = '' > > > # URL prefix for admin media -- CSS, JavaScript and images. Make sure > > to use a > > # trailing slash. > > # Examples: "http://foo.com/media/", "/media/". > > ADMIN_MEDIA_PREFIX = '/media/' > > > # Make this unique, and don't share it with anybody. > > SECRET_KEY = '=f++nfum([EMAIL PROTECTED])n+mk8lh^%ad3%=898p)41-4$vwg13' > > > # List of callables that know how to import templates from various > > sources. > > TEMPLATE_LOADERS = ( > > 'django.template.loaders.filesystem.load_template_source', > > 'django.template.loaders.app_directories.load_template_source', > > # 'django.template.loaders.eggs.load_template_source', > > ) > > > MIDDLEWARE_CLASSES = ( > > 'django.middleware.common.CommonMiddleware', > > 'django.contrib.sessions.middleware.SessionMiddleware', > > 'django.contrib.auth.middleware.AuthenticationMiddleware', > > ) > > > ROOT_URLCONF = 'cms.urls' > > > TEMPLATE_DIRS = ('/Users/jonesy/django/cms/templates', > > # Put strings here, like "/home/html/django_templates" or "C:/www/ > > django/templates". > > # Always use forward slashes, even on Windows. > > # Don't forget to use absolute paths, not relative paths. > > ) > > > INSTALLED_APPS = ( > > 'django.contrib.auth', > > 'django.contrib.contenttypes', > > 'django.contrib.sessions', > > 'django.contrib.sites', > > 'django.contrib.admin', > > 'django.contrib.flatpages', > > 'django.contrib.admindocs', > > ) > > ================================ > > > I think I've followed things pretty precisely, so this is probably a > > v1.0 change. Can someone point me in the right direction? > > > Thanks, > > brian --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---