Skip to content
This repository was archived by the owner on Oct 7, 2023. It is now read-only.

Setting up a development environment

Timothy Bueno edited this page Oct 1, 2013 · 13 revisions

Before you start:

  • Make sure you have the python package manager, pip installed.
  • If you use OSX having brew installed might be useful as well.
  1. Install Vagrant
  2. Install Ansible pip install ansible
  3. Clone into the project:
    • git clone https://github.com/timbueno/longboxed.git
  4. Change into the project's working directory
    • cd longboxed
  5. You are currently on the master branch. Switch to develop branch.
    • git fetch origin
    • git checkout -b develop origin/develop
  6. Open the project in your favorite text editor
  7. Create a new file based off of: devops/vars/initial_provision_vars.yml.template
  8. Save the new file without the .template extension
    • The defaults in this file are enough for a development environment.
    • We do not keep the actual provision variables in source control to keep our production server secure.
  9. Start the Vagrant development environment
    • Start: vagrant up
    • The provisioner (ansible) will install all dependencies necessary.
  10. SSH into the Vagrant environment
    • vagrant ssh
  11. Create a python virtualenv for our project
    • mkvirtualenv longboxed
    • The next time you come to work on the project type: workon longboxed
  12. Change into the linked directory.
    • cd /vagrant
    • This directory mirrors your local machine. Any files placed in the longboxed directory on your local machine appear in the /vagrant directory as well.
    • This allows you to edit files on your local machine and test them in a linux environment seamlessly!
  13. Install longboxed python requirements into virtual environment.
    • pip install -r requirements.txt
  14. Instantiate the Postgres database
    • alembic upgrade head
  15. Setup Roles for users
    • python manage.py create_roles
  16. Finally, run the longboxed application
    • python wsgi.py
  17. Go to your browser and navigate to the website.
    • localhost:3000
  18. You should see the flask application come to life!
    • You do not currently have any comic books in the database.

Notes:

  • To stop the Vagrant environment: vagrant halt
  • To destroy (delete) the Vagrant environment: vagrant destroy

Clone this wiki locally