Python Forum
Could not parse the remainder: '=' from '='
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Could not parse the remainder: '=' from '='
#1
I am upgrading from python 2 to 3 .



{% if category = 'media-articles' %}
Could not parse the remainder: '=' from '='


This strange issue has come up anew.
Please note that this code was working fine with python2.7

I have tried all the said solutions of extra space around the operator.
Kindly help me solve this issue and if required apply a fix in python3 as well.

This issue is found in python3.5 and python3.6 environments.
Reply
#2
Shouldn't it be
Output:
{% if category == 'media-articles' %}
I don't think your original code would work in python2 either
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Feb-20-2019, 10:21 AM)buran Wrote: Shouldn't it be
Output:
{% if category == 'media-articles' %}
I don't think your original code would work in python2 either
In the initial code it was = , but yes you are right. Logically it should be ==.

Although the sadder part is , I've tried all possibilities including this and it's giving the same exact error.
Reply
#4
(Feb-20-2019, 11:15 AM)Saurabh Wrote: Although the sadder part is , I've tried all possibilities including this and it's giving the same exact error.


Please post full traceback in error tags, as well as the relevant code that render the template - in python tags
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting a remainder to int to str tester_V 6 2,879 Oct-28-2020, 06:14 PM
Last Post: tester_V
  remainder operator % noweare 3 2,912 Feb-14-2019, 01:50 AM
Last Post: noweare

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020