Skip to content

Commit

Permalink
Viz deploy (#48)
Browse files Browse the repository at this point in the history
* Update CIO4Good project and tabs

* Updates to all pages for demo

* Deploy state from last Fri

* Adjust styling, remove images

* Prevent stretched mobile view Benchmarking viz

* Delete old comments

* Set up S3 storage

* Revert Django version, attempt to fix deploy

* Revert Django 2.1.1, attempt 2 to fix deploy
  • Loading branch information
mbjacobs committed Jul 3, 2020
1 parent dfae394 commit 6f52d91
Show file tree
Hide file tree
Showing 35 changed files with 406 additions and 579 deletions.
6 changes: 6 additions & 0 deletions custom_storages.py
@@ -0,0 +1,6 @@
# custom_storages.py
from django.conf import settings
from storages.backends.s3boto3 import S3Boto3Storage

class StaticStorage(S3Boto3Storage):
location = settings.STATICFILES_LOCATION
19 changes: 19 additions & 0 deletions d4g/settings.py
Expand Up @@ -41,6 +41,7 @@
'home.apps.HomeConfig',
'web.apps.WebConfig',
'django_semantic_ui',
'storages',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -133,3 +134,21 @@

# Django Sass
SASS_PROCESSOR_ROOT = os.path.join(BASE_DIR,'static')

AWS_STORAGE_BUCKET_NAME = 'd4gwebsite-bucket'
AWS_S3_REGION_NAME = 'us-east-2' # e.g. us-east-2
#AWS_ACCESS_KEY_ID = ''
#AWS_SECRET_ACCESS_KEY = ''

# Tell django-storages the domain to use to refer to static files.
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME

# Tell the staticfiles app to use S3Boto3 storage when writing the collected static files (when
# you run `collectstatic`).
# STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

AWS_DEFAULT_ACL = None


STATICFILES_LOCATION = 'static'
STATICFILES_STORAGE = 'custom_storages.StaticStorage'
Binary file modified db.sqlite3
Binary file not shown.
97 changes: 96 additions & 1 deletion home/static/css/styles.css
@@ -1,9 +1,104 @@
/* BaseUIKit Styling */

.home{
height: 100vh
}

.footer-home{
color: #FFFFFF;
background: #000000;
}

/* Semantic UI Website Styling */

.pusher{
background-image: url("https://d4gwebsite-bucket.s3.us-east-2.amazonaws.com/static/web/landing-hero.jpg");
background-repeat: no-repeat;
background-size: cover;
margin: 0 !important;
padding-bottom: 15%;
}

h1,h2,h3 {
font-family: 'Open Sans', sans-serif;
}
p,a{
font-family: 'Roboto', sans-serif;

}

.logo{
width: 50px;
height: 50px;
}

.home{
height: 100vh
}

.footer-home{
color: #FFFFFF;
background: #000000;
}
}

.pusher:hover{
opacity: 0.8;
}

.ui.container.header.hero{
padding-top: 10%;
}

.ui.text.container{
max-width: 1050px !important;
}

.ui.vertical.stripe.segment {
padding-top: 2%;
padding-bottom: 2%;
}

.ui.header {
padding-top: 2%;;
}

.ui.header.horizontal.divider {
padding-top: 2%;
}

.top.attached.segment + .ui.bottom.tabular.menu {
position: relative;
width: calc(100% + (100px * 2));
left: -1px;
}

#site-title {
font-size: 4em;
}

#impact-button-container{
padding: 2%;
}

/* Landing Page */
.tool-cards {
display: flex;
justify-content: space-evenly;
}

#visualization-card {
background-color: #e2f2c7;
padding: 1%;
margin: 4%;
}

/* Tabs */
.ui.bottom.attached.tab.segment {
padding: 10px 20px;
margin-bottom: 1%;
}

/* FAQ */
.ui.divided.items.faq {
padding: 2%;
}
7 changes: 4 additions & 3 deletions home/templates/base_uikit.html
Expand Up @@ -31,8 +31,10 @@
<!-- Add additional SCSS in static file -->
{% load static %}
{% load sass_tags %}
<!-- <link rel="stylesheet" href="{% static 'css/styles.css' %}"> -->
<link href="{% sass_src 'theme.scss' %}" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
<!-- <link rel="stylesheet" href="{% static 'web/theme.scss' %}"> -->

<!-- <link href="{% sass_src 'theme.scss' %}" rel="stylesheet" type="text/css" /> -->

</head>

Expand All @@ -52,7 +54,6 @@
</body>

<footer class="footer-home" style="padding: 1%;">
<!-- TODO: fix vertical stacking of menu items -->
<div style="display: flex; justify-content: space-evenly;">
<div><a href="/organization" class="item">Our Organization</a></div>
<div><a href="/projects" class="item">Projects</a></div>
Expand Down
10 changes: 9 additions & 1 deletion requirements.txt
@@ -1,17 +1,25 @@
boto3==1.13.9
botocore==1.16.9
certifi==2019.11.28
chardet==3.0.4
codecov==2.0.15
coverage==5.0.3
Django==2.2.12
Django==2.1.1
django-appconf==1.0.4
django-compressor==2.4
django-sass-processor==0.7.4
django-storages==1.9.1
django2-semantic-ui==1.2.2
docutils==0.15.2
idna==2.8
jmespath==0.10.0
libsass==0.19.4
python-dateutil==2.8.1
pytz==2019.3
rcssmin==1.0.6
requests==2.23.0
rjsmin==1.1.0
s3transfer==0.3.3
six==1.13.0
sqlparse==0.3.1
urllib3==1.25.7
106 changes: 0 additions & 106 deletions static/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/theme.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f52d91

Please sign in to comment.