pydanny / django-wysiwyg

A Django application for making Django textareas rich text editors. Certainly as a template tag and possibly as a form widget.
http://django-wysiwyg.readthedocs.org
MIT License
465 stars 63 forks source link

AttributeError: 'NoneType' object has no attribute 'endswith' #46

Closed rajasimon closed 6 years ago

rajasimon commented 9 years ago

This is error i am getting right now . I followed the step and during the syncdb.. Its throws this error

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 284, in execute
    self.validate()
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
    self.load_app(app_name, True)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/ri/studio/Audiotube/frontend/models.py", line 4, in <module>
    from tinymce import models as tinymce_models
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/tinymce/models.py", line 6, in <module>
    from tinymce import widgets as tinymce_widgets
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/tinymce/widgets.py", line 10, in <module>
    import tinymce.settings
  File "/home/ri/studio/env/local/lib/python2.7/site-packages/tinymce/settings.py", line 16, in <module>
    JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT',os.path.join(settings.STATIC_ROOT, 'tiny_mce'))
  File "/home/ri/studio/env/lib/python2.7/posixpath.py", line 77, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
acdha commented 9 years ago

The os.path.join call is failing because your settings module doesn't define STATIC_ROOT.

pydanny commented 9 years ago

I guess this is something we should mention in the docs.

vdboor commented 9 years ago

Good idea. It looks like that error even happens within the django-tinymce package, it doesn't handle situations where STATIC_ROOT is missing.

rajasimon commented 9 years ago

Yes... Now i am giving the STATIC_ROOT no error is coming.

And also i am not getting this line set DJANGO_WYSIWYG_MEDIA_URL to the appropriate location.

How to set DJANGO_WYSIWYG_MEDIA_URL ?

mhipo1364 commented 8 years ago

:+1: