VS2015 and BitBucket

To make working vs2015 with BitBucket (https://bitbucket.org) you need to login in BitBucket, create a repository from the menu Repositories/Create Repositories, set useful info then open the link I have an existing project that will shows the commands to link the local project with the remote repository:

cd /path/to/my/repo
git remote add origin git@bitbucket.org:USER/PROJECT.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push -u origin --tags # pushes up any tags

in the 2nd line there is the important info:
git@bitbucket.org:USER/PROJECT.git
you need to convert these info in this form:
https://USER@bitbucket.org/USER/PROJECT.git

Back to VS2015, right click on solution and select
Source Control –> Add Solution to Source Control, select Git
VS2015 will create a local repository for your solution

Switch to Team Explorer panel, you will find your local repository, enter a comment for your first commit, then commit and push.
VS2015 will ask you for the remote repository URL, insert the one from BitBucket previously retrieved, then Publish.

Open edX: CAS error 500 (Updated)

I’ve installed open edx production stack, and followed the instructions to integrate the CAS.
The redirection works, but once the user returns to the edX site a page with the 500 internal error appear (but the upper right corner shows the correct user name).
The log file lmstderr.log (I’ve added that the¬†query lookup parameters in the exception):


2015-05-08 10:02:26,514 INFO 19968 [audit] models.py:1463 - Login success - user.id: 82
2015-05-08 10:02:26,521 ERROR 19968 [root] exceptions.py:9 - Uncaught exception from <class 'django.core.handlers.wsgi.WSGIHandler'>
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/edx/app/edxapp/edx-platform/common/djangoapps/external_auth/views.py", line 482, in cas_login
ret = django_cas_login(request, next_page, required)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django_cas/views.py", line 98, in login
auth.login(request, user)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 76, in login
user_logged_in.send(sender=user.__class__, request=request, user=user)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/edx/app/edxapp/edx-platform/common/djangoapps/student/models.py", line 1490, in enforce_single_login
user.profile.set_login_session(key)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 255, in __get__
rel_obj = self.get_query_set(instance=instance).get(**params)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 366, in get
% (self.model._meta.object_name, kwargs))
DoesNotExist: UserProfile matching query does not exist. Lookup parameters were {'user__pk': 82L}
2015-05-08 10:02:26,526 ERROR 19968 [django.request] base.py:213 - Internal Server Error: /cas-auth/login/
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/edx/app/edxapp/edx-platform/common/djangoapps/external_auth/views.py", line 482, in cas_login
ret = django_cas_login(request, next_page, required)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django_cas/views.py", line 98, in login
auth.login(request, user)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 76, in login
user_logged_in.send(sender=user.__class__, request=request, user=user)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/edx/app/edxapp/edx-platform/common/djangoapps/student/models.py", line 1490, in enforce_single_login
user.profile.set_login_session(key)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 255, in __get__
rel_obj = self.get_query_set(instance=instance).get(**params)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 366, in get
% (self.model._meta.object_name, kwargs))
DoesNotExist: UserProfile matching query does not exist. Lookup parameters were {'user__pk': 82L}

What to do?
set in lms/envs/common.py:
'PREVENT_CONCURRENT_LOGINS': False,
the error is “solved”