Permalink
Browse files

Upgraded to Django 1.4 and moved some things around. More modificatio…

…ns to come in regards to a good default set of django apps for testing, security, and other fun topics.
  • Loading branch information...
1 parent acae36b commit a623f0eb94a3fc16fa29487782becbdaec2dba9e @zgohr committed Apr 20, 2012
View
@@ -1,3 +1,4 @@
*.swp
*.pyc
mycms.db
+local.py
View
@@ -3,7 +3,11 @@ Use virtualenvwrapper to keep your python environments isolated.
http://www.doughellmann.com/projects/virtualenvwrapper/
-This is a sample project of Django-CMS with Django 1.3.1
+This is a sample project of Django-CMS with Django 1.4
+It makes a mighty assumption that the closest implementation of
+Django-CMS being compatible with Django version 1.4 is
+
+https://github.com/tback/django-cms/tree/django_1.4_compatibility/here_be_dragons
Once you are in an isolated python environment
View
No changes.
View
@@ -0,0 +1,8 @@
+
+from .base import *
+try:
+ from .local import *
+except ImportError, exc:
+ exc.args = tuple(
+ ['%s (did you rename settings/local-dist.py?)' % exc.args[0]])
+ raise exc
@@ -1,9 +1,9 @@
-# -*- coding: utf-8 -*-
+
import os
gettext = lambda s: s
-PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
+PROJECT_DIR = os.path.abspath(os.path.dirname(__file__) + "../../")
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -53,11 +53,6 @@
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
-# Use this directory to store common static files
-STATICFILES_DIRS = (
- os.path.join(PROJECT_DIR, 'common'),
-)
-
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
@@ -71,7 +66,7 @@
ADMIN_MEDIA_PREFIX = '/static/admin/'
# Make this unique, and don't share it with anybody.
-SECRET_KEY = '0r6%7gip5tmez*vygfv+u14h@4lbt^8e2^26o#5_f_#b7%cm)u'
+SECRET_KEY = '4kf4k4f$K$%98f94fkj9((Kf49I(F$9F949fkfkf)*'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
@@ -104,7 +99,7 @@
('example.html', 'Example Template'),
)
-ROOT_URLCONF = 'urls'
+ROOT_URLCONF = 'app.urls'
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, 'templates'),
@@ -130,3 +125,5 @@
'cms.plugins.googlemap',
'sekizai',
)
+
+WSGI_APPLICATION = 'app.wsgi.application'
No changes.
View
@@ -1,17 +1,33 @@
-from django.conf.urls.defaults import *
-from django.contrib import admin
-from django.conf import settings
+from django.conf import settings
+from django.conf.urls.defaults import include, patterns
+#from session_csrf import anonymous_csrf
+from django.contrib import admin
admin.autodiscover()
+# django-session-csrf monkeypatcher
+#import session_csrf
+#session_csrf.monkeypatch()
+
+
+def bad(request):
+ """ Simulates a server error """
+ 1 / 0
+
urlpatterns = patterns('',
- url(r'^admin/', include(admin.site.urls)),
- url(r'^', include('cms.urls')),
+ (r'', include('cms.urls')),
+ (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+ #(r'^admin/$', anonymous_csrf(admin.site.admin_view(admin.site.index))),
+ (r'^admin/', include(admin.site.urls)),
+ #url(r'^', include('debug_toolbar_user_panel.urls')),
+ (r'^bad/$', bad),
)
+## In DEBUG mode, serve media files through Django.
if settings.DEBUG:
- urlpatterns = patterns('',
- url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
- url(r'', include('django.contrib.staticfiles.urls')),
- ) + urlpatterns
+ # Remove leading and trailing slashes so the regex matches.
+ media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
+ urlpatterns += patterns('',
+ (r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
+ {'document_root': settings.MEDIA_ROOT}),
+ )
View
@@ -0,0 +1,28 @@
+"""
+WSGI config for app 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
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.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
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)
@@ -3,7 +3,7 @@
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
from django.core.management import execute_from_command_line
View
@@ -1,9 +1,25 @@
-Django==1.3.1
+Django==1.4
PIL==1.1.7
-South==0.7.3
+South==0.7.4
django-classy-tags==0.3.4.1
-django-cms==2.2
-django-mptt==0.5.2
+
+# The key to this whole project until Django-CMS releases for the Django 1.4 upgrade
+git+git://github.com/tback/django-cms.git@django_1.4_compatibility/here_be_dragons#egg=django-cms
+
+django-mptt==0.5.1
django-sekizai==0.5
html5lib==0.95
wsgiref==0.1.2
+Django==1.4
+Jinja2==2.6
+PIL==1.1.7
+Pygments==1.5
+South==0.7.4
+Sphinx==1.1.3
+django-classy-tags==0.3.4.1
+django-cms==2.2.post0
+django-mptt==0.5.1
+django-sekizai==0.5
+docutils==0.8.1
+html5lib==0.95
+wsgiref==0.1.2

0 comments on commit a623f0e

Please sign in to comment.