前提:

1.安装好Ubuntu

2.在Ubuntn上利用vagrant+VirtualBox 搭建好了edX Developer Stack,并能成功访问

3.在Ubuntu下安装好了Pycharm-3.4.1并成功激活

4.将来在Ubuntu环境下开发

准备工作:

1.转换路径到本机/devstack/

2.开启vagrant,输入命令:

vagrant
up

3.利用ssh连接vagrant,输入命令:

vagrant
ssh

4.给edxapp帐号一个密码,输入命令:

sudo
passwd edxapp

(这里我输入的为edxapp)

开始配置Pycharm:

以上准备工作做完后,打开Pycharm,点击Open
Directory,

选择本机/devstack/edx-platform,点击OK

项目打开了,会一直在从源代码管理获取代码,所以先关了源代码管理。

方法:打开“File”->”Settings”->”Version
Control”

然后在VCS下面选择none。

接下来配置Pycharm
编译器:

依次打开File>Settings>Project
Interpreter,在右侧Project
Interpreter后面点配置图标Add
Remoting,如下图

然后在Configure
Remote Python Interpreter窗口内,选择SSH
Credentials,Host输入127.0.0.1,端口输入2222,User
name 输入edxapp,Auth
type选择Password,Password输入文章开头改后的密码,勾选Save
password,Python
interpreter
path选择后面的路径为/edx/app/edxapp/venvs/edxapp/bin/python,Pycharm
helpers
path选择路径/edx/app/edxapp/edx-platform/.pycharm_helpers,然后点OK保存。配置成功后会包相关的包都引入,如下图

配置编译命令

依次打开菜单项Run>Edit
Configurations,在打开的Run/Debug
Configurations窗口,左侧点击加号”+”>Python

在Name填入LMS,Script填入./manage.py,Script
parameters填入lms
runserver --settings=devstack 0.0.0.0:8000,Python
interpreter选择Remote
Python 2.7.3(ssh://edxapp@127.0.0.1:2222:edx/app/edxapp/....),Working
directory选择/edx/app/edxapp/edx-platform,Path
mappings
选择/devstack/edx-platform/=/edx/app/edxap/edx-playform/,取消勾选Add
content roots to PYTHONPATH和取消勾选Add
source roots to PYTHONPATH,点击OK,保存设置。

然后先点击左侧LMS,然后点击减号”—”后面的Copy,在Name填入Studio,Script
parameters改为cms
runserver --settings=devstack 0.0.0.0:8001,点击OK,保存设置。

以上就完成了所有配置。

在Pycharm
点击run/debug就可以看到http://0.0.0.0:8000或http://0.0.0.0:8001,在浏览器中输入即可访问,如果看到error
111,请参考以下:

Most of the troubleshooting commands assume you are using 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 when attempting to run the server then you need to remove the lock and restart mongodb. This error usually occurs when the VM is 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 suspend). To fix the problem:

vagrant ssh
sudo rm /edx/var/mongo/mongodb/mongod.lock
sudo start mongodb.

最新文章

  1. 02.JavaScript基础上
  2. Why MySQL could be slow with large tables ?
  3. [BZOJ1876][SDOI2009]superGCD(高精度)
  4. glibc strlen delphi pascal
  5. SSL/TLS/WTLS原理(密钥协商的形象化比喻:验证服务器的身份,用服务器的公钥协商加密格式,然后再加密具体的消息,TCP传递SSL处理后的数据)good
  6. HTTP 错误 500.21 - Internal Server Error的解决方案
  7. 在CentOS 7中轻松安装Atomic应用(atomicapp)
  8. effective_c++条款20,用pass-by-reference-to-const替换pass-by-value
  9. js 环形链表
  10. 如何测试sql语句性能,提高执行效率
  11. 14.10.3 InnoDB Checkpoints InnoDB 检查点:
  12. iOS 开发问题集锦(三)
  13. C++ 头文件系列(iosfwd)
  14. iOS使用自签名证书实现HTTPS请求
  15. leetcode 66.加一 python3
  16. Visible Lattice Points (莫比乌斯反演)
  17. killl prefix out macro mis mal micro -m
  18. 作业6--四则运算APP之Sprint计划
  19. 51nod 1480 打广告(二分+线段树)
  20. XML解析之JAXP

热门文章

  1. spring的依赖注入的最常见的两种方法
  2. ASP获取当前页面带参数的网址(URL地址)的方法
  3. Jquery方法大全
  4. ArrayList、Vector、LinkedList的区别及其优缺点? (转载)
  5. HTML——<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  6. Flex布局新旧混合写法详解(兼容微信)
  7. Poj 1017 / OpenJudge 1017 Packets/装箱问题
  8. centos下如何用SMplayer播放WMV格式文件
  9. JDBC访问SQLServer2008数据库
  10. width(),innerHTML(),outerHTML()