diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/__init__.py | 0 | ||||
-rw-r--r-- | config/base_urls.py | 68 | ||||
-rwxr-xr-x | config/djadmin.sh | 10 | ||||
-rw-r--r-- | config/requirements.txt | 8 | ||||
-rw-r--r-- | config/settings/setting.py | 161 |
5 files changed, 247 insertions, 0 deletions
diff --git a/config/__init__.py b/config/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/config/__init__.py diff --git a/config/base_urls.py b/config/base_urls.py new file mode 100644 index 0000000..6e9e15f --- /dev/null +++ b/config/base_urls.py @@ -0,0 +1,68 @@ +from django.conf.urls.defaults import * +from django.contrib import admin +from django.views.generic import list_detail +from django.views.generic.simple import redirect_to,direct_to_template +from django.contrib.sitemaps import FlatPageSitemap +from django.conf import settings + +from blog.models import BlogSitemap,LatestFull +from locations.models import WritingbyLocationSitemap +from links.models import LatestLinks +from photos.models import PhotoGallerySitemap +from projects.models.base import ProjectSitemap + +admin.autodiscover() + + +sitemaps = { + 'blog': BlogSitemap, + 'photos': PhotoGallerySitemap, + 'projects': ProjectSitemap +} +feeds = { + 'writing': LatestFull, + 'fblinks' : LatestLinks, +} + +if settings.DEVELOPMENT: + urlpatterns = patterns('', + (r'^media/admin/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+'/admin'}), + (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), + (r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.IMAGES_ROOT}), + ) +else: + urlpatterns = patterns('') + +# old page redirects +urlpatterns += patterns('', + (r'^2003/nov/02/take-me-your-leader-ii/$', direct_to_template, {'template': 'static/oldcontent.html'}), + (r'^2003/aug/07/take-me-your-leader/$', direct_to_template, {'template': 'static/oldcontent.html'}), + (r'^2004/jan/07/david-foster-wallace-infinity/$', direct_to_template, {'template': 'static/oldcontent.html'}), +) + +urlpatterns += patterns('', + (r'^admin/doc/', include('django.contrib.admindocs.urls')), + (r'^admin/filebrowser/', include('filebrowser.urls')), + (r'^admin/', include(admin.site.urls),), + (r'^grappelli/', include('grappelli.urls')), + (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), + (r'^robots.txt$', direct_to_template, {'template': 'archives/robots.html'}), + (r'^googleb11655cd59dacf3c.html$', direct_to_template, {'template': 'static/gverify.html'}), + (r'^contact/', direct_to_template, {'template': 'details/contact.html'}), + (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), + (r'^writing/', include('blog.urls')), + (r'^projects/', include('projects.urls')), + #Entry detail i.e. /year/month/day/my-title/ + (r'(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$', 'blog.views.entry_detail'), + # locations + (r'^locations/', include('locations.urls')), + (r'^photos/', include('photos.urls')), + (r'^photo/', include('photos.detail_urls')), + (r'^travel-guide/', include('guide.urls')), + # map + (r'^map/', include('locations.urls')), + #about + (r'^about/$', 'blog.views.about'), #'blog.views.home'), + #homepage + (r'^$', 'blog.views.home'), #'blog.views.home'), +) diff --git a/config/djadmin.sh b/config/djadmin.sh new file mode 100755 index 0000000..89dbf4c --- /dev/null +++ b/config/djadmin.sh @@ -0,0 +1,10 @@ +#!/bin/bash +DIR="$( cd "$( dirname $( dirname "${BASH_SOURCE[0]}" ) )" && pwd )" +PYTHONPATH=$PYTHONPATH:$DIR +PYTHONPATH=$PYTHONPATH:"${DIR}/app" +PYTHONPATH=$PYTHONPATH:"${DIR}/app/lib" + +export PYTHONPATH +export DJANGO_SETTINGS_MODULE=settings.settings +ADMIN="${DIR}/venv/bin/django-admin.py" +$ADMIN $@ diff --git a/config/requirements.txt b/config/requirements.txt new file mode 100644 index 0000000..6ef8852 --- /dev/null +++ b/config/requirements.txt @@ -0,0 +1,8 @@ +Django==1.4.1 +PIL==1.1.7 +django-extensions==0.9 +django-filebrowser==3.5.0 +django-grappelli==2.4.2 +psycopg2==2.4.5 +wsgiref==0.1.2 +yolk==0.4.3 diff --git a/config/settings/setting.py b/config/settings/setting.py new file mode 100644 index 0000000..c056f18 --- /dev/null +++ b/config/settings/setting.py @@ -0,0 +1,161 @@ +# Django settings for luxagraf. +from os.path import dirname, abspath + +PROJ_ROOT = abspath(dirname(dirname(__file__)))+'/' + + +DEBUG = True +TEMPLATE_DEBUG = DEBUG +DEVELOPMENT = False +ADMINS = ( + ('sng', 'luxagraf@gmail.com'), +) +CONTACT = ( + ('sng', 'sng@luxagraf.net'), +) +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'NAME': 'luxagraf', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'USER': 'luxagraf', + 'PASSWORD': 'translinguis', + } +} + +#Email Setting for Webfaction +EMAIL_HOST = 'mail2.webfaction.com' +EMAIL_HOST_USER = 'luxagraf' +EMAIL_HOST_PASSWORD = 'translinguis#' +DEFAULT_FROM_EMAIL = 'sng@luxagraf.net' +SEND_BROKEN_LINK_EMAILS = True +SERVER_EMAIL = 'sng@luxagraf.net' +EMAIL_PORT = 25 + +SITE_NAME = 'luxagraf' + +GRAPPELLI_ADMIN_TITLE = 'Luxagraf Admin' + + + +#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' +SITE_NAME = 'Luxagraf' +# API key for askimet spam filter +AKISMET_API_KEY = '23decc99e9ed' +# API key for Flickr imports +FLICKR_API_KEY = '7b9d978a440c6ab65a545adc0aa0d693' +FLICKR_USER_ID = '85322932@N00' + +DELICIOUS_USER = 'luxagraf' +DELICIOUS_PASS = 'translinguis#' +TUMBLR_URL = 'luxagraf.tumblr.com' +TUMBLR_PASSWORD = 'translinguis' +TUMBLR_USER ='luxagraf@gmail.com' +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = PROJ_ROOT+'media/' +IMAGES_ROOT = PROJ_ROOT+'media/images/' +STATIC_ROOT = PROJ_ROOT+'static/' + +# URL that handles the media served from MEDIA_ROOT. +# Example: "http://media.lawrence.com" +MEDIA_URL = 'http://media.luxagraf.net/' +IMAGES_URL = 'http://images.luxagraf.net/' +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '-kzv5^z9@j%cvk6u#lcf&nuga4oiy_-6q^-+#iybt44t_ii-1o' + +#CACHE_BACKEND = 'memcached://174.133.21.78:32348/' +#CACHE_MIDDLEWARE_SECONDS = 3600 +#CACHE_MIDDLEWARE_KEY_PREFIX = 'luxagraf_net' + + +MIDDLEWARE_CLASSES = ( + 'django.middleware.gzip.GZipMiddleware', + #'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.common.CommonMiddleware', + # 'django.middleware.cache.FetchFromCacheMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'pagination.middleware.PaginationMiddleware', + 'fdigg.middleware.FckDiggMiddleware', + #'ssl.middleware.SSLRedirect', + #'debug_toolbar.middleware.DebugToolbarMiddleware', +) +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.media', + "grappelli.context_processors.admin_template_path", +) +ROOT_URLCONF = 'settings.base_urls' +INTERNAL_IPS = ( + '67.15.64.48', + '63.251.179.56', + '127.0.0.1' +) + +TEMPLATE_DIRS = ( + PROJ_ROOT+'templates', + PROJ_ROOT+'lib/templates', + PROJ_ROOT+'lib/grappelli/templates', + #PROJ_ROOT+'lib/debug_toolbar/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. +) +TEMPLATE_LOADERS = ( + ('django.template.loaders.cached.Loader', ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + )), +) +INSTALLED_APPS = ( + 'grappelli', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.sitemaps', + 'django.contrib.gis', + 'filebrowser', + 'locations', + 'blog', + 'photos', + #'tagging', + 'taggit', + 'chunks', + 'links', + 'pagination', + 'templatetags', + 'contact_form', + 'projects', + 'guide' + +) +try: + from settings_local import * +except: + pass |