klen / django_markdown

Django markdown support and wysiwig
GNU Lesser General Public License v3.0
391 stars 143 forks source link

Static_url setting causing issues. #39

Closed wldcordeiro closed 9 years ago

wldcordeiro commented 9 years ago

Your settings.py has this line

STATIC_URL = settings.STATIC_URL or settings.MEDIA_URL

This causes issues where the editor will 404 if you have settings defined this way.

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
    STATIC_URL = '/static/'

    # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
    STATICFILES_DIRS = (
        join(BASE_DIR, 'static'),
    )

    # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    )
    # END STATIC FILE CONFIGURATION

    # MEDIA CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
    MEDIA_ROOT = join(BASE_DIR, 'media')

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
    MEDIA_URL = '/media/'

because it will always evaluate to true. I would suggest dropping the setting or just setting it to

STATIC_URL = settings.STATIC_URL
MEDIA_URL = settings.MEDIA_URL