Friday, January 04, 2008

Fun with python: web development with Django: part 2, a little overview

Like many framework like, ruby on rails. Django have a set of utilities.

First thing first,
- django-admin.py. This is the main admin utilities, it have everything from start a project synchronize database, generate sql, shell, run the server.

usage:
just call it in shell
django-admin.py
this will show, the set of options and parameter

django-admin.py startproject name
this will start a project. Which will generate a directory, with the settings file, urls.py which map url to your application, __init__.py and manage.py

- manage.py. This is another admin utility, I didn't see much difference detween this and manage.py. but in most django tutorial, we manage our project, with manage.py.
usage:
in the project directory, in shell
python manage.py
it will show a set of option, similar to django-admin.py

to create new application
python manage.py startapp application-name
this will create your application, the stub of models in model.py, views in view.py

No comments:

Post a Comment