0

我正在关注本教程: http ://www.mkyong.com/google-app-engine/google-app-engine-python-hello-world-example-using-eclipse/

我创建了一个项目并尝试在本地运行它。它没有用,但是当我在 Google appengine 启动器上运行它时,它运行得很好。

我注意到eclipse没有在项目中创建 .project 和 .pydevproject 文件

这是控制台内容:

WARNING  2012-11-28 07:48:10,265 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
Invalid arguments
Runs a development application server for an application.

dev_appserver.py [options] <application root>

Application root must be the path to the application to run in this server.
Must contain a valid app.yaml or app.yml file.

Options:
  --address=ADDRESS, -a ADDRESS
                             Address to which this server should bind. (Default
                             localhost).
  --clear_datastore, -c      Clear the Datastore on startup. (Default false)
  --debug, -d                Use debug logging. (Default false)
  --help, -h                 View this helpful message.
  --port=PORT, -p PORT       Port for the server to run on. (Default 8080)

  --allow_skipped_files      Allow access to files matched by app.yaml's
                             skipped_files (default False)
  --auth_domain              Authorization domain that this app runs in.
                             (Default gmail.com)
  --backends                 Run the dev_appserver with backends support
                             (multiprocess mode).
  --blobstore_path=DIR       Path to directory to use for storing Blobstore
                             file stub data.
  --clear_prospective_search Clear the Prospective Search subscription index
                             (Default false).
  --clear_search_indexes     Clear the Full Text Search indexes (Default false).
  --datastore_path=DS_FILE   Path to file to use for storing Datastore file
                             stub data.
                             (Default c:\users\gideon\appdata\local\temp\dev_appserver.datastore)
  --debug_imports            Enables debug logging for module imports, showing
                             search paths used for finding modules and any
                             errors encountered during the import process.
  --default_partition        Default partition to use in the APPLICATION_ID.
                             (Default dev)
  --disable_static_caching   Never allow the browser to cache static files.
                             (Default enable if expiration set in app.yaml)
  --disable_task_running     When supplied, tasks will not be automatically
                             run after submission and must be run manually
                             in the local admin console.
  --enable_sendmail          Enable sendmail when SMTP not configured.
                             (Default false)
  --high_replication         Use the high replication datastore consistency
                             model. (Default false).
  --history_path=PATH        Path to use for storing Datastore history.
                             (Default c:\users\gideon\appdata\local\temp\dev_appserver.datastore.history)
  --multiprocess_min_port    When running in multiprocess mode, specifies the
                             lowest port value to use when choosing ports. If
                             set to 0, select random ports.
                             (Default 9000)
  --mysql_host=HOSTNAME      MySQL database host.
                             Used by the Cloud SQL (rdbms) stub.
                             (Default 'localhost')
  --mysql_port=PORT          MySQL port to connect to.
                             Used by the Cloud SQL (rdbms) stub.
                             (Default 3306)
  --mysql_user=USER          MySQL user to connect as.
                             Used by the Cloud SQL (rdbms) stub.
                             (Default )
  --mysql_password=PASSWORD  MySQL password to use.
                             Used by the Cloud SQL (rdbms) stub.
                             (Default '')
  --mysql_socket=PATH        MySQL Unix socket file path.
                             Used by the Cloud SQL (rdbms) stub.
                             (Default '')
  --persist_logs             Enables storage of all request and application
                             logs to enable later access. (Default false).
  --require_indexes          Disallows queries that require composite indexes
                             not defined in index.yaml.
  --search_indexes_path=PATH Path to file to use for storing Full Text Search
                             indexes (Default c:\users\gideon\appdata\local\temp\dev_appserver.searchindexes).
  --show_mail_body           Log the body of emails in mail stub.
                             (Default false)
  --skip_sdk_update_check    Skip checking for SDK updates. If false, fall back
                             to opt_in setting specified in .appcfg_nag
                             (Default false)
  --smtp_host=HOSTNAME       SMTP host to send test mail to.  Leaving this
                             unset will disable SMTP mail sending.
                             (Default '')
  --smtp_port=PORT           SMTP port to send test mail to.
                             (Default 25)
  --smtp_user=USER           SMTP user to connect as.  Stub will only attempt
                             to login if this field is non-empty.
                             (Default '').
  --smtp_password=PASSWORD   Password for SMTP server.
                             (Default '')
  --task_retry_seconds       How long to wait in seconds before retrying a
                             task after it fails during execution.
                             (Default '30')
  --use_sqlite               Use the new, SQLite based datastore stub.
                             (Default false)
  --port_sqlite_data         Converts the data from the file based datastore
                             stub to the new SQLite stub, one time use only.
                             (Default false)
  --[enable|disable]_console Enables/disables the interactive console.
                             (Default enabled if --address is unset,
                              disabled if --address is set)
4

1 回答 1

0

我设法在本地运行项目有 2 个运行配置。

  1. 右键单击项目-> Python 在主选项卡中运行项目文本字段浏览到项目在主模块路径中的应用程序服务器 C:\Program Files (x86)\Google\google_appengine\dev_appserver.py 在参数选项卡程序参数“${project_loc}/ src" 确保你把 ""

在工作目录中检查其他 ${project_loc:/selected 项目名称}

波纹管应用运行

  1. 右键单击项目-> PyDev Google App
    在主选项卡中运行项目文本字段浏览到项目在主模块路径中的应用程序服务器 ${GOOGLE_APP_ENGINE}/dev_appserver.py 在参数选项卡中程序参数“${workspace_loc:HelloWorld/src}”确保你把“”放在工作目录检查其他 ${workspace_loc:HelloWorld}

下次可以直接点击配置

上传到云 appengine 运行配置。

右键单击项目 --> PyDev Google App
在主选项卡中运行 项目文本字段浏览到项目 在主模块路径中的应用程序服务器 ${GOOGLE_APP_ENGINE}/appcfg.py 在参数选项卡中程序参数更新“${workspace_loc:HelloWorld/src}”确保你把“”确保更新在工作目录中的“”之外检查默认$ {project_loc:/选定的项目名称}

IDE 应该保护开发人员免受命令行的特殊性质的影响 我花了 7 个小时尝试使用错误的教程运行项目

于 2012-11-30T07:01:27.267 回答