Skip to content

Setting Up MicSense Website

Albert Huang edited this page Dec 9, 2016 · 3 revisions
  1. Create a PythonAnywhere account, if you don't have one yet!

  2. Once you are logged in, create a web app.

    a. Select No Template, and then select Python 3.5.

    b. Click Finish to create your web app!

  3. Now open a Bash console.

  4. Create a SSH key for your PythonAnywhere environment!

    a. Follow these AMAZING instructions! Instead of setting a passphrase, just press ENTER to leave it blank. Finally, skip the ssh-agent step - you don't need it!

    b. Run this command and copy the output: cat ~/.ssh/id_rsa.pub

    c. Go here to add your SSH key. Paste the output you got into the giant box, give your key a good name (hint: "PythonAnywhere key"), tick the Write Access checkbox, and then click add.

  5. Download the Git repo! Make sure you are in your home directory by running cd, then run this command: git clone git@github.com:TerpDAC/MicrophoneControllerCode.git

  6. Now, go to your PythonAnywhere Database manager, and add a password to your MySQL database.

  7. Once everything is set up, you should now see a few fields: the host name and the username. We also know our password. You can access this information by simply going to the Database tab.

  8. Now, create a new database. Note that all databases will start with USERNAME$, since that helps keep things organized for PythonAnywhere. Call this database micsense - and your resulting database will be USERNAME$micsense.

  9. Within your SensorWebsite/MicSense folder, create a new folder called instance. Then, within that folder, add a new file called config.py. Add the following lines to it:

    # This should NEVER be uploaded to version control
    # FULL_DATABASE_NAME - this should include your username, e.g. USERNAME$db_name
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://USERNAME:PASSWORD@HOSTNAME/FULL_DATABASE_NAME"
  10. Set your source code directory to ....

  11. Set your Virtualenv directory to....

Clone this wiki locally