Permalink
Browse files

Add an example project

  • Loading branch information...
1 parent 7b8b7bb commit 076272721510430d716f1c9f870070aa39d82b4d @stephenmcd committed Feb 25, 2012
View
@@ -1,8 +1,12 @@
syntax: glob
*.pyc
*.pyo
-dist/*
+*.db
+.DS_Store
+.coverage
+local_settings.py
build/*
-django_forms_builder.egg-info/*
-MANIFEST
+dist/*
+*.egg-info/*
+example_project/static
No changes.
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+import imp
+try:
+ imp.find_module('settings') # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ 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" % __file__)
+ sys.exit(1)
+
+import settings
+
+if __name__ == "__main__":
+ execute_manager(settings)
@@ -0,0 +1,57 @@
+
+
+import os
+
+DEBUG = False
+PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
+PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
+STATIC_URL = "/static/"
+STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/"))
+MEDIA_URL = STATIC_URL + "media/"
+MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))
+ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/"
+ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME
+TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)
+SECRET_KEY = ""
+ADMINS = ()
+MANAGERS = ADMINS
+LOGIN_URL = "/admin/"
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'dev.db',
+ }
+}
+
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.staticfiles',
+ 'forms_builder.forms',
+)
+
+try:
+ from local_settings import *
+except ImportError:
+ pass
+
+TEMPLATE_DEBUG = DEBUG
+
+if not SECRET_KEY:
+ raise Exception("Please set the value for SECRET_KEY")
@@ -0,0 +1,10 @@
+from django.conf.urls.defaults import patterns, include, url
+import forms_builder.forms.urls # add this import
+
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^forms/', include(forms_builder.forms.urls)),
+)

0 comments on commit 0762727

Please sign in to comment.