django reference sheet
Django Reference Sheet
Project Setup
Create A Project's Directory Structure
django-admin.py startproject projectname
(this command needs to be issued in the directory you want the project to be in)
Django Admin SQL Commands
All the following commands output sql specific to the appname specified in the command and should be run from with the projectname directory.
django-admin.py sqlinitialdata appnameOutputs the initial-data inserts required for Django's admin framework.
django-admin.py sql appnameOutputs the table creation statementsdjango-admin.py sqlall appnameOutputs both the sqlinitialdata and sql datadjango-admin.py sqlindexes appnameOutputs the the create index statementsdjango-admin.py sqlclear appnameOutputs the the drop table statements and the delete statements for deleting the “initialdata”.django-admin.py startapp appname
(this should be issued in your projectname/apps directory)
Customize the DB and other setting in the projectname/settings/main.py fileInitialize the DB
django-admin.py init
(this command should be issued in your projectname directory)
Set your DJANGO_SETTING_MODULE environment variableUnix:
export DJANGO_SETTINGS_MODULE=projectname.settings.mainWindows:
set DJANGO_SETTINGS_MODULE=myproject.settings.main
(you'll probably want to set these permanently in your ~/.bashrc file in Unix or your my computer properties in Windows)
More Details: doc.guandang.net Setup
Create an App's Directory Structure
django-admin.py startapp appname
(this command should be issued in your projectname/apps directory)
Setup App's models in the projectname/apps/appname/models/appname.py file
Add the App to the INSTALLED_APPS in projectname/settings/main.pyInstall the App in the DB
django-admin.py install appname
(this command should be issued in your projectname directory)
More Details:
doc.guandang.net
Template Syntax
There are two types of syntax:
{% something %} - For tags which include blocks and functional items like loops, if statements, and includes.
{{ variable }} - For variable insertion where “variable” is replaced with it's v

alue.
More Details:
doc.guandang.net
Italicized Text – Placeholder names for your object(s) Courier Text – Commands you type in
暂无评价 2页 1财富值 aix 5L sysadmin Referenc... 8页 免费 django reference sheet 暂无评价 3页 20财富值喜欢此文档的还喜欢...
wordcount striptags removetags truncatewords truncatewords_html adds closing tags ue Iss 4 DJANGO CHEAT SHEET Version 1.0 www.mercurytide.co.uk/careers .....
REFERENCE SHEET FOR BUSINESS VISAS FOR PRC NATIONALS S.No. Name Gender(M /F) Date of Birth Passport No. Name of the Indian Company inviting the ...
ADDITIONAL REFERENCE SHEET OF EMPLOYMENT VISA FOR PRC NATIONALS (For category of 1%/ 20 limit) Sl. No Name Date of Birth Educational Qualification(Scho...
Server-side Reference Sheet Updated 22nd February 2006 This document is designed for people who understand the concept behind server-side coding, but may ...
中文版django官方教程part1_IT/计算机_专业资料。很珍贵的资料 django 中文版... docs for the development server can be found in the runserver reference. ...
G3.1 Reporting Guidelines G3.1– Reference Sheet GRI Sustainability Principles for Defining Report Content The information in a report should cover topics ...
LISREL_Reference_Sheet_2005_11_10_经济学_高等教育_教育专区。lisrel8.8 使用教程(PDF)LISREL Reference Sheet Command Syntax: ... Title Card(s). Any ...
cpp_reference_sheet_理学_高等教育_教育专区 暂无评价0人阅读0次下载举报文档 cpp_reference_sheet_理学_高等教育_教育专区。CPP参考...
Django Documentation Release 1.4 Django Software Foundation May 09, 2012 ...Reference: Request/response objects TemplateResponse objects ? File uploads:...
热门文档