M
M
m00nkey2014-12-08 12:10:30
Django
m00nkey, 2014-12-08 12:10:30

How to fix error when installing django-disqus?

Greetings!
I put django-disqus, I get an error:

django $ sudo pip3 install django-disqus 
[sudo] password for m00nkey: 
Downloading/unpacking django-disqus
  Downloading django-disqus-0.4.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/django-disqus/setup.py) egg_info for package django-disqus
    
Installing collected packages: django-disqus
  Running setup.py install for django-disqus
    
      File "/usr/local/lib/python3.4/dist-packages/disqus/api.py", line 83
        except urllib2.URLError, e:
                               ^
    SyntaxError: invalid syntax
    
      File "/usr/local/lib/python3.4/dist-packages/disqus/management/commands/disqus_dumpdata.py", line 57
        print json.dumps(posts, indent=indent)
                 ^
    SyntaxError: invalid syntax
    
      File "/usr/local/lib/python3.4/dist-packages/disqus/management/commands/disqus_export.py", line 30
        print "Resuming after comment %s" % str(last_export_id)
                                        ^
    SyntaxError: invalid syntax
    
Successfully installed django-disqus
Cleaning up...

what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2014-12-08
@FireGM

Library for python 2.7
And you bet on 3.4
UPD:
This is how I insert comments into the page

<div id="disqus_thread"></div>
        <script type="text/javascript">
            /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
            var disqus_shortname = 'shortname'; // здесь пишем общее имя сайта или форума
            var disqus_identifier = '{{ news.title }}{{news.id }}'; //здесь создаем уникальный индификатор, что б для каждой новости были свои комментарии. Я создал из названии новости и её id
            var disqus_title = '{{ news.title }}'; Не имею понятия что это такое, но так работает.
            /* * * DON'T EDIT BELOW THIS LINE * * */
            (function () {
                var dsq = document.createElement('script');
                dsq.type = 'text/javascript';
                dsq.async = true;
                dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
            })();
        </script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question