Settings when writing Google App Engine / Python apps in Intellij Idea

A memorandum memo for yourself.

The target version is as follows Screen_Shot_2017-06-17_at_8_53_53.png

Install python plugin

Install the Python plugin in the first place. With this, you can use some functions equivalent to Pycharm. Preferences.png

Select Project Structure

Screen_Shot_2017-06-17_at_8_49_27.png

Specify the path to the Google App Engine SDK

Specify the path to the Google App Engine SDK installed on your Local machine. Project_Structure.png

Specify Lib folder

The library installed by Pip should be put in the Lib folder directly under the project because it is a pattern in the official sample, so I think that is good.

Sample in Flask https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/flask/hello_world

Install with -t as follows.

pip install -t lib -r requirements.txt

↓ Put the following appengine_config.py file. https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/appengine/standard/flask/hello_world/appengine_config.py

from google.appengine.ext import vendor

# Add any libraries installed in the "lib" folder.
vendor.add('lib')

By the way, only Python can be installed and used with Pip. Others can be used by declaring what Google has prepared in app.yaml.


libraries:
- name: jinja2
  version: latest

Below is a list. https://cloud.google.com/appengine/docs/standard/python/tools/built-in-libraries-27

After making the preparations so far, if you select the Lib folder and specify it as Resources, the one installed in the Lib folder will be referenced properly by Intellij.

Screen_Shot_2017-06-17_at_9_05_59.png

All dependent libraries are now recognized by Intellij. main_py_-_monitoring_-____dev_monitoring_.png

Recognize Jinja2 template

If you leave it alone, the Jinja2 template will not be recognized. This is inconvenient, so open the Pythont Template Language from Preferences and configure it.

Preferences.png

.. .. I have written so far and feel that it is better to use Pycharm quietly.

Recommended Posts

Settings when writing Google App Engine / Python apps in Intellij Idea
When writing a program in Python
[Python] Run Flask on Google App Engine
[Tips] Easy-to-read writing when connecting functions in Python
Tweet (API 1.1) on Google App Engine for Python
Split files when writing vim plugin in python
Initial settings when using the foursquare API in python
A memorandum when writing experimental code ~ Logging in python
Deploy a Django application on Google App Engine (Python3)
Google App Engine / Python development environment construction procedure (late 2014)
PIL with Python on Windows 8 (for Google App Engine)
Getting Started with Google App Engine for Python & PHP
How to use Django on Google App Engine / Python
Various memorandums when using sdk of LINE Messaging API with Python (2.7.9) + Google App Engine
Runtime version of Google App Engine / Python Standard Environment
Save in Japanese to StringProperty in Google App Engine data store
Convenient writing method when appending to list continuously in Python
Python package management in IntelliJ
Attention when os.mkdir in Python
[Python ORM] Notation when writing SQL using subquery in IN clause in SQLAlchemy
[SEO] Flow / sample code when using Google Analytics API in Python
Don't forget shebang when writing Check! Ansible's Dynamic Inventory in python!
Precautions when using pit in Python
Google App Engine development with Docker
Download Google Drive files in Python
Java 1 1 support from Google App Engine
Use ndb.tasklet on Google App Engine
Reading and writing text in Python
When using regular expressions in Python
Google App Engine webapp.RequestHandler cannot get parameters when receiving put and delete
Deploy a Python app on Google App Engine and integrate it with GitHub
What Emacs users should know when writing python code in Sublime Text
Notes on resolving references to packages in Python projects in IntelliJ IDEA (PyCharm)