klen / klen/django_markdown

Internal Server Error on preview

Open
#54 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
389
Forks
140
PR merge metrics
No merged PRs in 30d

Description

Hello, I tried to install this library on Django 1.9 and got such error in admin interface when tried to run preview.

```
Internal Server Error: /markdown/preview/
Traceback (most recent call last):
File "/home/alexey/Dev/profcom/django-rest-env/lib/python3.4/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/home/alexey/Dev/profcom/django-rest-env/lib/python3.4/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/alexey/Dev/profcom/django-rest-env/lib/python3.4/site-packages/django_markdown/views.py", line 22, in preview
content=request.REQUEST.get('data', 'No content posted'),
AttributeError: 'WSGIRequest' object has no attribute 'REQUEST'
[10/Dec/2015 22:14:47] "POST /markdown/preview/ HTTP/1.1" 500 14951
```

Here is the model code

```
class Post(models.Model):
name = models.CharField(max_length=50, null=False, primary_key=True) # Name for human-readable url
title = models.CharField(max_length=255, null=False, unique=True) # Human-readable title
text = MarkdownField() # Text in markdown syntax
documents = models.ManyToManyField('Document', blank=True)
commission = models.ForeignKey('Commission', related_name="posts")
pinned = models.BooleanField(default=False) # Should display on main
date = models.DateTimeField(auto_now=True)
image = models.FileField(upload_to='post_tiles', null=True)
```

Is it compatible with django 1.9?
Thank you in advance!

Sinclerely, Alexey
##

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/29028247-internal-server-error-on-preview?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at django_markdown/views.py line 22, the preview entry point shown in the traceback, and reproduce the /markdown/preview/ request with Django 1.9. Check the request handling against the supported Django version, then verify that the admin preview completes without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.