We are going to use Postgres for our backend. If you don't have it installed.... then figure it out :)
We are going to need 3 different users to keep permissions segmented in the database. Development and Test are to only be used on local machines, any production machine needs to have passwords for database stored in a different place, not in this directory.
While developing we will only need 2 users, the test and development. Don't bother creating the production one until we need it.
nextnest_development
createuser -U postgres -h localhost -E -p 5432 -d -w nexnest_development
sudo -u postgres psql -U postgres -c "alter user nexnest_development with password 'domislove';"
nextnest_test
createuser -U postgres -h localhost -E -p 5432 -d -w nexnest_test
sudo -u postgres psql -U postgres -c "alter user nexnest_test with password 'domislove';"
nextnest_development
createdb -U nexnest_development -O nexnest_development -h localhost -p 5432 nexnest_development
nextnest_test
createdb -U nexnest_test -O nexnest_test -h localhost -p 5432 nexnest_test
Vagrant allows us to develop in the same environment as well as giving Kyle the ability to influence our environment with whatever he has set up for produciton.
- First install VirtualBox!
- Then install Vagrant :)
Make sure you have CPU virtualization turned on in your BIOS. Usually it is turned off by default.
THIS IS IMPORTANT!!! You must use a bash cli with SSH capabilities. The easiest way to do this is just use GitBash
cd
into the project directory on your computer- type
vagrant up
, this will boot a virtual machine - Once that is done running ssh into the machine by typing
vagrant ssh
- cd to our mounted project directory at
/vagrant
so ...cd /vagrant
- Type
make install
to install all the python packages and initialize our database!
git remote add stage ssh://nexnest@dev.nexnest.com/home/nexnest/nexnest
These are going to be the environment variables that we are going to need to implement in the Unit file on the production server
MAIL_USERNAME
MAIL_PASSWORD
DATABASE_URL
GOOGLE_MAPS_KEY
GOOGLE_CAPTCHA_SECRET
SECURITY_PASSWORD_SALT
SECRET_KEY
FLASK_CONFIG
SLACK_WARNING_URL
SLACK_ERROR_URL
BRAINTREE_MERCHANT_ID
BRAINTREE_PUBLIC_KEY
BRAINTREE_PRIVATE_KEY