-
Notifications
You must be signed in to change notification settings - Fork 6
Setting Up Development Environment
This page shows you how to set up your local and cloud development environment.
In order to set up a local development environment, you need the following:
After pulling the source code for the application, create a file under the authentication folder called secretparams.py with the following content:
COOKIE_KEY = "<secretstring>"Replace with the string located in Rice Apps resources for Rice Elections. If you do not intend to deploy the application to the cloud, simply generate a random string in Python
import os
os.urandom(64).encode('hex')In order to run the application, simply use the Google App Engine Python Development Server. If you have the App Engine launcher (Windows & Mac), you can simply run your application from there.
Modify the setup.py script in the source code to create an organization and make yourself an admin of it. You can run the setup script through the remote_api shell.
> cd src
> remote_api_shell.py -s localhost:8080
> Email: abc@gmail.com
> Password: abc123
dev~olwection> from scripts import setup
dev~owlection> setup.main()
Creating organizations...
Done.
Creating admins...
Done. The remote api shell in Google App Engine lets you access the cloud environment through an interactive console for both your development version and the deployed cloud version of your application. In order to use the remote_api simply invoke the following command from the src folder of your application.
remote_api_shell.py -s <hostname>
Make sure to replace with your local server address. E.g. localhost:8080
Any well formed email and password combination will allow you to access the api shell. E.g.
Email: abc@gmail.com
Password: abc123
remote_api_shell.py -s owlection.appspot.com
Note, you must have a developer account registered on the cloud application to access the api shell.
Warning: Any code you execute in the api_shell will reflect live on the deployed application. Changes made to the database will be real. BE CAREFUL!
In order to deploy the application to the cloud, you must be a registered developer for owlection.
- Thoroughly test your changes after developing.
- Under app.yaml, change the application version.
- Use appcfg.py or App Engine launcher to upload the application.
- Go to the administration dashboard under appengine.google.com and change the active version of the application to your new version.
- If you need to quickly revert your changes, simply make the older version active again. Note: You can also split traffic between various versions of the application.