I’m getting an exception when I start my Django server. I use python manage.py runserver 0.0.0.0:80 to start the server.
I’m getting this exception: ValueError: Invalid default_markup_type for field 'None', allowed values: html, plain
Here’s the stack trace:
Validating models...
Failed to setup thread-interrupt handler. This is usually not critical
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x2274c90>>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/kcastillo/NMCSVs/nmcsv/models.py", line 29, in <module>
class Description(UserData):
File "/home/kcastillo/NMCSVs/nmcsv/models.py", line 30, in Description
text = MarkupField("Description", default_markup_type='markdown')
File "/usr/local/lib/python2.7/dist-packages/markupfield/fields.py", line 106, in __init__
(name, ', '.join(self.markup_choices_list)))
ValueError: Invalid default_markup_type for field 'None', allowed values: html, plain
The exception is coming this line of code:
text = MarkupField("Description", default_markup_type='markdown')
These are all working. I just can’t get it to run on my VM after I checked it out from our svn.
Thanks.
Apparently, I was missing the
markdownmodule for Django. Since Django didn’t complain that I didn’t have this module in the beginning, I got confused with the error.The solution was to install the module.
pip install markdown