mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Switch to using staticfiles app for serving, well, static files
This is required by the new admin interface
This commit is contained in:
@ -41,11 +41,11 @@ MEDIA_ROOT = ''
|
|||||||
# trailing slash if there is a path component (optional in other cases).
|
# trailing slash if there is a path component (optional in other cases).
|
||||||
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
||||||
MEDIA_URL = ''
|
MEDIA_URL = ''
|
||||||
|
STATIC_URL = '/media/'
|
||||||
|
|
||||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
STATICFILES_DIRS = (
|
||||||
# trailing slash.
|
'../media/',
|
||||||
# Examples: "http://foo.com/media/", "/media/".
|
)
|
||||||
ADMIN_MEDIA_PREFIX = '/adminmedia/'
|
|
||||||
|
|
||||||
# Make this unique, and don't share it with anybody.
|
# Make this unique, and don't share it with anybody.
|
||||||
SECRET_KEY = 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
|
SECRET_KEY = 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
|
||||||
@ -94,6 +94,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.markup',
|
'django.contrib.markup',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
'pgweb.core',
|
'pgweb.core',
|
||||||
'pgweb.account',
|
'pgweb.account',
|
||||||
'pgweb.news',
|
'pgweb.news',
|
||||||
|
@ -135,9 +135,6 @@ urlpatterns = patterns('',
|
|||||||
(r'^admin/', include(admin.site.urls)),
|
(r'^admin/', include(admin.site.urls)),
|
||||||
|
|
||||||
# This should not happen in production - serve by the webserver natively!
|
# This should not happen in production - serve by the webserver natively!
|
||||||
url(r'^media/(.*)$', 'django.views.static.serve', {
|
|
||||||
'document_root': '../media',
|
|
||||||
}),
|
|
||||||
url(r'^(favicon.ico)$', 'django.views.static.serve', {
|
url(r'^(favicon.ico)$', 'django.views.static.serve', {
|
||||||
'document_root': '../media',
|
'document_root': '../media',
|
||||||
}),
|
}),
|
||||||
|
Reference in New Issue
Block a user