开发者

How do I redirect Django commands using PyDev?

I would like to run the following Django command (to dump the contents of my database into a text file):

pyth开发者_Python百科on manage.py dumpdata my_app > data.json

I'm using the Django framework within PyDev as an Eclipse plugin. Therefore, in order to run the above command in PyDev I go to "Custom command" and insert dumpdata my_app > data.json. However, doing so results in an error because of the > character:

Error: Unknown application: >

How can I use > (redirection) in PyDev?


  1. Open Eclipse and go to menu Run > Run configurations
  2. Click on Pydev Django and then the "New" icon to create a new launch configuration
  3. Tab main: select the project and main module (manage.py)
  4. Tab interpreter: select which interpreter will run manage.py
  5. Tab arguments: write dumpdata my_app in Program arguments
  6. Tab common: check File in "Standard input and Output" and set your output location and filename. Uncheck "Allocate console".

Finally click on Apply and Run. A bit tricky but works as it should.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜