From 8b4c794ea9a4783ad95f412925aa33e7b3da5375 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 31 Jul 2013 22:42:16 +0200 Subject: [PATCH 1/1] Separate var dir. --- .gitignore | 9 +-------- src/project_name/settings/basic.py | 2 +- src/project_name/settings/paths.py | 2 +- src/project_name/settings/static.py | 4 ++-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 554bc70..0c8943b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,9 @@ localsettings.py -dev.sqlite -*.db -*.db-journal +var *~ *.orig *.log -# Compress output -/static - # Python garbage *.pyc .coverage @@ -33,7 +28,5 @@ thumbs.db # Tags file TAGS -media -search_index .sass-cache diff --git a/src/project_name/settings/basic.py b/src/project_name/settings/basic.py index 65bfd83..da47145 100644 --- a/src/project_name/settings/basic.py +++ b/src/project_name/settings/basic.py @@ -8,7 +8,7 @@ TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': path.join(PROJECT_DIR, 'dev.db'), # Or path to database file if using sqlite3. + 'NAME': path.join(PROJECT_DIR, 'var', 'dev.db'), # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. diff --git a/src/project_name/settings/paths.py b/src/project_name/settings/paths.py index b3ef304..3b1a69e 100644 --- a/src/project_name/settings/paths.py +++ b/src/project_name/settings/paths.py @@ -1,3 +1,3 @@ from os import path -PROJECT_DIR = path.dirname(path.abspath(path.dirname(__file__))) +PROJECT_DIR = path.dirname(path.dirname(path.dirname(path.abspath(path.dirname(__file__))))) diff --git a/src/project_name/settings/static.py b/src/project_name/settings/static.py index 23f305e..d506058 100644 --- a/src/project_name/settings/static.py +++ b/src/project_name/settings/static.py @@ -2,9 +2,9 @@ from os import path from paths import PROJECT_DIR -MEDIA_ROOT = path.join(PROJECT_DIR, 'media/') +MEDIA_ROOT = path.join(PROJECT_DIR, 'var/media/') MEDIA_URL = '/media/' -STATIC_ROOT = path.join(PROJECT_DIR, 'static/') +STATIC_ROOT = path.join(PROJECT_DIR, 'var/static/') STATIC_URL = '/static/' STATICFILES_FINDERS = ( -- 2.20.1