From cf675ce5d892c05d4289e70a08576128e4cbce9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 27 Feb 2012 11:21:24 +0100 Subject: [PATCH] Definitions for dirs --- settings.py | 17 +++++++++++++++-- trans/views.py | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/settings.py b/settings.py index c6b7a33e3..11c17549c 100644 --- a/settings.py +++ b/settings.py @@ -20,6 +20,18 @@ DATABASES = { } } +HOSTNAME = gethostname() +if HOSTNAME == 'rincewind': + WEB_ROOT = '/home/mcihar/private/weblate/' +elif HOSTNAME == 'raptor': + WEB_ROOT = '/home/nijel/work/gammu/weblate/' +elif HOSTNAME == 'nutt': + WEB_ROOT = '/home/nijel/gammu/weblate/' +elif HOSTNAME == 'web': + WEB_ROOT = '/var/lib/django/weblate/' +else: + WEB_ROOT = '/home/nijel/work/gammu/weblate/' + # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. @@ -45,12 +57,12 @@ USE_L10N = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = '' +MEDIA_ROOT = '%s/media/' % WEB_ROOT # 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 = '' +MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files @@ -106,6 +118,7 @@ TEMPLATE_DIRS = ( # 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. + '%s/html/' % WEB_ROOT, ) INSTALLED_APPS = ( diff --git a/trans/views.py b/trans/views.py index 98f97d5d2..cead01dce 100644 --- a/trans/views.py +++ b/trans/views.py @@ -17,7 +17,6 @@ def show_subproject(request, project, subproject): 'object': obj, }) - def show_translation(request, project, subproject, lang): obj = get_object_or_404(Language, language__code = lang, subproject__slug = subproject, subproject__project__slug = project)