summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/blog/models.py1
-rw-r--r--app/builder/base.py16
-rw-r--r--app/locations/models.py1
-rw-r--r--app/pages/models.py1
-rw-r--r--app/photos/models.py1
-rw-r--r--app/projects/models/base.py9
-rw-r--r--app/projects/models/natparks.py5
-rw-r--r--config/base_urls.py6
-rwxr-xr-xconfig/djadmin.sh2
-rw-r--r--config/gunicorn_config.py2
-rw-r--r--config/settings.py (renamed from config/settings/settings.py)24
-rw-r--r--config/settings/__init__.py0
-rw-r--r--config/settings/settings_dev.py166
-rw-r--r--config/wsgi.py2
-rw-r--r--design/templates/archives/projects.html2
-rw-r--r--design/templates/base.html10
-rw-r--r--design/templates/details/national-parks.html2
-rw-r--r--design/templates/feed.xml2
18 files changed, 54 insertions, 198 deletions
diff --git a/app/blog/models.py b/app/blog/models.py
index e7f10ab..f01eeae 100644
--- a/app/blog/models.py
+++ b/app/blog/models.py
@@ -142,6 +142,7 @@ class EntryAside(models.Model):
class BlogSitemap(Sitemap):
changefreq = "never"
priority = 1.0
+ protocol = "https"
def items(self):
return Entry.objects.filter(status=1)
diff --git a/app/builder/base.py b/app/builder/base.py
index 09e0a95..4265b8d 100644
--- a/app/builder/base.py
+++ b/app/builder/base.py
@@ -22,12 +22,12 @@ class Build():
file.write(text_object)
file.close()
if ext == 'js':
- import jsmin
- compressed = jsmin.jsmin(str(text_object))
+ from jsmin import jsmin
fpath = '%s%s.min.%s' % (path, filename, ext)
- file = open(fpath, 'wt')
- file.write(str(compressed))
- file.close()
+ compressed = jsmin(text_object.decode(encoding='UTF-8'))
+ with open(fpath, 'wt') as js_file:
+ minified = js_file.write(compressed)
+ js_file.close()
def build_archive_pages(self, qs=None, base_path='', paginate_by=10):
"""
@@ -43,7 +43,7 @@ class Build():
path = '%s%s/' % (base_path, page + 1)
url = '/%s%s/' % (base_path, str(page + 1))
page_url = base_path + '%d/'
- response = c.post(url, {'page_url': page_url, 'page': int(page), 'builder': True})
+ response = c.post(url, {'page_url': page_url, 'page': int(page), 'builder': True}, HTTP_HOST='127.0.0.1')
if page == 0:
self.write_file(base_path, response.content)
self.write_file(path, response.content)
@@ -236,7 +236,7 @@ class BuildProjects(Build):
class BuildSitemap(Build):
def build(self):
c = Client()
- response = c.get('/sitemap.xml')
+ response = c.get('/sitemap.xml', HTTP_HOST='127.0.0.1')
self.write_file('', response.content, 'xml', 'sitemap')
@@ -297,7 +297,7 @@ class BuildPages(Build):
class BuildContact(Build):
def build(self):
c = Client()
- response = c.get('/contact/')
+ response = c.get('/contact/', HTTP_HOST = '127.0.0.1')
path = '%scontact/' % (settings.BAKED_ROOT)
if not os.path.isdir(path):
os.makedirs(path)
diff --git a/app/locations/models.py b/app/locations/models.py
index 0148327..5c27702 100644
--- a/app/locations/models.py
+++ b/app/locations/models.py
@@ -150,6 +150,7 @@ class Route(models.Model):
class WritingbyCountrySitemap(Sitemap):
changefreq = "weekly"
priority = 0.6
+ protocol = "https"
def location(self, item):
return '/writing/%s' % item.slug
diff --git a/app/pages/models.py b/app/pages/models.py
index 2462b06..0256508 100644
--- a/app/pages/models.py
+++ b/app/pages/models.py
@@ -29,6 +29,7 @@ class Page(models.Model):
class PageSitemap(Sitemap):
changefreq = "never"
priority = 1.0
+ protocol = "https"
def items(self):
return Page.objects.all()
diff --git a/app/photos/models.py b/app/photos/models.py
index 9916085..dce655e 100644
--- a/app/photos/models.py
+++ b/app/photos/models.py
@@ -201,6 +201,7 @@ class PhotoGallery(models.Model):
class PhotoGallerySitemap(Sitemap):
changefreq = "never"
priority = 0.7
+ protocol = "https"
def items(self):
return PhotoGallery.objects.all()
diff --git a/app/projects/models/base.py b/app/projects/models/base.py
index 51379a0..f0cd6d0 100644
--- a/app/projects/models/base.py
+++ b/app/projects/models/base.py
@@ -1,6 +1,7 @@
import datetime
from django.contrib.gis.db import models
from django.contrib.sitemaps import Sitemap
+from django.conf import settings
import markdown
@@ -37,12 +38,17 @@ class Project(models.Model):
'''Get the site's latitude.'''
return self.point.y
+ @property
+ def get_project_image(self):
+ return "%s%s" % (settings.IMAGES_URL, self.image.name[7:])
+
+
class Meta:
ordering = ('-pub_date',)
get_latest_by = 'pub_date'
app_label = 'projects'
- def __unicode__(self):
+ def __str__(self):
return self.title
def get_absolute_url(self):
@@ -58,6 +64,7 @@ class Project(models.Model):
class ProjectSitemap(Sitemap):
changefreq = "monthly"
priority = 0.5
+ protocol = "https"
def items(self):
return Project.objects.filter(status=1)
diff --git a/app/projects/models/natparks.py b/app/projects/models/natparks.py
index 3615737..2eee677 100644
--- a/app/projects/models/natparks.py
+++ b/app/projects/models/natparks.py
@@ -1,6 +1,7 @@
import datetime
from PIL import Image
from django.contrib.gis.db import models
+from django.conf import settings
from blog.models import Entry
from photos.models import PhotoGallery
from locations.models import State
@@ -44,6 +45,10 @@ class NationalParks(models.Model):
def __str__(self):
return self.unit_name
+ @property
+ def get_image_url(self):
+ return "%s%s" % (settings.IMAGES_URL, self.image.name[7:])
+
def save(self):
#get image dimensions
img = Image.open(self.image)
diff --git a/config/base_urls.py b/config/base_urls.py
index 53dc64c..9cd4c5f 100644
--- a/config/base_urls.py
+++ b/config/base_urls.py
@@ -70,6 +70,6 @@ urlpatterns += patterns('',
{'document_root': settings.STATIC_ROOT, }
),
)
-urlpatterns += patterns('',
- url(r'^blog/comments/', include('fluent_comments.urls')),
-)
+#urlpatterns += patterns('',
+# #url(r'^blog/comments/', include('fluent_comments.urls')),
+#)
diff --git a/config/djadmin.sh b/config/djadmin.sh
index a6ae84c..b7dce6b 100755
--- a/config/djadmin.sh
+++ b/config/djadmin.sh
@@ -5,6 +5,6 @@ PYTHONPATH=$PYTHONPATH:"${DIR}/app"
PYTHONPATH=$PYTHONPATH:"${DIR}/app/lib"
PYTHONPATH=$PYTHONPATH:"${DIR}/venv/lib/python3.4/"
export PYTHONPATH
-export DJANGO_SETTINGS_MODULE=config.settings.settings
+export DJANGO_SETTINGS_MODULE=config.settings
ADMIN="${DIR}/venv/bin/django-admin.py"
$ADMIN $@
diff --git a/config/gunicorn_config.py b/config/gunicorn_config.py
index a3b4414..7fabc47 100644
--- a/config/gunicorn_config.py
+++ b/config/gunicorn_config.py
@@ -4,6 +4,6 @@ command = join(PROJ_ROOT, "/venv/bin/gunicorn")
pythonpath = PROJ_ROOT
bind = '127.0.0.1:8001'
workers = 2
-log_level = "warning"
+log_level = "info"
error_logfile = "/home/lxf/logs/live.gunicorn.error.log"
diff --git a/config/settings/settings.py b/config/settings.py
index 1032b52..c091906 100644
--- a/config/settings/settings.py
+++ b/config/settings.py
@@ -1,9 +1,9 @@
import os
from os.path import dirname, abspath
-PROJ_ROOT = abspath(dirname(dirname(dirname(__file__)))) + '/'
+PROJ_ROOT = abspath(dirname(dirname(__file__))) + '/'
-DEBUG = False
+DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
@@ -38,8 +38,14 @@ EMAIL_HOST_PASSWORD = '^C9XZz55UJ@j2@5XNU'
EMAIL_PORT = 587
ALLOWED_HOSTS = (
+ '127.0.0.1',
+ '127.0.0.1.',
+ 'localhost',
+ 'localhost.',
'live.luxagraf.net',
- 'demo.luxagraf.net',
+ 'live.luxagraf.net.',
+ 'test.luxagraf.net',
+ 'test.luxagraf.net.',
)
# API key for Flickr imports
FLICKR_API_KEY = '7b9d978a440c6ab65a545adc0aa0d693'
@@ -53,12 +59,12 @@ BASE_URL = "http://luxagraf.net/"
#path to the folder that holds the generated html files
FLATFILES_ROOT = os.path.join(PROJ_ROOT, 'site/')
#media and image URLs for the generated html files
-BAKED_IMAGES_URL = 'http://images.luxagraf.net/'
+BAKED_IMAGES_URL = 'https://images.luxagraf.net/'
BAKED_MEDIA_URL = 'http://luxagraf.net/media/'
#BAKED_MEDIA_URL = 'http://127.0.0.1:8000/media/'
#path to http://images.luxagraf.net root
IMAGES_ROOT = os.path.join(PROJ_ROOT, 'site/media/images')
-IMAGES_URL = 'http://images.luxagraf.net/'
+IMAGES_URL = 'https://images.luxagraf.net/'
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
@@ -159,9 +165,9 @@ INSTALLED_APPS = (
'birds',
'books',
'stuff',
- 'fluent_comments',
- 'crispy_forms',
- 'django.contrib.comments',
+ #'fluent_comments',
+ #'crispy_forms',
+ #'django.contrib.comments',
)
-COMMENTS_APP = 'fluent_comments'
+#COMMENTS_APP = 'fluent_comments'
diff --git a/config/settings/__init__.py b/config/settings/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/config/settings/__init__.py
+++ /dev/null
diff --git a/config/settings/settings_dev.py b/config/settings/settings_dev.py
deleted file mode 100644
index a9d5ec8..0000000
--- a/config/settings/settings_dev.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Django settings for luxagraf.
-import os
-from os.path import dirname, abspath
-
-PROJ_ROOT = abspath(dirname(dirname(dirname(__file__))))+'/'
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
- # ('Your Name', 'your_email@example.com'),
-)
-
-MANAGERS = ADMINS
-
-DATABASES = {
- 'default': {
- 'NAME': 'luxagraf',
- 'ENGINE': 'django.contrib.gis.db.backends.postgis',
- 'USER': 'luxagraf',
- 'PASSWORD': 'translinguis',
- 'HOST': 'localhost',
- }
-}
-
-TIME_ZONE = 'America/New_York'
-LANGUAGE_CODE = 'en-us'
-SITE_ID = 1
-SITE_URL = 'http://luxagraf.net/'
-GRAPPELLI_ADMIN_TITLE = 'Luxagraf Admin'
-USE_I18N = False
-USE_L10N = True
-USE_TZ = False
-
-
-# Host for sending e-mail.
-EMAIL_USE_TLS = True
-EMAIL_HOST = 'smtp.gmail.com'
-EMAIL_HOST_USER = 'sendluxagraf@gmail.com'
-EMAIL_HOST_PASSWORD = '^C9XZz55UJ@j2@5XNU'
-EMAIL_PORT = 587
-
-EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
-
-
-
-#API key for Google Maps in Admin
-MAP_API = "google"
-GOOGLE_MAPS_API_KEY = MAP_API_KEY = 'ABQIAAAAEZ0Oz7LFDmdS1OBHm6HLgRQT5Lr-mnFT_29u-YVgAYs_K_u6-BQ627CkPKq44oaHpmSt2497hDj_LQ'
-
-# API key for Flickr imports
-FLICKR_API_KEY = '7b9d978a440c6ab65a545adc0aa0d693'
-FLICKR_USER_ID = '85322932@N00'
-
-BASE_URL = "http://127.0.0.1:8000/"
-#path to the folder that holds the generated html files
-FLATFILES_ROOT = os.path.join(PROJ_ROOT, 'site/')
-#media and image URLs for the generated html files
-BAKED_IMAGES_URL = 'http://images.luxagraf.net/'
-BAKED_MEDIA_URL = 'http://luxagraf.net/media/'
-#BAKED_MEDIA_URL = 'http://127.0.0.1:8000/media/'
-#path to http://images.luxagraf.net root
-IMAGES_ROOT = os.path.join(PROJ_ROOT, 'site/media/images')
-IMAGES_URL = 'http://images.luxagraf.net/'
-
-# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = os.path.join(PROJ_ROOT, 'site/media')
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash.
-# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
-MEDIA_URL = 'http://127.0.0.1:8000/media/'
-
-# Absolute path to the directory static files should be collected to.
-# Don't put anything in this directory yourself; store your static files
-# in apps' "static/" subdirectories and in STATICFILES_DIRS.
-# Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = os.path.join(PROJ_ROOT, 'static/')
-
-# URL prefix for static files.
-# Example: "http://media.lawrence.com/static/"
-STATIC_URL = '/static/'
-
-# Additional locations of static files
-STATICFILES_DIRS = (
- # Put strings here, like "/home/html/static" or "C:/www/django/static".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
-)
-
-# List of finder classes that know how to find static files in
-# various locations.
-STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = '^gaz8-&iy8z@(nwp#xe1age(t141w-47fh=cv8a7w2=x2=a-&7'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
-# 'django.template.loaders.eggs.Loader',
-)
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- # Uncomment the next line for simple clickjacking protection:
- # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
-)
-
-TEMPLATE_CONTEXT_PROCESSORS = (
- "django.core.context_processors.request",
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.static",
- "django.core.context_processors.tz",
- "django.contrib.messages.context_processors.messages"
-)
-
-ROOT_URLCONF = 'config.base_urls'
-
-TEMPLATE_DIRS = (
- os.path.join(PROJ_ROOT, 'design/templates')
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
-)
-
-
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.staticfiles',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.admin',
- 'django.contrib.sitemaps',
- 'django.contrib.gis',
- 'locations',
- 'blog',
- 'photos',
- 'taggit',
- 'links',
- 'pagination',
- 'templatetags',
- 'projects',
- 'guide',
- 'pages',
- 'birds'
-)
-DEVELOPMENT = True
-if DEVELOPMENT:
- INSTALLED_APPS += ('django_extensions',)
- MEDIA_URL = 'http://127.0.0.1:8000/media/'
-
diff --git a/config/wsgi.py b/config/wsgi.py
index 3decdc7..793cfca 100644
--- a/config/wsgi.py
+++ b/config/wsgi.py
@@ -8,7 +8,7 @@ SERVER_ROOT = abspath(dirname(dirname(__file__)))+'/'
# Tell wsgi to add the Python site-packages to it's path.
site.addsitedir(SERVER_ROOT+'venv/lib/python3.4/site-packages')
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
sys.path = [SERVER_ROOT,] + sys.path
sys.path.insert(0, os.path.join(SERVER_ROOT, "app"))
diff --git a/design/templates/archives/projects.html b/design/templates/archives/projects.html
index dbfe167..29aa160 100644
--- a/design/templates/archives/projects.html
+++ b/design/templates/archives/projects.html
@@ -18,7 +18,7 @@
<article>
<h1><a href="{{object.get_absolute_url}}" title="{{object.title}}">{{object.title|safe}} {{object.subtitle|safe}}</a></h1>
<div class="img">
- <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.image.url}}" alt="{{ object.title }}" class="post-image" /></a>
+ <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_project_image}}" alt="{{ object.title }}" class="post-image" /></a>
</div>
<div class="hyphenate">{{object.lede|safe|smartypants}}</div>
<!--<span class="button"><a href="{{project.get_absolute_url}}">More&nbsp;&raquo;</a></span>-->
diff --git a/design/templates/base.html b/design/templates/base.html
index a7c757b..4e4e82b 100644
--- a/design/templates/base.html
+++ b/design/templates/base.html
@@ -8,12 +8,12 @@
<meta name="author" content="Scott Gilbertson">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--[if IE]>
- <script src="{{MEDIA_URL}}js/html5css3ie.min.js"></script>
+ <script src="/js/html5css3ie.min.js"></script>
<![endif]-->
<link rel="alternate"
type="application/rss+xml"
title="Luxagraf RSS feed"
- href="http://luxagraf.net/rss/">
+ href="https://luxagraf.net/rss/">
{%block stylesheet%}<link rel="stylesheet"
href="/media/css/stylesv6.css"
media="screen">{%endblock%}
@@ -46,9 +46,9 @@
<footer role="contentinfo">
<nav class="bl">
<ul>
- <li><a href="http://luxagraf.net/rss/" title="RSS feed">Subscribe</a></li>
- <li><a href="http://twitter.com/luxagraf" rel="me" title="follow luxagraf on Twitter">@luxagraf</a></li>
- <li><a href="http://www.flickr.com/photos/luxagraf" rel="me" title="luxagraf on Flickr">Flickr</a></li>
+ <li><a href="/rss/" title="RSS feed">Subscribe</a></li>
+ <li><a href="https://twitter.com/luxagraf" rel="me" title="follow luxagraf on Twitter">@luxagraf</a></li>
+ <li><a href="https://www.flickr.com/photos/luxagraf" rel="me" title="luxagraf on Flickr">Flickr</a></li>
<li><a href="/contact/" title="contact luxagraf">Contact</a></li>
</ul>
</nav>
diff --git a/design/templates/details/national-parks.html b/design/templates/details/national-parks.html
index 13b9486..e05bd12 100644
--- a/design/templates/details/national-parks.html
+++ b/design/templates/details/national-parks.html
@@ -23,7 +23,7 @@
<article id="park-{{forloop.counter}}" class="park">
<h1>{{object.name}}</h1>
<div class="figure">
- <img src="{{object.image.url}}" alt="{{object.name}}" width="{{object.image_width}}" height="{{object.image_height}}" />
+ <img src="{{object.get_image_url}}" alt="{{object.name}}" width="{{object.image_width}}" height="{{object.image_height}}" />
</div>
<div class="legend">
<h2>{{object.tag_line}}</h2>
diff --git a/design/templates/feed.xml b/design/templates/feed.xml
index d70604c..d170cd3 100644
--- a/design/templates/feed.xml
+++ b/design/templates/feed.xml
@@ -3,7 +3,7 @@
<rss version="2.0">
<channel>
<title>Luxagraf</title>
- <link>http://luxagraf.net/</link>
+ <link>https://luxagraf.net/</link>
<description>Latest posts on luxagraf.net</description>
<language>en-us</language>
<copyright>Copyright 2011-{% now "Y" %} Luxagraf</copyright>