Permalink
Browse files

Fixed merge conflict in TODO.md

  • Loading branch information...
2 parents eedbce7 + db10c5e commit 9512c7c6e34626535195557d2b838b3c3709ec8e @elimisteve elimisteve committed May 21, 2012
View
@@ -1,3 +0,0 @@
-*~
-*.swp
-*.pyc
View
@@ -1,6 +1,9 @@
-## Authors
+# Original Authors
- Steve Phillips / elimisteve / steve@builtbyptm.com
- AJ Bahnken / ajvb / aj@builtbyptm.com
+* Steve Phillips / elimisteve / steve@builtbyptm.com
+* AJ Bahnken / ajvb / aj@builtbyptm.com
+
+# Other Contributors
+* (none yet!)
Sponsored by PTM Web Engineering, LLC in Santa Barbara, California
View
@@ -1,7 +1,11 @@
Credits and Attributions
========================
-* Django
-* Python
-* HTML5 Boilerplate (html5boilerplate.com)
-* Many others
+* Django <http://djangoproject.com>
+* HTML5 Boilerplate <http://html5boilerplate.com>
+* Twitter Bootstrap <http://twitter.github.com>
+* Zurb's Foundation <http://foundation.zurb.com>
+
+Django Project Builder is in no way endorsed by the Django Software
+Foundation or... anyone else, actually, except (PTM Web
+Engineering)[http://builtbyptm.com].
View
@@ -1,43 +1,62 @@
-ProtoType Magic's Django Project Builder
-========================================
+PTM Web Engineering's Django Project Builder
+============================================
-## Server Usage
+## Intro
-After cloning this repo, `cd` into it and run
+Django Project Builder is the fastest, easiest way to, well... build a
+new Django project!
- bash gitbuilder.sh /path/to/new_project
-to create the "top-level" directory, bare git repo, and empty
-${PROJECT_NAME}_site directory for the soon-to-exist Django project.
-Follow the instructions provided, which include using apachebuilder.sh
-to generate your project's Apache config.
+## Features
+* Create a new Django project, git repo, virtualenv, and Django app
+ with sane defaults _all_ with a single command
-## Dev Box Usage
+* Prepare your server to be deployed to with a couple more commands
-After cloning this repo, `cd` into it and run
+* Auto-deploy your shiny new Django app to your server with a simple
+ `git push`! (Uses git hooks behind the scenes... but you don't need
+ to worry about that, do you?)
+
+
+## Non-features
+
+* Tediously editing config files before anything works, even though
+ you use the same defaults every single time
- python djangobuilder.py --path new_project
+* Being forced to copy/paste/edit the same content over and over from
+ old `settings.py` files
-to create the /path/to/new_project/new_project_site directory, which
-contains lots of Django boilerplate -- common imports, virtualenv
-creation + the Django apps/Python modules we always install (Django,
-South, Celery, django-cms, etc), and even HTML5 Boilerplate.
+* Spending too much time configurationating, and not enough time
+ coding
-## TODO
+## Usage
-* post-receive: Run Postgres migrations
+### Dev Box Usage
-* Database rollbacks: create timestamped SQL dump before migrations, then rollback with a post-receive commit?
+After cloning this repo, `cd` into it and run
+
+ python djangobuilder.py --path /path/to/newproject [--bootstrap]
-* Code rollbacks: use Fabric? Or is `git revert master~2..master` good enough?
+to create the /path/to/newproject_site directory, which contains
+_tons_ of Django boilerplate -- common imports, virtualenv creation,
+new git repo, and more!
+If you add the `--bootstrap` argument, your project will come with all
+needed bootstrap defaults. In `media/css/style.css` you will find lots
+more goodies :-).
-## SBHX Presentation-inspired TODO
+git, virtualenv, virtualenvwrapper, and bash are required.
-* djangobuilder.py: When running first migration on newly-created project (on user's dev box), use http://www.arthurkoziel.com/2008/09/04/automatical-superuser-creation-django to automate superuser creation
-* Create postgresbuilder.sh for automatic Postgres user creation, credentials included
+### Server Usage
-* Create route53builder.py to automatically create new subdomain [NOTE: I'll use the script Jay wrote for Cazooz]
+After cloning this repo, `cd` into it and run
+
+ bash gitbuilder.sh /path/to/new_project
+
+to create the "top-level" directory, bare git repo, and empty
+${PROJECT_NAME}_site directory for the soon-to-exist Django project.
+Follow the instructions provided, which include using `apachebuilder.sh`
+to generate your project's Apache config.
View
28 TODO.md
@@ -1,24 +1,30 @@
-## TODO
+# TODO
- Write README
-- Write Credits
- Write Quick Start docs
-- Make it so everything can be relative rather than absolute
-- Add '--domain' argparse flag
-- Replace 'prototypemagic.com' in server-scripts/proto-new-virtualhost-subdomain.py with result of --domain
- Use stdin/out/err pipes to show output during `pip install -r requirements.txt`
- Fix `cpvirtualenv` bug in `virtualenvwrapper.sh` or create our own replacement
-- Server should use something like `lynx -dump checkip.dyndns.org 2>&1 | awk '{print $4}' | grep ^[0-9]` in place of the generic `my-django-powerde-site.com`
+- Ensure the existence of all programs used
+ - E.g., pip, virtualenv, virtualenvwrapper, bash, git
+- Create and use the `dpb-default` virtualenv
+- Add `python manage.py migrate` to server's git hooks
+- Server should use something like `lynx -dump checkip.dyndns.org 2>&1 | awk '{print $4}' | grep ^[0-9]` in place of the generic `my-django-powered-site.com`
+
-## Final Stuff
+# TODO once we have made more improvements
- Use distutils to make a setup.py
- Get onto PyPI
-## Completed
+
+# POSSIBLE TODO's
+- Re-write server scripts using argparse
+- Combine the server scripts into one program
+
+
+# Completed
- Add Bootstrap and Non-Bootstrap options
+- Make it so everything can be relative rather than absolute
- Make more files generic
- Clean up files
- Organize folders
- Write Contributors
-
-## Possible TODO
-- Take out '_site'
+- Write Credits
@@ -1,8 +1,8 @@
from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout
-urlpatterns = patterns('%(PROJECT_NAME)s.views',
-# url(r'^$', 'dashboard', name='index'),
+urlpatterns = patterns('%(APP_NAME)s.views',
+ url(r'^$', 'index', name='index'),
url(r'^login/$', login, kwargs=dict(template_name='login.html'),
name='login'),
url(r'^logout/$', logout, kwargs=dict(next_page='/'),
@@ -1,9 +1,8 @@
-#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "%(PROJECT_NAME)s.settings")
from django.core.management import execute_from_command_line
@@ -4,6 +4,6 @@ from django.contrib import admin
from django import forms
from tagging.fields import TagField
-from %(PROJECT_NAME)s.models import *
+from %(APP_NAME)s.models import *
import datetime, os
@@ -1,7 +1,7 @@
# Django settings for %(PROJECT_NAME)s project.
import os
-PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
+PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
DEBUG = False
@@ -31,7 +31,9 @@ DATABASES = {
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
-TIME_ZONE = 'America/Los_Angeles'
+### Set to None so that Django will use the same timezone as the os. This is
+### specific to Unix based-systems. Read above ^
+TIME_ZONE = None
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
@@ -41,7 +43,7 @@ SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
-#USE_I18N = True
+USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
@@ -66,11 +68,6 @@ STATIC_ROOT = os.path.join(PROJECT_PATH, "static/")
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
-# URL prefix for admin static files -- CSS, JavaScript and images.
-# Make sure to use a trailing slash.
-# Examples: "http://foo.com/static/admin/", "/static/admin/".
-ADMIN_MEDIA_PREFIX = '/static/admin/'
-
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
@@ -102,22 +99,13 @@ MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
+ # Uncomment the next line for simple clickjacking protection:
+ # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
-TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.core.context_processors.auth',
- 'django.core.context_processors.debug',
- 'django.core.context_processors.i18n',
- 'django.core.context_processors.media',
- 'django.core.context_processors.request',
- 'django.core.context_processors.static',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
-)
-
+ROOT_URLCONF = '%(PROJECT_NAME)s.urls'
-
-ROOT_URLCONF = '%(PROJECT_NAME)s_site.urls'
+WSGI_APPLICATION = '%(PROJECT_NAME)s.wsgi.application'
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates/'),
@@ -156,9 +144,15 @@ INSTALLED_APPS = (
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
'handlers': {
'mail_admins': {
'level': 'ERROR',
+ 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
@@ -30,7 +30,4 @@ DATABASES = {
}
}
-
-TIME_ZONE = 'Canada/Eastern'
-
INTERNAL_IPS = ('127.0.0.1', )
@@ -12,7 +12,7 @@ urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
#App url include
- url(r'^', include('%(PROJECT_NAME)s.appurls')),
+ url(r'^', include('%(PROJECT_NAME)s_app.appurls')),
#url(r'^%(PROJECT_NAME)s/$', include('%(PROJECT_NAME)s.appurls')),
#Static Links
@@ -11,15 +11,8 @@ from django.shortcuts import render_to_response, get_object_or_404, render
from django.template import loader, RequestContext
from django.views.decorators.csrf import csrf_exempt
-from %(PROJECT_NAME)s_site.%(PROJECT_NAME)s.models import *
-from %(PROJECT_NAME)s_site.%(PROJECT_NAME)s.model_forms import *
-
-
-
-
-
-
-
-
-
+from %(APP_NAME)s.models import *
+from %(APP_NAME)s.model_forms import *
+def index(request):
+ return render(request, "index.html", locals())
@@ -1,5 +1,5 @@
"""
-WSGI config for django14 project.
+WSGI config for %(PROJECT_NAME)s project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
@@ -15,7 +15,7 @@ framework.
"""
import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django14.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "%(PROJECT_NAME)s.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
Oops, something went wrong.

0 comments on commit 9512c7c

Please sign in to comment.