以前介绍过用Django来写blog,
Django作为后台Extjs作为前台来进行Web开发是非常爽的,下面这个系统就是用Django+Extjs来开发的管理系统,
全部是我个人完成,所以比较简陋,
首先来介绍如何设置目录结构 和static 路径 下面是我的工程路径,开发工具使用的是pycharm
然后static关键配置如下
from os.path import dirname, join,abspath
from tools import const
import sitecustomize
const.Const.DEBUG=DEBUG
HERE=abspath(join(dirname( __file__ ), '..')).replace('\\','/')
const.Const.HERE=HERE
ADMINS = (
# ('Your Name', '[email protected]'),
)
STATIC_ROOT =join(HERE,'static')
SITE_STATIC_ROOT=join(STATIC_ROOT,'ext')
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
SITE_STATIC_ROOT,
)
配置Static 有个需要注意的地方就是,把admin导入到static目录下面以后,ext必须配置在其他目录
然后在STATICFILES_DIRS下面添加,否则有可能会引起冲突
源码下载路径
http://download.csdn.net/detail/xugangjava/5366509
安装相关模块后可直接运行 无需配置路径,相关介绍可查看资源中的“运行说明.doc”
(django 1.4.2+ extjs 3.4)