0

I am pretty new to Django and trying to use django-social-auth in my Django project.

I followed the README that is very clear.

my settings.py

#...

AUTHENTICATION_BACKENDS = (
#    'social_auth.backends.twitter.TwitterBackend',
    'django.contrib.auth.backends.ModelBackend',
)

TWITTER_CONSUMER_KEY         = 'xxxxxxxxx'
TWITTER_CONSUMER_SECRET      = 'xxxxxxxxxxxxxxxxxxxx'

SOCIAL_AUTH_DEFAULT_USERNAME = 'user'
SOCIAL_AUTH_ASSOCIATE_BY_MAIL = True

INSTALLED_APPS = (
  #...
  'social_auth',
)

#...

If I activate the twitter backend and try to login the standard way, I get:

'module' object has no attribute 'HTTPSConnection'

3 questions:

  • Do I have to install SSL with Python ?
  • How can I check if it's installed ?
  • What is the best way to install it ?
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
  • 1
    It has some dependencies, have you installed them as well? http://django-social-auth.readthedocs.org/en/latest/installing.html#dependencies. And yes, how you installed Python, what is environment? When I compiled Python from sources on Linux I needed to install some libraries `yum install openssl openssl-devel` – demalexx Jan 24 '12 at 12:05
  • I think I installed Python with `./configure && make && sudo make install`, I don't know how to upgrade or reinstall, same way ? Dependencies `python-openid` (already installed) and `python-oauth2` "can't satisfy the requirement"... – Pierre de LESPINAY Jan 24 '12 at 14:09
  • Yes, just install needed devel packages and recompile Python. What do you mean by "can't satisfy the requirement"? – demalexx Jan 25 '12 at 10:17
  • pip tells "can't satisfy the requirement" – Pierre de LESPINAY Jan 25 '12 at 10:29
  • when you run `pip install oauth2`? Is there more detailed info? – demalexx Jan 25 '12 at 10:38
  • "Requirement already satisfied" – Pierre de LESPINAY Jan 25 '12 at 10:39
  • Then you have all requirements installed. And PYthon with ssl support. Do you have that error about HTTPSConnection now? – demalexx Jan 25 '12 at 10:43
  • Yes, actually this can be continued here http://stackoverflow.com/questions/9001316/python-install-openssl – Pierre de LESPINAY Jan 25 '12 at 10:45
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/7030/discussion-between-demalexx-and-pierre-de-lespinay) – demalexx Jan 25 '12 at 11:17

1 Answers1

4

To solve HTTPSConnection error you need to install openssl-devel package, libssl-dev for Ubuntu, and recompile Python.

Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
demalexx
  • 4,661
  • 1
  • 30
  • 34