Web Map for exploring the history of Texas lakes
cd ./lakegallery as all commands are run from the ~/lake-gallery/lakegallery/ directory
Built with:
- Python 3.5 (virtual environment suggested)
- PostgreSQL 9.5.2
- Amazon RDS Instance
- GDAL & GDAL Python & GDAL Devel
- Django
- For data scripts, you probably want to use some form of python virtual env manager to maintain an isolated environment. A good run-down of the options can be found in The Hitchiker's Guide to Python. A recommended setup is virtualenv + virtualenvwrapper. Anaconda is an alternative but it has not been successfully tested.
- Enable your virtual environment. Example-
workon lakegallery(for virtualenv wrapper) - Upgrade pip using
pip install --upgrade pip - install python requirements
pip install -r requirements.txt - cd into the secrets folder of the repo
cd ./lakegallery/lakegallery/secrets/ - place a copy
vault-password.txtinto the secrets folder of the repo (You might need to change spaces to newlines) and runmake pull-secrets
or
- make a copy of the set_env-SAMPLE.sh, remove the '-SAMPLE' from the name, and manually fill in the values. Then run
. set_env.shfrom said secrets folder
You will need to use your configured AWS CLI when working locally. If not already set up, you will need to install the AWS CLI and configure it with an access key and secret key.
- Run the app:
run make run-dev to run the app locally and reference local static files. Will be available at localhost:8000. Media files will still be referenced from the production S3 bucket.
or
run make run-dev-local to run the app locally and reference local static files if API (api.tnris.org) is already running locally. Will be available at localhost:8030. Media files will still be referenced from the production S3 bucket. This command is for testing contact forms since they use the API.
- run
make run-teststo run the unit tests for the map application
In production, the app pulls/references all static files for all apps from the configured S3 bucket. Run Deployment Prep section's Step 1 to upload/push local static files into S3. VERY DANGEROUS if app is currently deployed as you will be overwriting the production static files!
- run
make run-prodto run the app locally and reference prod s3 static files. Will be available atlocalhost:8000.
- run
make push-staticto compile all static files and overwrite those in S3. VERY DANGEROUS if app is currently deployed as you will be overwriting the production static files! pip freeze > requirements.txtto save dependencies- head over to the deployments repo to execute the actual application deployment