Skip to content

Development Environment

aaronoppenheimer edited this page Aug 26, 2023 · 13 revisions

Note: These instructions may written from a MacOS perspective. Adjustments may be necessary for other operating systems.

1. Check out the application code

Check out this Gig-O-Matic repository. If you are not familiar with Git, check out the Github getting started instructions

For example: git clone https://github.com/SecondLiners/GO2.git

2. Install Python 2.7.

The maintainers recommend the Anaconda distribution. We will be using its package manager to avoid mixing package versions with other projects. After installation, you can verify that you are running the correct Python version by running which python.

Also install a couple of libraries using pip: Babel and pycrypto

3. Install Google App Engine SDK for Python

https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python

4. Create your local development instance

Boot the Google App Engine development instance:

dev_appserver.py app.yaml

By default, the application will be running on http://localhost:8080. Additionally, the Google App Engine admin interface will be running on http://localhost:8000.

5. Compile translation files

Gig-o-matic uses Babel to handle i18n translation. You need to explicitly compile those messages at the start, and again whenever you change/add to the message set. Compiling i18n is done like this:

pybabel compile -f -d ./locale

(use pip install Babel)

6. Browse the development site

Go to http://localhost:8080/ (or wherever) and you should see the login screen. Create a user account for your main user (lets call that user Jane).

7. Activate user and grant admin

Once you've created an account for Jane, we need to both set her as verified and as a superuser, so she can create bands:

  • Go to the admin tools at http://localhost:8000/ and click "Datastore Viewer"
  • Select Entity Kind "Member"
  • Click "List Entities"
  • Click the key for Jane
  • Set is_superuser to true and then verified to true
  • Click "Save Changes"

8. Set a crypto key

This key is used to protect the auth tokens generated for links sent via email. The key is stored inside of Google AppEngine. To set a key, do the following:

  • Go to the admin tools at http://localhost:8000/ and click "Interactive Console"
  • Paste the following block into the text box:
    from crypto_db import set_cryptokey
    set_cryptokey("A" * 16)
  • Click Execute

Note that if you want to change the crypto key, it must be of a fixed length: either 16, 24, or 32 bytes long.

9. Log in as Jane

You should see an "Admin" selection in the top menu. Go to "Band Admin" and "Add a Band", edit the appropriate fields, and then hit Save. (???:whats clid--just some id? can it have spaces etc? ???) Then go to Jane's profile and have her add herself to the new band, then go to the band's page using the link in the profile and accept the membership.

Congratulations! Gig-o-matic is now set up and ready for use!

Some of the tools used:

For installing 2.7 on M1 mac see here: https://stackoverflow.com/questions/67380286/anaconda-channel-for-installing-python-2-7