Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 87 lines (58 sloc) 2.614 kb
fa30d42 Added some basic documentation
Corey Oordt authored
1 ==========================================
2 Generating a Packagable Django Application
3 ==========================================
4
5 The ``create_app.py`` uses several variables to replace within a "template" directory. The default template directory is included and called "skel".
6
7 Running the script
8 ==================
9
10 The script requires that ``virtualenv`` and ``virtualenvwrapper`` are installed on your system.
11
12 The script is interactive, although you can specify some options when you call it. Calling the script is as easy as::
13
14 python create_app.py
15
16 and the script will ask you for everything it needs.
17
18 .. parsed-literal::
19
20 **Application name:** django-coolapp
21 **Package name [coolapp]:**
22 **Author [jcooluser]:** Johnny Cooluser
23 **Destination directory [/home/jcooluser/app-skel]:** ..
24 **Application template directory [/home/jcooluser/app-skel/skel]:**
25 **Virtual environment name [django-coolapp]:** coolapp
26
27 You can specify some or all of the options when calling the script.
28
29 Command-line Options
30 ********************
31
32 -a, --author
33 The name of the author.
34
35 -n, --name
36 The name of the application, like 'django-coolapp'.
37
38 -p, --package
39 The name of the installed package, like 'coolapp'.
40
41 -v, --virtenv
42 The name of the virtualenv to create.
43
44 -d, --dest
45 Where to put the new application. Relative paths are recognized.
46
47 -t, --template
48 The application template to use as a basis for the new application. Relative paths are recognized.
49
50
51 Variable Substitution
52 =====================
53
54 The script creates several substitution variables that it uses to substitute for file names and within text files.
55
56
57 APP_NAME
58 The name supplied by ``-n``\ , ``--name``\ , or the answer to *Application name*.
59
60 PKG_NAME
61 The name supplied by ``-p``\ , ``--package``\ , or the answer to *Package name*. The default is the ``APP_NAME`` without ``django-``\ .
62
63 AUTHOR
64 The value supplied by ``-a``\ , ``--author``\ , or the answer to *Author*. The default is the current user name.
65
66 SECRET_KEY
67 A randomly generated string of characters used in the ``settings.py`` file.
68
69 VIRTENV
70 The name supplied by ``-v``\ , ``--virtenv``\ , or the answer to *Virtual environment name*. The default is the ``APP_NAME``\ .
71
72 The variables are referenced by surrounding them with ``$$$$``\ , such as ``$$$$APP_NAME$$$$``\ . Here is an example from the setup.py file::
73
74 setup(
75 name = "$$$$APP_NAME$$$$",
76 version = __import__('$$$$PKG_NAME$$$$').get_version().replace(' ', '-'),
77 url = '',
78 author = '$$$$AUTHOR$$$$',
79
b93eda6 Added a Contributors section
Corey Oordt authored
80 Contributors
81 ============
82
83 Eric Florenzano
84 Corey Oordt
85 Jose Soares
86 Justin Quick
87 Adam Patterson
Something went wrong with that request. Please try again.