-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
181 lines (123 loc) · 6.74 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
GOOGLE APP ENGINE HELPER FOR DJANGO
===================================
This package provides a helper that eases the process of developing a Django
project to run on the Google App Engine. The helper is structured as a Django
application that should be installed inside your project. See below for
detailed usage instructions.
The helper provides the following functionality:
* The ability to use most manage.py commands
- Additional manage.py commands (update, rollback, and vacuum_indexes) that
operate identically to the appcfg.py equivalents.
* A BaseModel class that appears the same as the standard Django Model class.
* The ability to serialize and deserialize model instances to JSON, YAML and
XML.
* Access to Django's test framework with a test datastore and support for
fixtures.
* The ability to send email via the App Engine mail API using the standard
Django mail functions.
* An App Engine compatible implementation of the Django authentication
framework. Only users are supported at this time. Group and Permission
support is not implemented.
* Support for the Django memcache cache backend module.
* Support for the db and cache session backed modules when using Django
1.0alpha.
The helper is provided in the context of a blank Django project, very
similar to what would be provided by the django-admin.py startproject command.
This project contains minor customisations to manage.py and settings.py that
demonstrate how to integrate the helper with a Django project.
To use the helper you have two choices:
1) Copy the entire project provided with the helper and modify it to bootstrap
your project.
2) Copy the appengine_django application into your existing project and modify
the settings appropriately.
Instructions for both cases are provided below.
Obtaining the helper
--------------------
You can download the latest released version of the helper from the Google Code
project at: http://code.google.com/p/google-app-engine-django
The helper will be unzipped into a directory named appengine_helper_for_django.
Alternatively you can check out the latest version of the helper directly from
the SVN repository with the following command:
svn co http://google-app-engine-django.googlecode.com/svn/trunk/ \
appengine_helper_for_django
Required Software
-----------------
You will need the Google App Engine SDK and its dependencies installed on your
computer. Additionally if you are developing on a Windows machine you will need
to install the Python for Windows extensions from
http://sourceforge.net/projects/pywin32/
Using the helper to bootstrap a new project
-------------------------------------------
1) Copy the appengine_helper_for_django directory to a new location named after
your project
2) Edit the application line in app.yaml to match the name you registered your
application under in the Admin Console.
3) If you have installed the Google App Engine SDK using the Windows or MacOS
installers provided by Google you may skip this step.
Copy (or create a symlink) from the location of the extracted SDK zipfile to
the '.google_appengine' directory inside your project. E.g:
ln -s /home/me/google_appengine /home/me/myproject/.google_appengine
If you like to stay up to date see the 'SDK via SVN' section below for an
alternative setup.
4) Run manage.py to start a new application for your code:
python manage.py startapp myapplication
5) Add your code!
Installing the helper into an existing project
----------------------------------------------
1) Copy the appengine_django application from within the helper into your
project.
2) Copy app.yaml and main.py from within the helper into your project.
3) Edit the application line in app.yaml to match the name you registered your
application under in the Admin Console.
4) Add the following two lines to the top of manage.py::
from appengine_django import InstallAppengineHelperForDjango
InstallAppengineHelperForDjango()
5) If you have installed the Google App Engine SDK using the Windows or MacOS
installers provided by Google you may skip this step.
Copy (or create a symlink) from the location of the SDK to the
'.google_appengine 'directory inside your project. E.g:
ln -s /home/me/google_appengine /home/me/myproject/.google_appengine
If you like to stay up to date see the 'SDK via SVN' section below for an
alternative setup.
6) Remove incompatible settings from your settings.py file.
The helper can warn you about some settings that it knows to be
incompatible, you can see these warnings by running::
python manage.py diffsettings
For the rest you'll just have to experiment by trial and error. The main
problem here is usually loading middleware that attempts to import modules
that are banned by the appserver.
7) Port your models and code over to the appengine_django.model.BaseModel
class.
SDK via SVN
-----------
If you are using SVN to manage your project and you would like to keep up to
date with the latest SDK without having to download and install it regularly
you can use an svn:external to include the SDK in our project.
Once you have commited the basic structure of your project to your repository
change to the base directory and add the following line to the svn:externals
property using svn propset or svn propedit.
.google_appengine http://googleappengine.googlecode.com/svn/trunk/
Then run svn update and a copy of the SDK will be installed into the
'.google_appengine' subdirectory. This copy of the SDK will be updated with the
latest changes from the Google Code repository every time you run svn update.
Contributing to the helper
--------------------------
We would be happy to consider any additions or bugfixes that you would like to
add to the helper. Please add them as a patch, in unified diff format to the
Issue Tracker at: http://code.google.com/p/google-app-engine-django/issues/list
Before we can accept your code you will need to have signed the Google
Contributer License. You can find this at:
http://code.google.com/legal/individual-cla-v1.0.html
or
http://code.google.com/legal/corporate-cla-v1.0.html
If you are an Individual contributor you will be able to electronically sign
and submit the form at the URL above. Please ensure that you use the same email
address to submit your patch as you used to sign the CLA.
Reporting Bugs and Requesting Features
--------------------------------------
Please see the KNOWN_ISSUES file and the existing list of issues at
http://code.google.com/p/google-app-engine-django/issues to see if your problem
has already been reported.
If you find a bug or would like to request a feature you may do so at the
Google Code issue tracker for this project:
http://code.google.com/p/google-app-engine-django/issues/entry