Permalink
Browse files

Working on better settings

  • Loading branch information...
1 parent c6d483f commit 0174a800e0e2ea6521c6138c0706032a90ce6b18 @emperorcezar committed Dec 23, 2011
Showing with 41 additions and 10 deletions.
  1. +12 −6 README.markdown
  2. +1 −1 settings/common.py
  3. +28 −0 settings/production.py
  4. +0 −3 urls.py
View
18 README.markdown
@@ -6,24 +6,30 @@ Django-bootstrap is a empty base project to use with Django. It includes [twitte
Installation
------------
-Create a virtual enviroment for your project. By default, the settings assume the virtualenv is the parent directory of the project.
+1. Create a virtual enviroment for your project. By default, the settings assume the virtualenv is the parent directory of the project.
`virtualenv --no-site-packages my_project`
-Go into your virtualenv
+2. Go into your virtualenv
`cd my_project`
-Now clone the repo with `git clone git://github.com/emperorcezar/Django-bootstrap.git my_project`.
+3. Now clone the repo with `git clone git://github.com/emperorcezar/Django-bootstrap.git my_project`.
Your project should be in `my_project/my_project`
-In the virtualenv directory create you static directory
+4. In the virtualenv directory create you static directory
`mkdir static`
-Go into the directory when you cloned Django-bootstrap and remove the remote
+5. Go into the directory when you cloned Django-bootstrap and remove the remote
`git remote rm origin`
-Now you can add your own origin.
+Now you can add your own origin.
+
+6. Edit local_settings.py.example and add admins, site_id, secret_key and whatever else you want not included in your repo.
+
+7. Now edit settings/production.py to setup your production database and whatever else is unique to your production environment. Same for settings/development.py, but it's defaults should be suitable for most local development.
+
+8.
View
2 settings/common.py
@@ -78,7 +78,7 @@
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
-ROOT_URLCONF = "temp.urls"
+ROOT_URLCONF = "urls"
TEMPLATE_DIRS = [
os.path.join(PROJECT_ROOT, "templates"),
View
28 settings/production.py
@@ -0,0 +1,28 @@
+'''
+Put your production settings here.
+The idea is to set your settings to settings.production in production.
+This allows you to overwrite anything in common.py
+'''
+import os
+from common import *
+
+DEBUG = False
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+ "default": {
+ "ENGINE": "", # Add "postgresql_psycopg2", "postgresql", "mysql", "sqlite3" or "oracle".
+ "NAME": "", # 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.
+ "PORT": "", # Set to empty string for default. Not used with sqlite3.
+ }
+}
+
+# local_settings.py can be used to override environment-specific settings
+# like database and email that differ between development and production.
+try:
+ from local_settings import *
+except ImportError:
+ pass
View
3 urls.py
@@ -6,9 +6,6 @@
admin.autodiscover()
-handler500 = "pinax.views.server_error"
-
-
urlpatterns = patterns("",
url(r"^$", direct_to_template, {
"template": "homepage.html",

0 comments on commit 0174a80

Please sign in to comment.