Skip to content

Commit

Permalink
Now works from django 1.2 to the last version of the git repository F…
Browse files Browse the repository at this point in the history
  • Loading branch information
goinnn committed Sep 2, 2013
1 parent 88c24f9 commit 8861a11
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 47 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Inplace Edit Form
Information
===========

.. figure:: https://travis-ci.org/Yaco-Sistemas/django-inplaceedit.png?branch=master

.. image:: https://badge.fury.io/py/django-inplaceedit.png
:target: https://badge.fury.io/py/django-inplaceedit

Expand Down
1 change: 1 addition & 0 deletions testing/testing/media/inplaceeditform
95 changes: 50 additions & 45 deletions testing/testing/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,7 @@
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = path.join(BASEDIR, 'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
MEDIA_URL = '/my_media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '98qi@6+%3nt__m_o6@o(n8%+!)yjxrl*fcs%l@2g=e-*4fu4h%'
Expand Down Expand Up @@ -142,19 +112,6 @@
'testing.unusual_fields',
'testing.unit_tests',
)
try:
import transmeta
INSTALLED_APPS += ('transmeta',
'testing.inplace_transmeta')
except ImportError:
pass


import django
if django.VERSION[0] >= 1 and django.VERSION[1] >= 3:
INSTALLED_APPS += ('django.contrib.staticfiles',)
if django.VERSION[0] >= 1 and django.VERSION[1] >= 2:
INSTALLED_APPS += ('django.contrib.messages',)


# A sample logging configuration. The only tangible logging
Expand Down Expand Up @@ -185,7 +142,55 @@
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
)

# Custom to the different django versions

try:
import transmeta
INSTALLED_APPS += ('transmeta',
'testing.inplace_transmeta')
except ImportError:
pass

import django

if django.VERSION[0] >= 1 and django.VERSION[1] >= 3:
INSTALLED_APPS += ('django.contrib.staticfiles',)
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = path.join(BASEDIR, 'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)


elif django.VERSION[0] >= 1 and django.VERSION[1] >= 2:
INSTALLED_APPS += ('django.contrib.messages',)
elif django.VERSION[0] >= 1 and django.VERSION[1] >= 1:
TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.static',)
Binary file modified testing/testing/testing.db
Binary file not shown.
5 changes: 3 additions & 2 deletions testing/testing/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def index(request):
url(r'^$', index))

urlpatterns += patterns('',
(r'^media/(?P<path>.*)$',
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}),
)

0 comments on commit 8861a11

Please sign in to comment.