Way to google engine in linux?

I am starting to learn googleapp engine and use python. Whenever I create a new project, should I always include all the configuration and python files like these,

abhilash@abhilash:~/python_resources/google_appengine$ ls
appcfg.py  bulkload_client.py  demos             google  LICENSE               README         remote_api_shell.py  tools
BUGS       bulkloader.py       dev_appserver.py  lib     new_project_template  RELEASE_NOTES  templates            VERSION

Is it possible to put dev_appserver.py and others in / bin / bash so that I can use them whenever I create a project? Or how to set up the application forever in the workplace?

+5
source share
4 answers

The new GAE project does not need any of these files.
In the Getting Started Guide, you only need app.yamland main.py.

, google_appengine PATH .bashrc, .

export PATH=$HOME/google_appengine:$PATH

python2.5, :

ln -s /usr/bin/python2.5 ~/google_appengine/python

, :

$ dev_appserver.py /path/to/myapp/
+13

python.

, /usr/local/

export GAE="/usr/local/google_appengine"
export PYTHONPATH="$PYTHONPATH:$GAE"
export PATH="$PATH:$GAE"

, , , .....

+3

Google Cloud SDK, ~/.profile ( ~/.bash_profile OS X):

#!/usr/bin/env bash

export CLOUDSDK_ROOT_DIR="/path/to/google/cloud/sdk/"
export APPENGINE_HOME="${CLOUDSDK_ROOT_DIR}/platform/appengine-java-sdk"
export GAE_SDK_ROOT="${CLOUDSDK_ROOT_DIR}/platform/google_appengine"

# The next line enables Java libraries for Google Cloud SDK
export CLASSPATH="${APPENGINE_HOME}/lib":${CLASSPATH}

# The next line enables Python libraries for Google Cloud SDK
export PYTHONPATH=${GAE_SDK_ROOT}:${PYTHONPATH}

# * OPTIONAL STEP *
# If you wish to import all Python modules, you may iterate in the directory
# tree and import each module.
#
# * WARNING *
# Some modules have two or more versions available (Ex. django), so the loop
# will import always its latest version.
for module in ${GAE_SDK_ROOT}/lib/*; do
  if [ -r ${module} ]; then
    PYTHONPATH=${module}:${PYTHONPATH}
  fi
done
unset module
+1

Add the following lines to the .bashrcfile

export PATH=$PATH:/path/to/google_appengine/
export PYTHONPATH="$PYTHONPATH:/path/to/google_appengine:/path/to/google_appengine/‌​lib/:/path/to/google_appengine/lib/yaml/"
0
source

All Articles