Wing IDE 创建 Django 工程

转自:http://wingware.com/doc/howtos/django


Existing Django Project

To set up a Wing IDE Professional project for an existing Django project:

  • Create a new project from the Project menu,
  • Add the Django site directory to the Wing project (so that manage.py and settings.py are both in the project),
  • Wait until the Django menu appears in the menu bar, and
  • Select the Configure Project for Django item from that menu.

This sets the Python Executable in Project Properties (if it can be located), sets up manage.py runserver --noreload 8080 as the main debug file, addsDJANGO_SITENAME and DJANGO_SETTINGS_MODULE to the environment in Project Properties, adds the site directory to the Python Path in the Wing project, ensures Django Template Debugging in Project Properties is enabled, turns on TEMPLATE_DEBUG in your site's settings.py file (debugging templates will not work without this), and sets the Default Test Framework in the Testing tab of Project Properties so that Wing's Testing tool will invoke manage.py test.

Now you should be able to start Django in Wing IDE's debugger, set breakpoints in Python code and Django templates, and reach those breakpoints in response to a browser page load.

New Django Project

If you are starting a new Django project at the same time as you are setting up your Wing IDE project:

  • Select Start Django Project from the Extensions sub-menu of the Project menu.
  • You will be prompted for the location of django_admin.py, location to place the new project, and the site name in the same entry area. Defaults for these values are based on the current project contents, if a Django project is already open.
  • Press Enter and Wing will set up a new Django project and your Wing IDE project at the same time.

This runs django_admin.py startproject <sitename>, sets up settings.py to use sqlite3 default database engine, adds django.contrib.admin toINSTALLED_APPS, runs syncdb, and copies the default admin template base_site.html from your Django installation into your site's templates/admin directory.

Note that on Windows you will see an error that the superuser account could not be set up. The error includes the command that needs to be run interactively. To complete project creation, copy/paste this into a command console.

When project setup is completed, the command offers to creates a new Wing IDE project, add the files, and configure the project for use with Django as described in the Existing Django Project sub-section above.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值