diff options
author | Wojciech Polak <polak@gnu.org> | 2013-04-09 19:59:50 +0200 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2013-04-09 20:01:47 +0200 |
commit | 11de8715829bd3744de9542dd77a6d658ba519d8 (patch) | |
tree | b8afe4a8e29d2fbfbce2b53b0cde319aafbe5ad2 | |
parent | 8f61a0bf3cd35445dc5cb5c18faf69d3a1d32680 (diff) | |
download | dico-11de8715829bd3744de9542dd77a6d658ba519d8.tar.gz dico-11de8715829bd3744de9542dd77a6d658ba519d8.tar.bz2 |
Support Django 1.5.
-rw-r--r-- | dicoweb/INSTALL | 34 | ||||
-rw-r--r-- | dicoweb/requirements.txt | 2 | ||||
-rw-r--r-- | dicoweb/settings-sample.py | 44 | ||||
-rw-r--r-- | dicoweb/templates/base.html | 6 | ||||
-rw-r--r-- | dicoweb/urls.py | 2 | ||||
-rw-r--r-- | dicoweb/wsgi.py (renamed from dicoweb/dicoweb.wsgi) | 4 |
6 files changed, 46 insertions, 46 deletions
diff --git a/dicoweb/INSTALL b/dicoweb/INSTALL index af5a4a5..46d7a32 100644 --- a/dicoweb/INSTALL +++ b/dicoweb/INSTALL @@ -14,6 +14,9 @@ Copyright (C) 2008-2010, 2012, 2013 Wojciech Polak Rename 'settings-sample.py' to 'settings.py' and edit your local Dicoweb site configuration. +See https://docs.djangoproject.com/en/dev/howto/deployment/ +for usual Django applications deployment. + ** The development/test server ------------------------------ @@ -35,41 +38,12 @@ the following output: Apache configuration: LoadModule wsgi_module modules/mod_wsgi.so - WSGIScriptAlias / /usr/local/django/dicoweb/dicoweb.wsgi + WSGIScriptAlias / /usr/local/django/dicoweb/wsgi.py Alias /static "/usr/local/django/dicoweb/static" More detailed information is available at: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango -** Production server with mod_python ------------------------------------- - -Apache configuration: - - LoadModule python_module modules/mod_python.so - <Location "/"> - SetHandler python-program - PythonHandler django.core.handlers.modpython - PythonPath "sys.path + ['/usr/local/django', '/usr/local/django/dicoweb']" - SetEnv DJANGO_SETTINGS_MODULE dicoweb.settings - PythonInterpreter dicoweb - PythonDebug Off - </Location> - - <Location "/static"> - SetHandler None - </Location> - <Location "/favicon.ico"> - SetHandler None - </Location> - - <Directory "/usr/local/django/dicoweb/"> - AllowOverride All - Options None - Order allow,deny - Allow from all - </Directory> - Local Variables: diff --git a/dicoweb/requirements.txt b/dicoweb/requirements.txt index d305857..b5c8a15 100644 --- a/dicoweb/requirements.txt +++ b/dicoweb/requirements.txt @@ -1,2 +1,2 @@ -Django >=1.4.5,<1.4.99 +Django >=1.4.5 git+git://git.gnu.org.ua/wit.git diff --git a/dicoweb/settings-sample.py b/dicoweb/settings-sample.py index 2ccd8ca..7e1f163 100644 --- a/dicoweb/settings-sample.py +++ b/dicoweb/settings-sample.py @@ -27,17 +27,10 @@ ADMINS = ( ) MANAGERS = ADMINS -DATABASE_ENGINE = '' -DATABASE_NAME = '' -DATABASE_USER = '' -DATABASE_PASSWORD = '' -DATABASE_HOST = '' -DATABASE_PORT = '' - SITE_ID = 1 USE_I18N = True -TIME_ZONE = 'Europe/Warsaw' +TIME_ZONE = 'UTC' LANGUAGE_CODE = 'en-us' LANGUAGE_COOKIE_NAME = 'dicoweb_lang' @@ -59,7 +52,7 @@ CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True MEDIA_ROOT = os.path.join(SITE_ROOT, 'static') # URL that handles the media served from MEDIA_ROOT. -MEDIA_URL = 'static/' +MEDIA_URL = '/static/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'SET THIS TO A RANDOM STRING' @@ -92,5 +85,38 @@ INSTALLED_APPS = ( 'dicoweb', ) +# A sample logging configuration. The only tangible logging +# performed by this configuration is to send an email to +# the site admins on every HTTP 500 error when DEBUG=False. +# See http://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'filters': { + 'require_debug_false': { + '()': 'django.utils.log.RequireDebugFalse' + } + }, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'filters': ['require_debug_false'], + 'class': 'django.utils.log.AdminEmailHandler' + } + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} + +# +# Dicoweb specific settings. +# + DICT_SERVERS = ('gnu.org.ua',) DICT_TIMEOUT = 10 diff --git a/dicoweb/templates/base.html b/dicoweb/templates/base.html index ded7c24..cd83eb5 100644 --- a/dicoweb/templates/base.html +++ b/dicoweb/templates/base.html @@ -1,4 +1,4 @@ -{% load media %} +{% load media %}{% load url from future %} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> @@ -10,14 +10,14 @@ <meta name="description" content="GNU Dico WebSearch Interface" /> <meta name="robots" content="{{ page.robots }}" /> <link rel="stylesheet" type="text/css" href="{% media_prefix %}dicoweb.css" /> -<link rel="search" type="application/opensearchdescription+xml" title="GNU Dico WebSearch" href="{% url opensearch %}" /> +<link rel="search" type="application/opensearchdescription+xml" title="GNU Dico WebSearch" href="{% url 'opensearch' %}" /> <script type="text/javascript" src="{% media_prefix %}dicoweb.js"></script> </head> <body> <div id="wrap"> <div id="logo"> - <h1><a href="{% url views.index %}" accesskey="1">GNU Dico</a></h1> + <h1><a href="{% url 'views.index' %}" accesskey="1">GNU Dico</a></h1> <img src="{% media_prefix %}gnu-head-sm.jpg" width="129" height="122" alt="GNU" /> </div> <div id="main"> diff --git a/dicoweb/urls.py b/dicoweb/urls.py index 1558de4..bf7ea2e 100644 --- a/dicoweb/urls.py +++ b/dicoweb/urls.py @@ -15,7 +15,7 @@ # along with GNU Dico. If not, see <http://www.gnu.org/licenses/>. from django.conf import settings -from django.conf.urls.defaults import * +from django.conf.urls import patterns import views urlpatterns = patterns( diff --git a/dicoweb/dicoweb.wsgi b/dicoweb/wsgi.py index 3eb1980..d3bee86 100644 --- a/dicoweb/dicoweb.wsgi +++ b/dicoweb/wsgi.py @@ -21,5 +21,5 @@ SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) os.environ['DJANGO_SETTINGS_MODULE'] = 'dicoweb.settings' sys.path.insert(0, os.path.join(SITE_ROOT, '../')) -from django.core.handlers.wsgi import WSGIHandler -application = WSGIHandler() +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() |