Switch to using staticfiles contrib, update to Django 1.3

This commit is contained in:
2011-05-27 13:44:17 +01:00
parent 2eff40c7df
commit 73fd280e2d
26 changed files with 19 additions and 23 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ app/conf/settingslocal.py
env env
*.pid *.pid
app/conf/brokersettings.py app/conf/brokersettings.py
app/static/

View File

Before

Width:  |  Height:  |  Size: 73 B

After

Width:  |  Height:  |  Size: 73 B

View File

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 434 B

View File

Before

Width:  |  Height:  |  Size: 76 B

After

Width:  |  Height:  |  Size: 76 B

View File

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 435 B

View File

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 78 B

View File

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 440 B

View File

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 80 B

View File

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 442 B

View File

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

View File

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 444 B

View File

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

View File

@@ -37,28 +37,18 @@ SITE_ID = 1
# to load the internationalization machinery. # to load the internationalization machinery.
USE_I18N = True USE_I18N = True
# Absolute path to the directory that holds media. # Defines the Static Media storage as per staticfiles contrib
# Example: "/home/media/media.lawrence.com/" STATIC_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static')
MEDIA_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'media') STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
# 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/"
MEDIA_URL = '/static/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = '8i2+dd-b2tg9g%mq$&i$-8beh4i5^2mm=e-nh^$p47^w=z1igr' SECRET_KEY = '8i2+dd-b2tg9g%mq$&i$-8beh4i5^2mm=e-nh^$p47^w=z1igr'
# List of callables that know how to import templates from various sources. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.load_template_source', 'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.load_template_source',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
@@ -97,6 +87,7 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.humanize', 'django.contrib.humanize',
'django.contrib.staticfiles',
'south', 'south',
'piston', 'piston',
'djcelery', 'djcelery',

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 673 B

View File

@@ -1,10 +1,10 @@
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
from django.contrib import admin from django.contrib import admin
from django.contrib.auth.views import login from django.contrib.auth.views import login
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings from django.conf import settings
from utils import installed from utils import installed
from registration.views import register from registration.views import register
from sso.forms import RegistrationFormUniqueEmailBlocked from sso.forms import RegistrationFormUniqueEmailBlocked
@@ -18,7 +18,6 @@ urlpatterns = patterns('',
(r'^eve/', include('eve_api.urls')), (r'^eve/', include('eve_api.urls')),
(r'^eveapi/', include('eve_proxy.urls')), (r'^eveapi/', include('eve_proxy.urls')),
(r'^api/', include('api.urls')), (r'^api/', include('api.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
) )
if installed('reddit'): if installed('reddit'):
@@ -36,3 +35,5 @@ if installed('groups'):
(r'^groups/', include('groups.urls')), (r'^groups/', include('groups.urls')),
) )
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()

3
fabfile.py vendored
View File

@@ -241,3 +241,6 @@ def clear_logs():
with cd('%(path)s/dreddit-auth/' % env): with cd('%(path)s/dreddit-auth/' % env):
run('rm ./logs/*.log') run('rm ./logs/*.log')
def deploy_static():
with cd('%(path)s/dreddit-auth/' % env):
run('./app/manage.py collectstatic -v0 --noinput')

View File

@@ -1,16 +1,16 @@
MySQL-python MySQL-python
Django==1.2.4 Django==1.3
django-piston==0.2.2 django-piston==0.2.2
-e hg+https://bitbucket.org/ubernostrum/django-registration@d36a38202ee3#egg=django-registration -e hg+https://bitbucket.org/ubernostrum/django-registration@d36a38202ee3#egg=django-registration
yolk==0.4.1 yolk==0.4.1
-e hg+http://bitbucket.org/schinckel/django-jsonfield@acb6b4fd7312#egg=django-jsonfield -e hg+http://bitbucket.org/schinckel/django-jsonfield@acb6b4fd7312#egg=django-jsonfield
xmlrpclib==1.0.1 xmlrpclib==1.0.1
South==0.7.3 South==0.7.3
fabric==1.0.1 fabric
flup flup
django-debug-toolbar==0.8.3 django-debug-toolbar
simplejson simplejson
celery==2.1.2 celery==2.2.6
django-celery==2.1.2 django-celery==2.2.4
-e git+https://github.com/ericflo/django-pagination.git@47e7ec874cd7dddda5ed#egg=django-pagination -e git+https://github.com/ericflo/django-pagination.git@47e7ec874cd7dddda5ed#egg=django-pagination
xmpppy xmpppy