[Booki-dev] Reinstalled Booki, now picture uploads don't work
James Simmons
nicestep at gmail.com
Tue Jun 14 07:40:13 PDT 2011
This morning I accidentally deleted my Booki installation when I meant
to delete something else. Fortunately the database was not deleted,
so I was able to install the latest Booki and my books are preserved,
except for the images, The uploaded image directory from the old
installation did not get deleted, so I copied that to the new
directory and nothing. Not only that, but when I try to upload
pictures to a book, even a new, empty book, NOTHING happens. The damn
thing just fails silently, no indication anywhere what it doesn't
like. Nothing in the logs.
I need to get this working. Unfortunately the tool isn't giving me
any clues to go on.
This is my new settings.py:
import os.path
# DJANGO DEBUG
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# DJANGO ADMIN
ADMINS = (
('James Simmons', 'nicestep at gmail.com'),
)
MANAGERS = ADMINS
# BOOKI
BOOKI_MAINTENANCE_MODE = False
BOOKI_NAME = 'My Booki'
THIS_BOOKI_SERVER = '127.0.0.1:8000' # the name of the booki server
(comment out to use os.environ['HTTP_HOST'])
BOOKI_ROOT = '/home/jim/src/booki' # edit this
# BOOKI_URL = 'http://127.0.0.1:8000'
BOOKI_URL = 'http://%s' % THIS_BOOKI_SERVER
# E-MAIL OPTIONS
REPORT_EMAIL_USER = 'nicestep at gmail.com'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
#EMAIL_HOST_USER = 'booki@' + THIS_BOOKI_SERVER
#EMAIL_HOST_PASSWORD = ''
#EMAIL_USE_TLS = False
# BOOKI DIRECTORIES
# site_static
import booki
SITE_STATIC_ROOT = '%s/site_static' % os.path.dirname(booki.__file__)
SITE_STATIC_URL = '%s/site_static' % BOOKI_URL
# static
STATIC_ROOT = '%s/static' % BOOKI_ROOT
STATIC_URL = '%s/static' % BOOKI_URL
# data
DATA_ROOT = '%s/data' % BOOKI_ROOT
DATA_URL = '%s/data' % BOOKI_URL
# profile images
PROFILE_IMAGE_UPLOAD_DIR = '%s/profile_images/' % DATA_ROOT
# obsolete
MEDIA_ROOT = DATA_ROOT
MEDIA_URL = DATA_URL
ADMIN_MEDIA_PREFIX = '%s/media/' % BOOKI_URL
# URLS
OBJAVI_URL = "http://127.0.0.1/objavi.cgi"
ESPRI_URL = "http://127.0.0.1/espri.cgi"
TWIKI_GATEWAY_URL = "http://127.0.0.1/booki-twiki-gateway.cgi"
# who gets credited as publisher if not otherwise specified
DEFAULT_PUBLISHER = "James Simmons"
# DATABASE STUFF
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/home/jim/booki/booki.db' # Or path to
database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = 'localhost' # Set to empty string for
localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.
# REDIS STUFF
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_PASSWORD = None
# DJANGO STUFF
AUTH_PROFILE_MODULE='account.UserProfile'
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'en-us'
gettext = lambda s: s
LANGUAGES = (
('en-us', gettext('English')),
)
SITE_ID = 1
USE_I18N = True
USE_L10N = True
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'enc*ln*vp^o2p1p6of8ip9v5_tt6r#fh2-!- at pl0ur^6ul6e)l'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.transaction.TransactionMiddleware'
# , 'booki.portal.middleware.SQLProfileMiddleware'
)
ROOT_URLCONF = 'booki.urls'
TEMPLATE_DIRS = (
'%s/templates/' % BOOKI_ROOT
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'south',
# list of booki apps
'booki.editor',
'booki.account',
'booki.reader',
'booki.portal',
'sputnik'
)
# LOGGING
def init_logging():
import logging
import logging.handlers
logger = logging.getLogger("booki")
logger.setLevel(logging.DEBUG)
ch = logging.handlers.RotatingFileHandler('%s/logs/booki.log' %
BOOKI_ROOT, maxBytes=100000, backupCount=5)
ch.setLevel(logging.DEBUG)
ch.setFormatter(logging.Formatter("%(asctime)s - %(name)s -
%(levelname)s - %(message)s"))
logger.addHandler(ch)
logInitDone=False
if not logInitDone:
logInitDone = True
init_logging()
James Simmons
More information about the Booki-dev
mailing list