Pycharm multiple modules Run server - python

I'm trying to use multiple modules in google app engine.
i try using this source code:
https://github.com/GoogleCloudPlatform/appengine-modules-helloworld-python
but i cant seem to find a way to run from pycharm with all the .yaml loaded, so only the app.yaml seem to load.
also when trying to upload the code to the appengine (using pycharm) i cant seem to upload all.
is there a way to solve it?
i saw similar question :
Run App Engine development server with modules in PyCharm
but no answer i could figure +
he didnt talked about uploading it to the appengine.
this are the logs :
"C:\PyCharm 4.0.5\bin\runnerw.exe" C:\Python27\python.exe "C:/Program Files (x86)/Google/google_appengine/dev_appserver.py" --host 127.0.0.1 .
INFO 2015-04-24 17:14:31,730 sdk_update_checker.py:229] Checking for updates to the SDK.
WARNING 2015-04-24 17:14:33,382 simple_search_stub.py:1126] Could not read search indexes from c:\users\ishwartz\appdata\local\temp\appengine.pythonfortau\search_indexes
INFO 2015-04-24 17:14:33,401 api_server.py:172] Starting API server at: http://localhost:60656
INFO 2015-04-24 17:14:33,414 dispatcher.py:186] Starting module "default" running at: http://127.0.0.1:8080
INFO 2015-04-24 17:14:33,424 admin_server.py:118] Starting admin server at: http://localhost:8000
nothing strange, they just ignore the other modules.
thanks.

FWIW, I was able to run a multi-module project on the devserver after adding the location of each module's .yaml file relative to the project dir in the Additional options section of the Run -> Edit Configurations menu.
Note: I'm using PyCharm 4.0.6 which has the fix for
PY-10675 - the subject of the similar question you mentioned.
This line in your Run log indicates you don't have the .yaml files for your modules included in the run configurations, it's just running with the default settings:
... (x86)/Google/google_appengine/dev_appserver.py" --host 127.0.0.1 .
Add these to your run configurations:
app.yaml mobile_frontend.yaml static_backend.yaml
With these configs in place you should see something like this in the first line of the Run log:
... (x86)/Google/google_appengine/dev_appserver.py" --host 127.0.0.1 app.yaml mobile_frontend.yaml static_backend.yaml
I'm not 100% sure if dispatch.yaml should also be included (I didn't yet use a dispatcher file in my projects) - follow the messages displayed in the Run console and try to add it as well if needed.
But I am stuck as well at the upload stage as I can't find a place for similar upload configs.
Confirmed by JetBrains as an issue, tracked as PY-15686.
Manual uploads appear to be the only workaround for now.

Related

Log python on Openshift

I have configured my Django project on Openshift with success.
But somewhere in my site I launch a command tool installed by pip and I think the command failed.
But I don't find python log with
rhc tail -a project
Or when I got to /var/lib/openshift/id/app-root/logs/python.log file I don't find more log than displayed at screen
How can I see all my python output console ?
Thanks
[EDIT]
I tried to use the logging configuration for django, but I can't see my log even if I put my app name in loggers.
Your log files are at the directory specified by OPENSHIFT_LOG_DIR environment variable. If you want to have custom log files, you should also write them there.
You can find more information on the log files here: https://developers.openshift.com/managing-your-applications/log-files.html

CKAN extension deployment not working

I have developed couple of extensions and never had any problem in deploying to the production server. I did try to installation a new extension today on my production server that works on my dev machine but doesn't work on the production server. I am suppose to see a new menu option as part on this new extension and I don't see that. To test I changed the extension name in the production.ini and I got an expected error (PlugInNotFoundError). I have restarted the apache and nginx. I am running CKAN 2.1.
I did ran the following command on the production server:
python setup.py develop
I got the message that the plugin was successfully installed.
I also included this new plugin in the production.ini file settings.
Restarted both the apache2 and nginx servers.
Still not seeing a new menu option to access the functionality provided by this newly installed extension.
Any help to sort this out be appreciated.
Thanks,
PK
Do you need to clear your browser's cache? Are there any other settings (e.g. extra_public_paths) that are different between your dev and production machines?

Run App Engine development server with modules in PyCharm

Since the latest release of the Google App Engine Python SDK, it's possible to use modules. I have a Python application with a default module and another module. To start the module in the development server, the development server has to be run like this:
dev_appserver.py app.yaml othermodule.yaml
When I add app.yaml othermodule.yaml to "Additional options" in the Run/Debug configuration of PyCharm and then run the development server, I get the following error message:
google.appengine.tools.devappserver2.errors.InvalidAppConfigError: "."
is a directory and a yaml configuration file is required
This is because PyCharm adds a dot at the end of the command to run the development server, like this:
dev_appserver.py app.yaml othermodule.yaml .
Is it possible to remove the dot, or do I have to wait until this is fixed in PyCharm? Before there were modules, there was no need for this.
You can go around this for the time being by just creating a new Run Configuration.
Chose Python configuration, then fill like this:
script: /path/to/your/dev_appserver.py
script parameters: dispatch.yaml module1.yaml module2.yaml
working directory: /path/to/your/appengine/project
It works just fine like this for me. The dispatcher is launching properly and I've got all the logs like before in PyCharm.

App Engine Bulkloader

I am trying to use Bulkloader of google app engine but unfortunately could not understand what to do from documentation. It says add this part to app.yaml
builtins:
- remote_api: on
ok i have added. Then says that i have to execute this command
appcfg.py update
but i don't have any appcfg.py file. And also what is the command which executes this line?
Please somebody tell me what i am missing I use AppEngineLauncher to upload my project to server.. I have naver used a command to update or upload it.
Thanks in advance..
If you're using App Engine Launcher, simply click the Deploy button; it runs appcfg.py update. appcfg is installed as part of the SDK.
In order to call it globally you must set the python path to include google appengine library, or call it from its excact location
~/google_appengine/appcfg.py update ~/project/path_to_your_yaml_file/
where ~ stands for you home folder.
For those using the the Java GAE SDK, it comes wtih appcfg.sh, but doesn't support full features of apppcfg.py. You need to also install the Python GAELauncher. On Mac, it installs appcfg.py in /usr/local/bin.
Working only with my local datastore, I did not have an app.yaml, nor did I need to update it as per the uploading data GAE documentation. Just needed to update the web.xml with the RemoteApiServlet.
Main gotcha is the Authentication error while connecting to the local data store. It may be specific to Mac and the Charles proxy work around mentioned in that thread likewise worked for me. I did have to modify the default proxy port from 8888 to avoid conflict with my app. The workaround is tedious and the trial version of Charles comes with limitations such as shutdown after 30 minutes.
To use the main database for development, first download it from app engine:
bulkloader.py --dump --url http://<app name>.appspot.com/_ah/remote_api --filename dump.bin
It will ask for an email and password (use your google login details).
To upload it to the development environment, make sure remote_api is
enabled in app.yaml
https://developers.google.com/appengine/docs/python/tools/uploadingdata#Setting_Up_remote_api
Then run:
bulkloader.py --restore --url http://localhost:8080/_ah/remote_api --filename dump.bin --application dev~<app name>
This time for the email, just leave it blank and hit enter.

Where is my local App Engine datastore?

How can I find where my local development datastore is located? I am using the Python SDK and Linux.
I think it depends on if you got Java or Python SDK.
For Python, here's what the instructions say from Google:
"The web server prints the location of the datastore file it is using to the terminal when it starts up. You can make a copy of the file, then restore them later to reset the datastore to a known state. Be sure to restart the web server after replacing the datastore file.
To change the location used for the datastore file, use the --datastore_path option:
dev_appserver.py --datastore_path=/tmp/myapp_datastore myapp
more info here: http://code.google.com/appengine/docs/python/tools/devserver.html
I'm using Windows 7 with the Python SDK. My local datastore is located at
C:\Users\[username]\AppData\Local\Temp\dev_appserver.datastore
To find the file location for the local AppEngine datastore on MacOSX/Python, you can run the following command:
dev_appserver.py -help
Mine was at something like:
/var/folders/uP/uP1GHkGKGqO7QPq+eGMmb++++TI/-Tmp-/dev_appserver.datastore
I think a lot of the answers on this page are out of date. Under the current Python dev kit (1.8.6) on Windows 7 I eventually found the datastore at:
c:\Users\[username]\AppData\Local\Temp\appengine.[appname]\datastore.db
I couldn't find this info in anything dev_appserver.py printed out, either with normal startup options or with --help. On other OSes you might try searching for a file called datastore.db.
For Python u can make access to datastore admin interface path:' /_ah/'
or
add the app handler to app.yaml
- url: /admin/.*
script: $PYTHON_LIB/google/appengine/ext/admin
login: admin
and access it at /admin/
I use OS X Mavericks (10.9), Python 2.7.5, and Google App Engine SDK 1.9.3 (Python).
None of the above worked for me, however, referencing #alsmola's answer, I executed sudo find / | grep datastore.db and found the file in /private/var/folders/vw/7w1zhkls4gb1wd8r160c36300000gn/T/appengine.YYYY.XXXXX/datastore.db (YYYY is the project name, XXXXX is my username).
Since it's top question on Google search and I spent quite amount of time searching for an answer I'll say that on Windows/Java mix DB file called local_db.bin.
With Maven the files are sitting here:
target/{buildName}/WEB-INF/appengine-generated/
I'll restate a solution to getting permanent datastore as it worked for me (circa Feb 2017), running GoogleAppEngineLauncher on OS X v10.10.
Create the folder path for permanent datastore
In GAEL, click on the project in question e.g. PROJECTNAME
Click Edit-Application Settings
in Extra Flags field:
--datastore_path=/Users/foo/GAE_datastore/PROJECTNAME/datastore.db
Filename has to be included; in my config, datastore.db works.
Having searched all over for GAE datastore path, and head-bonked on dev_appserver.py --datastore_path command line, it was very helpful to find this.
Application Settings under the Edit menu is an odd choice, Google :-)
The default location of the datastore for the platform you're running the app engine on is provided in the README that comes with the platform (at least, in the one for Linux). The README is in google_appengine_x.x.xx/google_appengine/README. This is what is says in the Linux'es one:
--datastore_path=DS_FILE Path to file to use for storing Datastore file
stub data.
(Default /tmp/dev_appserver.datastore)

Categories