This repository was archived by the owner on Oct 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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,
pipinstalled. - If you use OSX having
brewinstalled might be useful as well.
- Install Vagrant
- Download Vagrant
- Install Vagrant with installer
- Install Ansible
pip install ansible - Clone into the project:
git clone https://github.com/timbueno/longboxed.git
- Change into the project's working directory
cd longboxed
- You are currently on the
masterbranch. Switch todevelopbranch.git fetch origingit checkout -b develop origin/develop
- Open the project in your favorite text editor
- Mine happens to be Sublime Text
- Create a new file based off of:
devops/vars/initial_provision_vars.yml.template - Save the new file without the
.templateextension- 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.
- Start the Vagrant development environment
- Start:
vagrant up - The provisioner (ansible) will install all dependencies necessary.
- Start:
- SSH into the Vagrant environment
vagrant ssh
- Create a python virtualenv for our project
mkvirtualenv longboxed- The next time you come to work on the project type:
workon longboxed
- 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
/vagrantdirectory as well. - This allows you to edit files on your local machine and test them in a linux environment seamlessly!
- Install longboxed python requirements into virtual environment.
pip install -r requirements.txt
- Instantiate the Postgres database
alembic upgrade head
- Setup Roles for users
python manage.py create_roles
- Finally, run the longboxed application
python wsgi.py
- Go to your browser and navigate to the website.
localhost:3000
- 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