WaZaRWiki : DjangoFramework

GaelReignier :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register :: Hosted by: eNiX

Create a project

django-admin.py startproject mysite

Create a new app:

Several apps can exist in the same project

python manage.py startapp polls

Sync the view with the db

python manage.py syncdb

Run the test server
python manage.py runserver 8080

Show what SQL statements will be generated from models

python manage.py sql appName

Commit the databases changes to the database
python manage.py syncdb

Managing the admin panel

class stockInline ( admin.TabularInline  ): # admin.StackedInline
    model = Stock
    extra = 3

class stockAdmin ( admin.ModelAdmin ):
    inlines = [stockPriceInline]
    list_display = ( 'stockName', 'stockQuote' , 'date' )

Displaying different columns:

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0406 seconds