This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Django settings for dnsly project. | |
from unipath import FSPath as Path | |
import os | |
def env(key, default=None): | |
"""Retrieves env vars and makes Python boolean replacements""" | |
val = os.getenv(key, default) | |
if val == 'True': | |
val = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mod_deflate configuration | |
<IfModule mod_deflate.c> | |
# Restrict compression to these MIME types | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xml+rss | |
AddOutputFilterByType DEFLATE application/x-javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container_commands: | |
01_collectstatic: | |
command: "django-admin.py collectstatic --noinput" | |
02_lesscss: | |
command: "lesscpy -x static/css/base.less > static/css/base.css" | |
03_setup_apache: | |
command: "cp enable_mod_pagespeed.conf /etc/httpd/conf.d" | |
04_rm_pagespeed: | |
command: "rm -rf /pagespeed/ebextensions" | |
05_mkdir_pagespeed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the three JSON documents that I used to create the indexes. | |
{ | |
"index": { | |
"fields": ["price","name"] | |
}, | |
"name" : "price-name-index", | |
"type" : "json" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from storages.backends.s3boto import S3BotoStorage | |
class StaticStorage(S3BotoStorage): | |
location = settings.STATICFILES_LOCATION | |
class MediaStorage(S3BotoStorage): | |
location = settings.MEDIAFILES_LOCATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import by filename is not supported.: ImportError | |
Traceback (most recent call last): | |
File "/var/task/handler.py", line 302, in lambda_handler | |
return LambdaHandler.lambda_handler(event, context) | |
File "/var/task/handler.py", line 110, in lambda_handler | |
return cls().handler(event, context) | |
File "/var/task/handler.py", line 159, in handler | |
app_function = get_django_wsgi(self.settings.DJANGO_SETTINGS) | |
File "/var/task/django_zappa_app.py", line 17, in get_django_wsgi | |
django.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASE_ENGINE=django.db.backends.sqlite3 | |
DATABASE_NAME=db.sqlite3 | |
DATABASE_USER= | |
DATABASE_PASSWORD= | |
DATABASE_HOST= | |
DATABASE_PORT= | |
SECRET_KEY="asdfdfadsflkjsdflkjadsflkasfakl;" | |
STATIC_URL=/static/ | |
DEBUG=True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.utils.encoding import filepath_to_uri | |
from storages.backends.s3boto import S3BotoStorage | |
class StaticStorage(S3BotoStorage): | |
location = settings.STATICFILES_LOCATION | |
def url(self, name, headers=None, response_headers=None, expire=None): | |
return '{}{}'.format(settings.STATIC_URL,filepath_to_uri(name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"ec2:DescribeSecurityGroups", | |
"ec2:DescribeSubnets", | |
"ec2:Describe*" | |
], | |
"Resource": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dev": { | |
"aws_region": "us-east-1", | |
"s3_bucket": "yourcode-bucket", | |
"django_settings": "yourapp.settings", | |
"remote_env_file":"yourblog-dev.json", | |
"remote_env_bucket":"yourcode-bucket", | |
"use_precompiled_packages": true, | |
"domain": "yourblog-dev-apigw.yourdevdomain.com", | |
"lets_encrypt_key": "s3://yourcode-bucket/openssl.key", |
OlderNewer