Premise:
1. Install Ubuntu
2. use vagrant+virtualbox to build the EdX Developer Stackon ubuntn and to successfully access
3. Pycharm-3.4.1 is installed and activated successfully under Ubuntu
4. future development in Ubuntu environment
Preparatory work:
1. convert path to native /devstack/
2. turn on vagrantand enter the command:
Vagrantup
3. using ssh connection vagrant, enter the command:
Vagrantssh
4. give the edxapp account A password, enter the command:
SUDOPASSWD Edxapp
(I entered the Edxapphere)
To start configuring pycharm:
After the preparation work is done, open pycharm, click opendirectory,
Select native /devstack/edx-platform, click OK
The project is open and will always get code from source control, so source control is off first.
Method: Open "File", "Settings", "VersionControl"
Then select Noneunder VCS .
Next, configure the pycharm compiler:
Open File>settings>projectinterpreter, and in the right projectinterpreter back point Configure the icon addremoting , such as
And then inconfigureremote Python InterpreterIn the window, selectsshcredentials,HostInput127.0.0.1, Port input2222,UsernameInputEdxapp,AuthTypeChoosePassword,PasswordEnter the password after the beginning of the article, tickSavepassword,PythoninterpreterpathSelect the following path to/edx/app/edxapp/venvs/edxapp/bin/python,PycharmhelperspathSelect Path/edx/app/edxapp/edx-platform/.pycharm_helpers, and then clickOKSave. After the configuration is successful, package-related packages are introduced, as
Configuring the Compile command
Open the menu item run>editconfigurations, in the Open run/debugconfigurations window, click the plus sign "+" on the Left > Python
InNameFill inLMS,ScriptFill in./manage.py,scriptparametersFill inlmsrunserver--settings=devstack 0.0.0.0:8000,PythoninterpreterChooseRemotepython 2.7.3 (ssh://edxapp@127.0.0.1: 2222:edx/app/edxapp/....),WorkingDirectoryChoose/edx/app/edxapp/edx-platform,pathmappingsChoose/devstack/edx-platform/=/edx/app/edxap/edx-playform/, uncheckaddcontent roots to PYTHONPATHand uncheck the check boxaddsource roots to PYTHONPATHClickOK, save the settings.
Then click on the left LMS, then click on the minus "-" after Copy, in Name fill in Studio,scriptparameters instead of cmsrunserver--settings=devstack 0.0.0.0:8001, click OKto save the settings.
All configurations are completed.
Click run/debug on pycharm to see http://0.0.0.0:8000 or http://0.0.0.0:8001, Enter in the browser to access, if you see error111, please refer to the following:
The most of the troubleshooting commands assume is using the the Vagrant account. Press Ctrl+d to return from the Edxapp user to the vagrant user.
Pymongo.errors.ConnectionFailure:could not connect to localhost:27017: [Errno 111] Connection refused
If you see this error, attempting to run, the server then you need to remove the lock and restart MongoDB. This error usually occurs when the VM was not shutdown properly. To avoid this problem in the future, use one of the vagrant commands to suspend the VM (e.g. vagrant halt or Vagrant Suspe nd). To fix the problem:
Vagrant SSH
sudo rm/edx/var/mongo/mongodb/mongod.lock
sudo start MongoDB.
Configuring Pycharm3.4.1 debug EdX Devstack