Skip to content

Instantly share code, notes, and snippets.

@mehulkar
Last active December 10, 2015 05:29
Show Gist options
  • Save mehulkar/4388398 to your computer and use it in GitHub Desktop.
Save mehulkar/4388398 to your computer and use it in GitHub Desktop.
Setting up Django/Google App Engine on a dev server

Run Django / Google App Engine on local dev server

Hopefully these instructions are useful to some Googler in the future.

  1. Install Python. Python comes with OSX. Test by typing python in terminal. If it opens a python shell, you're good to go.
  2. Install pip. easy_install pip works on OSX. This should add symlinks and add the executable to $PATH also. Technically you don't need to install pip though because every virtualenv environment comes with pip. It's easier to install virtualenv with pip though. Haven't tried easy_install virtualenv.
  3. Install virtualenv. Run pip install virtualenv. You may need to add the install directory to $PATH.
  4. Install Google AppEngine SDK from here. Drag to Applications folder. Launch it, make sure it creates symlinks. Add the google_appengine directory to the $PYTHONPATH environment variable.
  5. Navigate to your project directory. There should be an app.yaml file in the directory if it's a Google App Engine project.
  6. Create a new virtual environment by running virtualenv env. Activate it by running source etc/bin/activate. I would add the env/ that is generated to a .gitignore if you're using version control.
  7. Install Django in virtual env. pip install django==1.3. The version number is optional. It'll install the latest if you don't include it. You want to install this again in your virtual environment even if it's already installed outside. This installation will be somewhere inside env/
  8. Start the server by running dev_appserver.py . instead of manage.py or django-admin.py. Default port is 8080.
@rafaelsantoni
Copy link

This is not working for me. I don't know how recent or old this post is because I don't see a date but since it says here that your last activity was about a year ago, I hope you get a notification of my comments.

Can you be more specific on steps 6-8? Do I need to create a new app.yaml inside the env directory? Since the default directory from the appengine project is the root directory and env is a sub-directory of it what happens next? When I run the appengine project following your instructions all I get is the Hello World! that was created by the Appengine SDK application.

Should I make any changes to the original app.yaml file the Appengine created?

Any suggestion is much appreciated.

Thank you,

Rafael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment