Merge lp:~james-w/udd/djangoify into lp:~james-w/udd/trunk

Proposed by James Westby
Status: Merged
Merged at revision: 570
Proposed branch: lp:~james-w/udd/djangoify
Merge into: lp:~james-w/udd/trunk
Diff against target: 192 lines (+176/-0)
3 files modified
django_project/manage.py (+14/-0)
django_project/settings.py (+145/-0)
django_project/urls.py (+17/-0)
To merge this branch: bzr merge lp:~james-w/udd/djangoify
Reviewer Review Type Date Requested Status
James Westby Pending
Review via email: mp+85720@code.launchpad.net

Description of the change

Hi,

Here's a small branch to add a django project to the codebase. It shouldn't
change any behaviour, it will just be useful later on.

Thanks,

James

To post a comment you must log in.
lp:~james-w/udd/djangoify updated
556. By James Westby

Make manage.py executable.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'django_project'
2=== added file 'django_project/__init__.py'
3=== added file 'django_project/manage.py'
4--- django_project/manage.py 1970-01-01 00:00:00 +0000
5+++ django_project/manage.py 2011-12-14 18:43:25 +0000
6@@ -0,0 +1,14 @@
7+#!/usr/bin/env python
8+from django.core.management import execute_manager
9+import imp
10+try:
11+ imp.find_module('settings') # Assumed to be in the same directory.
12+except ImportError:
13+ import sys
14+ 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__)
15+ sys.exit(1)
16+
17+import settings
18+
19+if __name__ == "__main__":
20+ execute_manager(settings)
21
22=== added file 'django_project/settings.py'
23--- django_project/settings.py 1970-01-01 00:00:00 +0000
24+++ django_project/settings.py 2011-12-14 18:43:25 +0000
25@@ -0,0 +1,145 @@
26+# Django settings for django_project project.
27+
28+DEBUG = True
29+TEMPLATE_DEBUG = DEBUG
30+
31+ADMINS = (
32+ # ('Your Name', 'your_email@example.com'),
33+)
34+
35+MANAGERS = ADMINS
36+
37+DATABASES = {
38+ 'default': {
39+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
40+ 'NAME': 'udd.db', # Or path to database file if using sqlite3.
41+ 'USER': '', # Not used with sqlite3.
42+ 'PASSWORD': '', # Not used with sqlite3.
43+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
44+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
45+ }
46+}
47+
48+# Local time zone for this installation. Choices can be found here:
49+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
50+# although not all choices may be available on all operating systems.
51+# On Unix systems, a value of None will cause Django to use the same
52+# timezone as the operating system.
53+# If running in a Windows environment this must be set to the same as your
54+# system time zone.
55+TIME_ZONE = None
56+
57+# Language code for this installation. All choices can be found here:
58+# http://www.i18nguy.com/unicode/language-identifiers.html
59+LANGUAGE_CODE = 'en-us'
60+
61+SITE_ID = 1
62+
63+# If you set this to False, Django will make some optimizations so as not
64+# to load the internationalization machinery.
65+USE_I18N = False
66+
67+# If you set this to False, Django will not format dates, numbers and
68+# calendars according to the current locale
69+USE_L10N = True
70+
71+# Absolute filesystem path to the directory that will hold user-uploaded files.
72+# Example: "/home/media/media.lawrence.com/media/"
73+MEDIA_ROOT = ''
74+
75+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
76+# trailing slash.
77+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
78+MEDIA_URL = ''
79+
80+# Absolute path to the directory static files should be collected to.
81+# Don't put anything in this directory yourself; store your static files
82+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
83+# Example: "/home/media/media.lawrence.com/static/"
84+STATIC_ROOT = ''
85+
86+# URL prefix for static files.
87+# Example: "http://media.lawrence.com/static/"
88+STATIC_URL = '/static/'
89+
90+# URL prefix for admin static files -- CSS, JavaScript and images.
91+# Make sure to use a trailing slash.
92+# Examples: "http://foo.com/static/admin/", "/static/admin/".
93+ADMIN_MEDIA_PREFIX = '/static/admin/'
94+
95+# Additional locations of static files
96+STATICFILES_DIRS = (
97+ # Put strings here, like "/home/html/static" or "C:/www/django/static".
98+ # Always use forward slashes, even on Windows.
99+ # Don't forget to use absolute paths, not relative paths.
100+)
101+
102+# List of finder classes that know how to find static files in
103+# various locations.
104+STATICFILES_FINDERS = (
105+ 'django.contrib.staticfiles.finders.FileSystemFinder',
106+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
107+# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
108+)
109+
110+# Make this unique, and don't share it with anybody.
111+SECRET_KEY = '!+#*=qhaxkm6qs*+a7ur**_+c+@d=1@*9il^f6t6a2*zh8-a-w'
112+
113+# List of callables that know how to import templates from various sources.
114+TEMPLATE_LOADERS = (
115+ 'django.template.loaders.filesystem.Loader',
116+ 'django.template.loaders.app_directories.Loader',
117+# 'django.template.loaders.eggs.Loader',
118+)
119+
120+MIDDLEWARE_CLASSES = (
121+ 'django.middleware.common.CommonMiddleware',
122+ 'django.contrib.sessions.middleware.SessionMiddleware',
123+ 'django.middleware.csrf.CsrfViewMiddleware',
124+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
125+ 'django.contrib.messages.middleware.MessageMiddleware',
126+)
127+
128+ROOT_URLCONF = 'django_project.urls'
129+
130+TEMPLATE_DIRS = (
131+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
132+ # Always use forward slashes, even on Windows.
133+ # Don't forget to use absolute paths, not relative paths.
134+)
135+
136+INSTALLED_APPS = (
137+ 'django.contrib.auth',
138+ 'django.contrib.contenttypes',
139+ 'django.contrib.sessions',
140+ 'django.contrib.sites',
141+ 'django.contrib.messages',
142+ 'django.contrib.staticfiles',
143+ # Uncomment the next line to enable the admin:
144+ # 'django.contrib.admin',
145+ # Uncomment the next line to enable admin documentation:
146+ # 'django.contrib.admindocs',
147+)
148+
149+# A sample logging configuration. The only tangible logging
150+# performed by this configuration is to send an email to
151+# the site admins on every HTTP 500 error.
152+# See http://docs.djangoproject.com/en/dev/topics/logging for
153+# more details on how to customize your logging configuration.
154+LOGGING = {
155+ 'version': 1,
156+ 'disable_existing_loggers': False,
157+ 'handlers': {
158+ 'mail_admins': {
159+ 'level': 'ERROR',
160+ 'class': 'django.utils.log.AdminEmailHandler'
161+ }
162+ },
163+ 'loggers': {
164+ 'django.request': {
165+ 'handlers': ['mail_admins'],
166+ 'level': 'ERROR',
167+ 'propagate': True,
168+ },
169+ }
170+}
171
172=== added file 'django_project/urls.py'
173--- django_project/urls.py 1970-01-01 00:00:00 +0000
174+++ django_project/urls.py 2011-12-14 18:43:25 +0000
175@@ -0,0 +1,17 @@
176+from django.conf.urls.defaults import patterns, include, url
177+
178+# Uncomment the next two lines to enable the admin:
179+# from django.contrib import admin
180+# admin.autodiscover()
181+
182+urlpatterns = patterns('',
183+ # Examples:
184+ # url(r'^$', 'django_project.views.home', name='home'),
185+ # url(r'^django_project/', include('django_project.foo.urls')),
186+
187+ # Uncomment the admin/doc line below to enable admin documentation:
188+ # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
189+
190+ # Uncomment the next line to enable the admin:
191+ # url(r'^admin/', include(admin.site.urls)),
192+)

Subscribers

People subscribed via source and target branches

to all changes: