summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2013-04-20 10:55:34 -0400
committerMike Crute <mcrute@gmail.com>2013-04-20 11:00:30 -0400
commit2e598146d62b74ba59027a5bdbc78d267ae33576 (patch)
tree4d58cacb8062f069af06155e5093d182390ce1e7
parenta543b30e628cef2a00987846bb02d389bb48a0be (diff)
downloadgreenbox-2e598146d62b74ba59027a5bdbc78d267ae33576.tar.bz2
greenbox-2e598146d62b74ba59027a5bdbc78d267ae33576.tar.xz
greenbox-2e598146d62b74ba59027a5bdbc78d267ae33576.zip
Upgrading to Django 1.5
-rw-r--r--.hgignore4
-rw-r--r--.hgrc1
-rw-r--r--greenbox/manage.py11
-rw-r--r--greenbox/settings.py36
-rwxr-xr-xmanage.py10
5 files changed, 30 insertions, 32 deletions
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index 5ab741f..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,4 +0,0 @@
1syntax: glob
2*.pyc
3*.db
4nohup.out
diff --git a/.hgrc b/.hgrc
deleted file mode 100644
index 0d20b64..0000000
--- a/.hgrc
+++ /dev/null
@@ -1 +0,0 @@
1*.pyc
diff --git a/greenbox/manage.py b/greenbox/manage.py
deleted file mode 100644
index 5e78ea9..0000000
--- a/greenbox/manage.py
+++ /dev/null
@@ -1,11 +0,0 @@
1#!/usr/bin/env python
2from django.core.management import execute_manager
3try:
4 import settings # Assumed to be in the same directory.
5except ImportError:
6 import sys
7 sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
8 sys.exit(1)
9
10if __name__ == "__main__":
11 execute_manager(settings)
diff --git a/greenbox/settings.py b/greenbox/settings.py
index e6205e2..eb4f340 100644
--- a/greenbox/settings.py
+++ b/greenbox/settings.py
@@ -1,4 +1,7 @@
1import os.path 1import os
2
3PROJECT_DIR = os.path.dirname(__file__)
4PUBLIC_DIR = os.path.join(PROJECT_DIR, 'site_media')
2 5
3SITE_ID = 1 6SITE_ID = 1
4USE_I18N = False 7USE_I18N = False
@@ -13,30 +16,30 @@ ADMINS = (
13 16
14MANAGERS = ADMINS 17MANAGERS = ADMINS
15 18
16DATABASE_ENGINE = 'sqlite3' 19DATABASES = {
17DATABASE_NAME = '/srv/greenbox/greenbox.db' 20 'default': {
18#DATABASE_NAME = '/Users/mcrute/sandboxes/greenbox/src/greenbox.db' 21 'ENGINE': 'django.db.backends.sqlite3',
22 'NAME': '/home/crute_recipes/greenbox.db',
23 }
24}
19 25
20TIME_ZONE = 'America/New_York' 26TIME_ZONE = 'America/New_York'
21LANGUAGE_CODE = 'en-us' 27LANGUAGE_CODE = 'en-us'
22ROOT_URLCONF = 'greenbox.urls' 28ROOT_URLCONF = 'greenbox.urls'
23 29
24# Absolute path to the directory that holds media.
25# Example: "/home/media/media.lawrence.com/"
26MEDIA_ROOT = os.path.join(PROJECT_DIR, 'templates/media')
27 30
28# URL that handles the media served from MEDIA_ROOT. Make sure to use a 31MEDIA_ROOT = os.path.join(PUBLIC_DIR, 'media')
29# trailing slash if there is a path component (optional in other cases). 32MEDIA_URL = '/site_media/media/'
30# Examples: "http://media.lawrence.com", "http://example.com/media/"
31MEDIA_URL = '/media'
32 33
33SECRET_KEY = 'zki4e4!80ar7^1w6f_c2u^5#=r(7#4%0u^3il^@__#3zf^u+f)' 34STATIC_ROOT = os.path.join(PUBLIC_DIR, 'static')
35STATIC_URL = '/site_media/static/'
34 36
35TEMPLATE_LOADERS = ( 37STATICFILES_DIRS = (
36 'django.template.loaders.filesystem.load_template_source', 38 os.path.join(PROJECT_DIR, 'static'),
37 'django.template.loaders.app_directories.load_template_source',
38) 39)
39 40
41SECRET_KEY = 'zki4e4!80ar7^1w6f_c2u^5#=r(7#4%0u^3il^@__#3zf^u+f)'
42
40MIDDLEWARE_CLASSES = ( 43MIDDLEWARE_CLASSES = (
41 'django.middleware.common.CommonMiddleware', 44 'django.middleware.common.CommonMiddleware',
42 'django.contrib.sessions.middleware.SessionMiddleware', 45 'django.contrib.sessions.middleware.SessionMiddleware',
@@ -50,8 +53,9 @@ TEMPLATE_DIRS = (
50INSTALLED_APPS = ( 53INSTALLED_APPS = (
51 'django.contrib.auth', 54 'django.contrib.auth',
52 'django.contrib.contenttypes', 55 'django.contrib.contenttypes',
56 'django.contrib.staticfiles',
53 'django.contrib.sessions', 57 'django.contrib.sessions',
54 'django.contrib.sites', 58 'django.contrib.sites',
55 'django.contrib.admin', 59 'django.contrib.admin',
56 'greenbox.recipe', 60 'recipe',
57) 61)
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..1845198
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,10 @@
1#!/usr/bin/env python
2import os
3import sys
4
5if __name__ == "__main__":
6 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "greenbox.settings")
7
8 from django.core.management import execute_from_command_line
9
10 execute_from_command_line(sys.argv)