Showing posts with label AppEngine. Show all posts
Showing posts with label AppEngine. Show all posts

Wednesday, March 10, 2010

Django Nonrel and Google App Engine

The guys behind appengine patch have a new project using the Django nonrel project to run on App Engine.

Clone the appropriate projects from bitbucket :
$ hg clone https://[Bitbucket User Name]@bitbucket.org/wkornewald/django-nonrel/
$ hg clone https://[Bitbucket User Name]@bitbucket.org/wkornewald/djangoappengine/
$ hg clone https://[Bitbucket User Name]@bitbucket.org/wkornewald/django-testapp/


The instructions say next, "Now you should be able to create a new app in the testapp folder and use native Django models on App Engine. Try it!"

dignan@dignan-laptop:~/workspace/django-nonrel/django-testapp$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 4, in <module>
from djangoappengine.boot import setup_env
ImportError: No module named djangoappengine.boot

Hmmm.
The documentation calls for two symlinks :
django-testapp/common-apps/djangoappengine -> ../../djangoappengine
django-testapp/common-apps/djangoappengine -> ../../django-nonrel/django

I created them and tried again.
The Google App Engine SDK could not be found!
Make sure it's accessible via your PATH environment.
So I added the it to my path and tried again. Same result.

I found the following on the appengine-patch website:
"you can also put the SDK into any folder that is in the system's PATH environment variable as long as it's called "google_appengine" (this works with any OS)"

My sdk was in "google_appengine_1.3.0". I created a symlink, "google_appengine" and tried again.

/home/dignan/tools/appengine/google_appengine_1.3.0/google/appengine/api/datastore_file_stub.py:40: DeprecationWarning: the md5 module is deprecated; use hashlib instead                                                             
import md5
/home/dignan/tools/appengine/google_appengine_1.3.0/google/appengine/api/memcache/__init__.py:31: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha
WARNING 2010-03-10 22:41:09,468 datastore_file_stub.py:483] Could not read datastore data from /tmp/django_nonreltest.datastore
Traceback (most recent call last):
File "workspace/django-norel/django-testapp/manage.py", line 16, in <module>
execute_manager(settings)
File "/home/dignan/workspace/django-norel/django-testapp/common-apps/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/dignan/workspace/django-norel/django-testapp/common-apps/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "workspace/django-norel/django-testapp/common-apps/djangoappengine/management/commands/runserver.py", line 88, in run_from_argv
start_dev_appserver(argv)
File "workspace/django-norel/django-testapp/common-apps/djangoappengine/management/commands/runserver.py", line 74, in start_dev_appserver
dev_appserver_main.main([progname] + args + [os.getcwdu()])
File "/home/dignan/tools/appengine/google_appengine_1.3.0/google/appengine/tools/dev_appserver_main.py", line 360, in main
config, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "/home/dignan/tools/appengine/google_appengine_1.3.0/google/appengine/tools/dev_appserver.py", line 3441, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError



At least it started! I cd'd into the app's directory and ran:

python manage.py runserver


It started up. I got the default "It worked!" page.

Sunday, February 14, 2010

Using the Google App Engine Helper for Django

Working through the steps to install the Google Appengine Helper for Django, I zipped up Django 1.1 and placed it in the root directory. I ran, "python manage.py runserver" and got the following error :

dignan@dignan-laptop:~/workspace/python/[PROJECT_NAME]$ python manage.py runserver
ERROR:root:Django 1.0 or greater is required!

The solution was simple. I zipped up the "django" folder inside the complete distro and put it in the root.

Thursday, August 27, 2009

app-engine-patch Database problems

I've been using app-engine-patch to get some Django stuff running on Google AppEngine.

Several times my admin password has been reset or invalidated. On a couple of occasions I recreated the admin user from the link on the default page. After styling the site this wasn't possible.

I added the "create_admin_user" entry from the generated myapp/urls.py to the root level urls.py and manually entered the url. That worked.



Tuesday, April 8, 2008

Google AppEngine

New Google AppEngine!

Sweet, couldn't wait to use it. I started the tutorial during lunch. I downloaded and installed Python and the AppEngine. Then I created a work directory, "C:\google_workspace" and a helloworld folder, "C:\google_workspace\helloworld" just like the tutorial said to do, created the files "helloworld.py" and "app.yaml" just like in the tutorial, and fired up the dev_appserver with, "C:\google_workspace\helloworld>dev_appserver.py helloworld\". Instead of "Hello, world!" I got :

C:\google_workspace\helloworld>dev_appserver.py helloworld/
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 50, in
<module>
execfile(script_path, globals())
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 338, in <module>
sys.exit(main(sys.argv))
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 287, in main
config, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver.py", line 2415, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError

Hmm. I ran through a mental checklist before diving into the code (I knew I was being lazy. I was also really looking forward to diving into the code, but I wanted to at least get the thing running first.)
  • Perhaps I should've installed somewhere other than "C:\Program Files" I don't usually put anything in there.
  • Apparently I had Tomcat running which would be blocking 80 (I usually set Tomcat to 80 and JBoss to 8080).
Neither of those made a difference. "I, d, ten, t" error - I was running the wrong file.

Running, "C:\google_workspace\helloworld>dev_appserver.py ./" started the server.

The first line was a prompt, "Allow dev_appserver to check for updates on startup? (Y/n):"
Naturally I said "Y", and I liked name of the config file which was conveniently printed out on the next line, "dev_appserver will check for updates on startup. To change this setting, edit C
:\Documents and Settings\jdavis/.appcfg_nag"

I saw "Hello, world!"

I can't wait to start using this. Now I can finally build a completely scalable side project to make myself rich without spending any money out of pocket! Actually, I can finally stop putting off learning Python.
Blogged with the Flock Browser