Python 2.7 Django not working
See original GitHub issueI keep getting a TypeError exception:
unicode argument expected, got 'str'
When I try to do this:
data = {'data': somedata}
template = get_template('sometemplate.html')
html = template.render(Context(data))
result = StringIO()
status = pisa.CreatePDF(StringIO(html), result)
I saw the Django example and the code is similir to this one. Any clues?
Thank you
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Unable to install Django Version 1.11.22 with python 2.7 ...
The latest version Python 2.7.18 should work fine. Install it with pip enabled or install pip after using python -m ensurepip . Upgrade...
Read more >Troubleshooting - Django documentation
This page contains some advice about errors and problems commonly encountered during the development of Django applications.
Read more >Your First Steps With Django: Set Up a Django Project
This tutorial provides a walkthrough and a reference for starting a Django project and app. You can use it as a quick setup...
Read more >Setting up a Django development environment - MDN Web Docs
For Django 4.0.2 the allowed versions are Python 3.8 to 3.10 (see ... This can be a problem if you want to create...
Read more >Install Django using virtualenv - DreamHost Knowledge Base
3, you must be running Python 3. If you attempt to install in a Python 2 environment, you'll see the following errors: Could...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The latest pre-release doesn’t work.
Closing this until someone gives useful input. Also, I don’t see this problem, so I suspect you’re feeding non-unicode data to
CreatePDF
as the error hints.