aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Meyer <carl@dirtcircle.com>2009-12-13 08:25:41 -0500
committerCarl Meyer <carl@dirtcircle.com>2009-12-13 08:25:41 -0500
commit8b1bb7b106f753c2b28284c4516cc1e9f27c2841 (patch)
tree1db3a95e9c39f6d2cb5f0563ea9f5e33e14c5e68
parentb85ea9ce69936bb66f8e9b4f9c9746cb9b20ab85 (diff)
downloadchishop-8b1bb7b106f753c2b28284c4516cc1e9f27c2841.tar.bz2
chishop-8b1bb7b106f753c2b28284c4516cc1e9f27c2841.tar.xz
chishop-8b1bb7b106f753c2b28284c4516cc1e9f27c2841.zip
rearranged settings: fixes #7
-rw-r--r--README7
-rw-r--r--buildout.cfg2
-rw-r--r--chishop/conf/__init__.py0
-rw-r--r--chishop/conf/default.py113
-rw-r--r--chishop/development.py23
-rw-r--r--chishop/production_example.py18
-rw-r--r--chishop/settings.py112
7 files changed, 150 insertions, 125 deletions
diff --git a/README b/README
index 86af4ca..ad431a6 100644
--- a/README
+++ b/README
@@ -27,6 +27,13 @@ Run the PyPI server
27Please note that ``chishop/media/dists`` has to be writable by the 27Please note that ``chishop/media/dists`` has to be writable by the
28user the web-server is running as. 28user the web-server is running as.
29 29
30In production
31-------------
32
33You may want to copy the file ``chishop/production_example.py`` and modify
34for use as your production settings; you will also need to modify
35``bin/django.wsgi`` to refer to your production settings.
36
30Using Setuptools 37Using Setuptools
31================ 38================
32 39
diff --git a/buildout.cfg b/buildout.cfg
index 04e0acf..160db4c 100644
--- a/buildout.cfg
+++ b/buildout.cfg
@@ -8,7 +8,7 @@ eggs = pkginfo
8[django] 8[django]
9recipe = djangorecipe 9recipe = djangorecipe
10version = 1.1.1 10version = 1.1.1
11settings = development 11settings = settings
12eggs = ${buildout:eggs} 12eggs = ${buildout:eggs}
13test = djangopypi 13test = djangopypi
14project = chishop 14project = chishop
diff --git a/chishop/conf/__init__.py b/chishop/conf/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/chishop/conf/__init__.py
diff --git a/chishop/conf/default.py b/chishop/conf/default.py
new file mode 100644
index 0000000..606d9d1
--- /dev/null
+++ b/chishop/conf/default.py
@@ -0,0 +1,113 @@
1# Django settings for djangopypi project.
2import os
3
4ADMINS = (
5 # ('Your Name', 'your_email@domain.com'),
6)
7
8# Allow uploading a new distribution file for a project version
9# if a file of that type already exists.
10#
11# The default on PyPI is to not allow this, but it can be real handy
12# if you're sloppy.
13DJANGOPYPI_ALLOW_VERSION_OVERWRITE = False
14DJANGOPYPI_RELEASE_UPLOAD_TO = 'dists'
15
16# change to False if you do not want Django's default server to serve static pages
17LOCAL_DEVELOPMENT = True
18
19REGISTRATION_OPEN = True
20ACCOUNT_ACTIVATION_DAYS = 7
21LOGIN_REDIRECT_URL = "/"
22
23EMAIL_HOST = ''
24DEFAULT_FROM_EMAIL = ''
25SERVER_EMAIL = DEFAULT_FROM_EMAIL
26
27MANAGERS = ADMINS
28
29DATABASE_ENGINE = ''
30DATABASE_NAME = ''
31DATABASE_USER = ''
32DATABASE_PASSWORD = ''
33DATABASE_HOST = ''
34DATABASE_PORT = ''
35
36# Local time zone for this installation. Choices can be found here:
37# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38# although not all choices may be available on all operating systems.
39# If running in a Windows environment this must be set to the same as your
40# system time zone.
41TIME_ZONE = 'America/Chicago'
42
43# Language code for this installation. All choices can be found here:
44# http://www.i18nguy.com/unicode/language-identifiers.html
45LANGUAGE_CODE = 'en-us'
46
47SITE_ID = 1
48
49# If you set this to False, Django will make some optimizations so as not
50# to load the internationalization machinery.
51USE_I18N = True
52
53# Absolute path to the directory that holds media.
54# Example: "/home/media/media.lawrence.com/"
55here = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
56MEDIA_ROOT = os.path.join(here, 'media')
57
58# URL that handles the media served from MEDIA_ROOT. Make sure to use a
59# trailing slash if there is a path component (optional in other cases).
60# Examples: "http://media.lawrence.com", "http://example.com/media/"
61MEDIA_URL = 'media/'
62
63MEDIA_PREFIX = "/media/"
64
65# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
66# trailing slash.
67# Examples: "http://foo.com/media/", "/media/".
68ADMIN_MEDIA_PREFIX = '/admin-media/'
69
70# Make this unique, and don't share it with anybody.
71SECRET_KEY = 'w_#0r2hh)=!zbynb*gg&969@)sy#^-^ia3m*+sd4@lst$zyaxu'
72
73# List of callables that know how to import templates from various sources.
74TEMPLATE_LOADERS = (
75 'django.template.loaders.filesystem.load_template_source',
76 'django.template.loaders.app_directories.load_template_source',
77# 'django.template.loaders.eggs.load_template_source',
78)
79
80MIDDLEWARE_CLASSES = (
81 'django.middleware.common.CommonMiddleware',
82 'django.contrib.sessions.middleware.SessionMiddleware',
83 'django.contrib.auth.middleware.AuthenticationMiddleware',
84)
85
86ROOT_URLCONF = 'urls'
87
88TEMPLATE_CONTEXT_PROCESSORS = (
89 "django.core.context_processors.auth",
90 "django.core.context_processors.debug",
91 "django.core.context_processors.i18n",
92 "django.core.context_processors.media",
93 "django.core.context_processors.request",
94)
95
96TEMPLATE_DIRS = (
97 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
98 # Always use forward slashes, even on Windows.
99 # Don't forget to use absolute paths, not relative paths.
100 os.path.join(os.path.dirname(os.path.dirname(__file__)), "templates"),
101)
102
103INSTALLED_APPS = (
104 'django.contrib.auth',
105 'django.contrib.contenttypes',
106 'django.contrib.sessions',
107 'django.contrib.sites',
108 'django.contrib.admin',
109 'django.contrib.markup',
110 'django.contrib.admindocs',
111 'registration',
112 'djangopypi',
113)
diff --git a/chishop/development.py b/chishop/development.py
deleted file mode 100644
index 0671fc2..0000000
--- a/chishop/development.py
+++ /dev/null
@@ -1,23 +0,0 @@
1from settings import *
2import os
3
4DEBUG = True
5TEMPLATE_DEBUG = DEBUG
6LOCAL_DEVELOPMENT = True
7
8if LOCAL_DEVELOPMENT:
9 import sys
10 sys.path.append(os.path.dirname(__file__))
11
12ADMINS = (
13 ('chishop', 'example@example.org'),
14)
15
16MANAGERS = ADMINS
17
18DATABASE_ENGINE = 'sqlite3'
19DATABASE_NAME = os.path.join(here, 'devdatabase.db')
20DATABASE_USER = ''
21DATABASE_PASSWORD = ''
22DATABASE_HOST = ''
23DATABASE_PORT = ''
diff --git a/chishop/production_example.py b/chishop/production_example.py
new file mode 100644
index 0000000..b64623e
--- /dev/null
+++ b/chishop/production_example.py
@@ -0,0 +1,18 @@
1from conf.default import *
2import os
3
4DEBUG = False
5TEMPLATE_DEBUG = DEBUG
6
7ADMINS = (
8 ('chishop', 'example@example.org'),
9)
10
11MANAGERS = ADMINS
12
13DATABASE_ENGINE = 'postgresql_psycopg2'
14DATABASE_NAME = 'chishop'
15DATABASE_USER = 'chishop'
16DATABASE_PASSWORD = 'chishop'
17DATABASE_HOST = ''
18DATABASE_PORT = ''
diff --git a/chishop/settings.py b/chishop/settings.py
index ee286b5..e68a4e5 100644
--- a/chishop/settings.py
+++ b/chishop/settings.py
@@ -1,113 +1,23 @@
1# Django settings for djangopypi project. 1from conf.default import *
2import os 2import os
3 3
4ADMINS = ( 4DEBUG = True
5 # ('Your Name', 'your_email@domain.com'), 5TEMPLATE_DEBUG = DEBUG
6)
7
8# Allow uploading a new distribution file for a project version
9# if a file of that type already exists.
10#
11# The default on PyPI is to not allow this, but it can be real handy
12# if you're sloppy.
13DJANGOPYPI_ALLOW_VERSION_OVERWRITE = False
14DJANGOPYPI_RELEASE_UPLOAD_TO = 'dists'
15
16# change to False if you do not want Django's default server to serve static pages
17LOCAL_DEVELOPMENT = True 6LOCAL_DEVELOPMENT = True
18 7
19REGISTRATION_OPEN = True 8if LOCAL_DEVELOPMENT:
20ACCOUNT_ACTIVATION_DAYS = 7 9 import sys
21LOGIN_REDIRECT_URL = "/" 10 sys.path.append(os.path.dirname(__file__))
22 11
23EMAIL_HOST = '' 12ADMINS = (
24DEFAULT_FROM_EMAIL = '' 13 ('chishop', 'example@example.org'),
25SERVER_EMAIL = DEFAULT_FROM_EMAIL 14)
26 15
27MANAGERS = ADMINS 16MANAGERS = ADMINS
28 17
29DATABASE_ENGINE = '' 18DATABASE_ENGINE = 'sqlite3'
30DATABASE_NAME = '' 19DATABASE_NAME = os.path.join(here, 'devdatabase.db')
31DATABASE_USER = '' 20DATABASE_USER = ''
32DATABASE_PASSWORD = '' 21DATABASE_PASSWORD = ''
33DATABASE_HOST = '' 22DATABASE_HOST = ''
34DATABASE_PORT = '' 23DATABASE_PORT = ''
35
36# Local time zone for this installation. Choices can be found here:
37# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38# although not all choices may be available on all operating systems.
39# If running in a Windows environment this must be set to the same as your
40# system time zone.
41TIME_ZONE = 'America/Chicago'
42
43# Language code for this installation. All choices can be found here:
44# http://www.i18nguy.com/unicode/language-identifiers.html
45LANGUAGE_CODE = 'en-us'
46
47SITE_ID = 1
48
49# If you set this to False, Django will make some optimizations so as not
50# to load the internationalization machinery.
51USE_I18N = True
52
53# Absolute path to the directory that holds media.
54# Example: "/home/media/media.lawrence.com/"
55here = os.path.abspath(os.path.dirname(__file__))
56MEDIA_ROOT = os.path.join(here, 'media')
57
58# URL that handles the media served from MEDIA_ROOT. Make sure to use a
59# trailing slash if there is a path component (optional in other cases).
60# Examples: "http://media.lawrence.com", "http://example.com/media/"
61MEDIA_URL = 'media/'
62
63MEDIA_PREFIX = "/media/"
64
65# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
66# trailing slash.
67# Examples: "http://foo.com/media/", "/media/".
68ADMIN_MEDIA_PREFIX = '/admin-media/'
69
70# Make this unique, and don't share it with anybody.
71SECRET_KEY = 'w_#0r2hh)=!zbynb*gg&969@)sy#^-^ia3m*+sd4@lst$zyaxu'
72
73# List of callables that know how to import templates from various sources.
74TEMPLATE_LOADERS = (
75 'django.template.loaders.filesystem.load_template_source',
76 'django.template.loaders.app_directories.load_template_source',
77# 'django.template.loaders.eggs.load_template_source',
78)
79
80MIDDLEWARE_CLASSES = (
81 'django.middleware.common.CommonMiddleware',
82 'django.contrib.sessions.middleware.SessionMiddleware',
83 'django.contrib.auth.middleware.AuthenticationMiddleware',
84)
85
86ROOT_URLCONF = 'urls'
87
88TEMPLATE_CONTEXT_PROCESSORS = (
89 "django.core.context_processors.auth",
90 "django.core.context_processors.debug",
91 "django.core.context_processors.i18n",
92 "django.core.context_processors.media",
93 "django.core.context_processors.request",
94)
95
96TEMPLATE_DIRS = (
97 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
98 # Always use forward slashes, even on Windows.
99 # Don't forget to use absolute paths, not relative paths.
100 os.path.join(os.path.dirname(__file__), "templates"),
101)
102
103INSTALLED_APPS = (
104 'django.contrib.auth',
105 'django.contrib.contenttypes',
106 'django.contrib.sessions',
107 'django.contrib.sites',
108 'django.contrib.admin',
109 'django.contrib.markup',
110 'django.contrib.admindocs',
111 'registration',
112 'djangopypi',
113)