不能在Eclipse上运行谷歌appengine python应用程序,尽管启动程序正常工作 [英] Cant Run Google appengine python app on eclipse although launcher works fine

查看:123
本文介绍了不能在Eclipse上运行谷歌appengine python应用程序,尽管启动程序正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习以下教程:
http://www.mkyong.com/google-app-engine/google-app-engine-python-hello-world-example-using-eclipse/



我创建了一个项目并试图在本地运行它。它没有工作,但当我在Google Appengine启动器上运行它时,它工作得很好。



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



这里是控制台的内容:

 警告2012- 11-28 07:48:10,265 rdbms_mysqldb.py:74] rdbms API不可用,因为无法加载MySQLdb库。 
无效参数
为应用程序运行开发应用程序服务器。

dev_appserver.py [选项]<应用程序根目录>

应用程序根目录必须是应用程序在此服务器中运行的路径。
必须包含有效的app.yaml或app.yml文件。

选项:
--address = ADDRESS,-a ADDRESS
该服务器应绑定的地址。 (默认
本地主机)。
--clear_datastore,-c启动时清除数据存储。 (默认为false)
--debug,-d使用调试日志记录。 (默认为false)
--help,-h查看这个有用的信息。
--port = PORT,-p PORT服务器运行的端口。 (默认8080)

--allow_skipped_files允许访问与app.yaml的
匹配的文件skipped_files(默认为False)
--auth_domain此应用程序运行的授权域。
(默认gmail.com)
--backends运行带有后端支持
(多进程模式)的dev_appserver。
--blobstore_path = DIR用于存储Blobstore
文件存根数据的目录路径。
--clear_prospective_search清除预期搜索订阅索引
(默认为false)。
--clear_search_indexes清除全文搜索索引(默认为false)。
--datastore_path = DS_FILE用于存储数据存储文件
存根数据的文件路径。
(默认c:\ users \gideon\appdata\local\temp\dev_appserver.datastore)
--debug_imports启用模块导入的调试日志记录,显示
搜索路径用于查找导入过程中遇到的模块和任何
错误。
--default_partition在APPLICATION_ID中使用的默认分区。
(默认开发)
--disable_static_caching绝不允许浏览器缓存静态文件。
(如果在app.yaml中设置了过期,则默认启用)
--disable_task_running提供时,任务不会自动在提交后运行
,必须手动运行
在本地管理员安慰。
--enable_sendmail未配置SMTP时启用sendmail。
(默认为false)
--high_replication使用高复制数据存储一致性
模型。 (默认为false)。
--history_path = PATH用于存储数据存储历史记录的路径。
(默认c:\ users \gideon\appdata\local\temp\dev_appserver.datastore.history)
--multiprocess_min_port当在多进程模式下运行时,指定
选择端口时使用的最低端口值。如果
设置为0,请选择随机端口。
(默认9000)
--mysql_host = HOSTNAME MySQL数据库主机。
由Cloud SQL(rdbms)存根使用。
(默认'localhost')
--mysql_port = PORT连接到的MySQL端口。
由Cloud SQL(rdbms)存根使用。
(默认3306)
--mysql_user = USER用户连接为MySQL的用户。
由Cloud SQL(rdbms)存根使用。
(默认)
--mysql_password =要使用的PASSWORD MySQL密码。
由Cloud SQL(rdbms)存根使用。
(默认'')
--mysql_socket = PATH MySQL Unix套接字文件路径。
由Cloud SQL(rdbms)存根使用。
(默认'')
--persist_logs启用所有请求和应用程序
日志的存储以启用以后的访问。 (默认为false)。
--require_indexes禁止在index.yaml中未定义复合索引
的查询。
--search_indexes_path = PATH用于存储全文搜索
索引的文件路径(默认c:\ users \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
--show_mail_body在邮件存根中记录电子邮件的正文。
(默认为false)
--skip_sdk_update_check跳过检查SDK更新。如果为false,则将
退回到.appcfg_nag
中指定的opt_in设置(默认为false)
--smtp_host = HOSTNAME要将测试邮件发送到的SMTP主机。保留这个
未设置将禁用SMTP邮件发送。
(默认'')
--smtp_port =发送测试邮件到的SMTP端口。
(默认25)
--smtp_user =要连接的SMTP用户。如果此字段非空,存根将只尝试
登录。
(默认'')。
--smtp_password = PASSWORD SMTP服务器的密码。
(默认值'')
--task_retry_seconds在执行期间重试
任务失败后需要等待几秒钟。
(默认'30')
--use_sqlite使用新的基于SQLite的数据存储区存根。
(缺省为false)
--port_sqlite_data将数据从基于文件的数据存储
转换为新的SQLite存根,仅一次使用。
(默认为false)
- [enable | disable] _console启用/禁用交互式控制台。
(如果--address未设置,则默认启用,如果设置了--address,则禁用



    li>右键单击项目 - > Python在主选项卡中运行

    项目文本字段浏览到项目
    在主模块路径到应用程序服务器C:\程序文件(x86)\Google\\在参数选项卡中输入\google_appengine\dev_appserver.py

    程序参数$ {project_loc} / src确保将

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

波纹管
apply
run p>


  1. 右键单击项目 - > PyDev Google App Run
    主选项卡中的

    项目文本字段浏览至项目
    在参数中的主模块路径$ {GOOGLE_APP_ENGINE} /dev_appserver.py
    参数选项卡
    程序参数$ {workspace_loc:HelloWorld / src}确保将
    放入工作目录check Other $ {workspace_loc:HelloWorld}

下次只需点击配置即可。



要上传到云端运行配置。



右键项目 - > PyDev Google App Run

在主选项卡
项目文本字段浏览到项目
在主模块路径到appserver $ {GOOGLE_APP_ENGINE} /appcfg.py
在参数标签中
程序参数更新$ {workspace_loc:HelloWorld / src}
确保你放入
确保更新是在工作目录中的
之外检查默认$ {project_loc:/ selected project name}



命令行的特质性质我花了7个小时尝试使用错误的教程来运行项目


I'm following this tutorial: http://www.mkyong.com/google-app-engine/google-app-engine-python-hello-world-example-using-eclipse/

I created a project and tried to run it locally. It didn't work but when I ran it on the Google appengine launcher it worked just fine.

I noticed that eclipse doesn't create .project and .pydevproject files in the project

here is the console contents:

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)

解决方案

There are 2 run configurations that I managed to run the project localy with.

  1. right click project --> Python Run in main tab Project text field browse to project In Main Module path to appserver C:\Program Files (x86)\Google\google_appengine\dev_appserver.py in Arguments tab Program arguments "${project_loc}/src" make sure you put the ""

in Working directory check Other ${project_loc:/selected project name}

bellow apply run

  1. right click project --> PyDev Google App Run
    in main tab Project text field browse to project In Main Module path to appserver ${GOOGLE_APP_ENGINE}/dev_appserver.py in Arguments tab Program arguments "${workspace_loc:HelloWorld/src}" make sure you put the "" in Working directory check Other ${workspace_loc:HelloWorld}

next time you can just click the configuration

To upload to the cloud appengine run configurations.

right click project --> PyDev Google App Run
in main tab Project text field browse to project In Main Module path to appserver ${GOOGLE_APP_ENGINE}/appcfg.py in Arguments tab Program arguments update "${workspace_loc:HelloWorld/src}" make sure you put the "" make sure update is outside the "" in Working directory check Default ${project_loc:/selected project name}

To whom it might concern an IDE should shield the developer from the Idiosyncratic nature of the command line I spent 7 hours trying to run a project using faulty tutorials

这篇关于不能在Eclipse上运行谷歌appengine python应用程序,尽管启动程序正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆