============
You'll need to do a couple things on your machine first to get it setup for development. Instructions below assume you've already cloned this repo and are inside the root folder.
-
Install pip modules into virtualenv:
pip install ansible==2.5.4
-
Update /etc/hosts: Add the following line to your /etc/hosts file:
127.0.0.1 local.myapp.com
-
Run vagrant at the root level of the repository:
vagrant up
This will start an Ubuntu instance in your virtual box and will install all necessary packages. If this is your first time running the command, it can take up to 20 minutes.
-
Get the latest copy of the production data and import to your database. After you get a copy of the production data dump, place it inside this corpsite repo.
vagrant ssh corpsite mysql -u vagrant appdynamics_django < <NAME_OF_PROD_DUMP>.sql
TODO: make this data dump step automatic after S3 bucket is moved to portal AWS account.
-
Afterwards, you'll want to apply any migrations from your branch/develop that hasn't been released to production yet.
python manage.py migrate
-
You should now be able to hit the following URL(s) in your browser:
https://local.myapp.com:8383
👍
Note: You will login as vagrant user, but everyhting on the site is running by root user.
To login as root: sudo -s
-
Go to the project folder:
base_myapp
-
Go to the static files folder:
static
-
Go to the media files folder:
media
-
See the logs:
log_myapp (To see uwsgi log, this is evrything you see when you ./manage.py runserver.) log_redis (To see redis log.)
-
Redis command:
redis-cli
-
Restart server:
restart-server
Runs sudo service supervisord restart
-
Database:
mysql -u vagrant myapp < [some.sql file]
-
Restart the server:
sudo service nginx reload (To reload Nginx.) sudo service supervisord status (To check the status of web server and redis server.) sudo service supervisord restart (To restart both web server and redis server.)