Permalink
Browse files

Upgrade to Django 1.4 & update project structure

  • Loading branch information...
1 parent 2b351ea commit 41370599d5f6cbfe17750e4b5130c63b760fc4bd @robgolding committed Dec 9, 2012
Showing with 21 additions and 18 deletions.
  1. +1 −1 .gitignore
  2. +0 −11 backtrac/manage.py
  3. +6 −4 backtrac/settings/default.py
  4. +2 −0 backtrac/settings/test.py
  5. +1 −1 backtrac/urls.py
  6. +10 −0 manage.py
  7. +1 −1 requirements.txt
View
@@ -1,6 +1,6 @@
*.pyc
backtrac/settings/local.py
backtrac/dev.db
-backtrac/static/admin
+backtrac/staticfiles
*.swp
twisted/plugins/dropin.cache
View
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-from django.core.management import execute_manager
-try:
- import 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(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
- sys.exit(1)
-
-if __name__ == "__main__":
- execute_manager(settings)
@@ -1,6 +1,6 @@
import os
-PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
@@ -56,7 +56,7 @@
# Absolute path to the directory that holds static files.
# Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = os.path.join(PATH, 'static/')
+STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
# URL that handles the static files served from STATIC_ROOT.
# Example: "http://media.lawrence.com/static/"
@@ -68,7 +68,9 @@
ADMIN_MEDIA_PREFIX = '/static/admin/'
# A list of locations of additional static files
-STATICFILES_DIRS = ()
+STATICFILES_DIRS = (
+ os.path.join(PROJECT_ROOT, 'static'),
+)
# List of finder classes that know how to find static files in
# various locations.
@@ -98,7 +100,7 @@
ROOT_URLCONF = 'backtrac.urls'
TEMPLATE_DIRS = (
- os.path.join(PATH, 'templates'),
+ os.path.join(PROJECT_ROOT, 'templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = (
@@ -1,3 +1,5 @@
+ADMINS = () # Django issue #19172
+
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
View
@@ -44,4 +44,4 @@
(r'^404/$', 'django.views.generic.simple.direct_to_template', {
'template': '404.html'
}),
- )
+ ) + staticfiles_urlpatterns()
View
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backtrac.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
View
@@ -1,4 +1,4 @@
-django==1.3
+django>=1.4,<1.5
twisted==10.2.0
pyinotify
-e git+http://github.com/robgolding63/python-magic#egg=magic

0 comments on commit 4137059

Please sign in to comment.