Ticket #5 (new enhancement)
Better Django file system organization and administration command
| Reported by: | bjorn | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | 10% | Keywords: | |
| Cc: |
Description
NEW DIRECTORY STRUCTURE
config/ -- if imported will look into ../.django/environment for current environment
init.py settings.py urls.py environments/
development.py production.py test.py -- also add support for /tests URL
dataload = data.test.load()
.django/
environment -- file containing name of current environment, e.g., development
test/
...
data/
development/ test/
init.py person.yml
log/
test.log development.log production.log
doc/
README.txt -- introduce application, talk about automatically generated docs (URL) *own documentation*
vendor/
media/ -- public, static stuff
.htaccess -- get started using Apache quickly js/ css/ img/
NEW ADMIN COMMAND
# "django" will: # * look through current and parent folders until it finds .django/ directory # * read the contents of .django/environment and assign it to environment (or set environment to 'development' if not found) # env='development' # from import config.environments[env] import * # ...
GLOBAL OPTIONS django [-d /path/to/project] -- set path to directory django [-e development] ... -- override current environment
COMMANDS django -- same as 'django help' django * help -- show help of any command hierarchy
django env -- print env django env list -- list environments django env production -- set to production environment django env test django env development -- also default env
django db -- startup SQL CLI on database?
django db clear -- clear the database django db create -- create the schema and data in the database django db create showsql -- same as above, but only print sql statements django db reset -- clear and create django db reset showsql -- same as above, but only print sql statements
django db schema create [model] -- create the schema in the database django db schema create showsql [model] -- same as above, but only print sql statement django db schema showsql -- print sql statements for current schema
django db data create [model] -- insert sample data django db data create showsql [model] -- same as above, but only print sql statements django db data showsql -- print sql statements for current data
django db showsql -- dump the current database schema and data
django test -- run all unit and functional tests django test unit -- run all unit tests django test functional -- run all functional tests in browser, visible django test functional hidden -- run all functional tests in hidden mode (only if we can set up Xvnc or other 'hidden' X server) django test [unit | functional] list -- list the tests (all if unit or functional not specified)
django server [host[:port]] -- start server in foreground django server-daemon [host[:port]] start -- start server as daemon django server-daemon [host[:port]] stop -- stop server daemon django server-daemon [host[:port]] status -- check status of server daemon django server --profile
django generate -- list generators django generate project [name] django generate app [name] django generate view [name] -- creates skeleton for view (controller) django generate model [name] django generate mailer? [name] django generate webservice? [name]
django generate *extensible* [name]
django debug -- startup python CLI
NEW FILES
/bin/django
/lib/python/site-packages/djangomgr
mgr.py commands/
db.py debug.py env.py test.py server.py server.py help.py
generators/
project.py app.py view.py model.py (mailer.py) (webservice.py)
PLAN
start with
django env * django server django test * django debug ...
