PLEASE NOTE: This project is no longer under development
A Django project for creating and sharing interactive choropleths maps of the state of Texas.
Dependencies:
If you are just are interesting in taking this project for a test drive.
Install Docker
Install Docker Compose
Clone the repository and enter the project directory and touch secrets.json
$ git clone https://github.com/unt-libraries/texas-choropleth.git
$ cd texas-choropleth
$ touch secrets.json
Add the following to secrets.json
{
"SECRET_KEY": "your-super-secret-key-here"
}
Run
$ docker-compose build
This will pull down the MySQL and Python images and build the web image from the Dockerfile.
Run
$ docker-compose run --rm web fab build_dev
This will build the application.
Run
$ docker-compose run --rm web fab manage:createsuperuser
Run
$ docker-compose up -d
This brings up the web and database containers and starts the application.
Navigate to <dockerhost>:8000
and start using the app.
Note: Configuring the web server and database is outside scope of the following instructions.
Clone the repository
$ git clone https://github.com/unt-libraries/texas-choropleth.git
Create a virtualenv
$ virtualenv ENV
Activate the virtualenv then enter the project directory
(ENV)$ source ENV/bin/activate
(ENV)$ cd texas-choropleth
Install the project dependencies
(ENV)$ pip install -r requirements.txt
Before you build the project, you must define a secrets.json
file in side the project root.
(ENV)$ touch secrets.json
The local.py
settings only uses the SECRET_KEY
, as the database settings preconfigured to work with Docker, but the production.py
settings file also requires that the database settings are included.
Here is an example of what the secrets.json
file should look like.
{
"FILENAME": "secrets.json",
"SECRET_KEY": "some-super-secret-key",
"DB_NAME": "texas_choropleth",
"DB_USER": "your_db_user",
"DB_PASSWORD": "your_db_password",
"DB_HOST": "db",
"DB_PORT": "3306",
"EMAIL_HOST": "your.email.host",
"EMAIL_PORT": "",
"EMAIL_HOST_USER": "user",
"EMAIL_HOST_PASSWORD": "password",
"EMAIL_USE_TLS": "",
"EMAIL_USE_SSL": "",
}
Run
(ENV)$ fab build_prod
in the project root. (The same directory where fabfile.py
is)
What will this do?
Then run
(ENV)$ ./src/manage.py createsuperuser
to create a site administrator
Static files will be at <project_root>/src/static_final
Media files will be at <project_root>/src/media
See Quickstart
There is a fabric task for this. If using Docker and Docker Compose:
$ docker-compose run --rm web fab run_tests
to run all tests
To run app specific tests
$ docker-compose run --rm web fab run_tests:<app-name>