Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

static files are working now

  • Loading branch information...
commit 36052d8c85eee7a4ddfbe1cf75231719e5b77ce8 1 parent 36ef20b
@zalun zalun authored
Showing with 17 additions and 1 deletion.
  1. +2 −0  flightdeck/settings_local-default.py
  2. +15 −1 flightdeck/urls.py
View
2  flightdeck/settings_local-default.py
@@ -31,6 +31,8 @@
INTERNAL_IPS = ('127.0.0.1',)
MEDIA_ROOT = os.path.join(FRAMEWORK_PATH, 'flightdeck/media/')
+MEDIA_PREFIX = os.path.join(FRAMEWORK_PATH, 'flightdeck/')
+MEDIA_SUFFIX = 'media'
#ADMIN_MEDIA_ROOT = os.path.join(FRAMEWORK_PATH,
# 'flightdeck/adminmedia/')
View
16 flightdeck/urls.py
@@ -1,4 +1,6 @@
-from django.conf.urls.defaults import url, patterns, include
+import os
+
+from django.conf.urls.defaults import *
from django.views import static
from django.conf import settings
from django.contrib import admin
@@ -24,6 +26,18 @@
urls.extend([
# static files
# this should be used only in development server
+ url(r'^media/jetpack/(?P<path>.*)$', static.serve,
+ {'document_root': os.path.join(
+ settings.MEDIA_PREFIX, 'jetpack', settings.MEDIA_SUFFIX)
+ }, name='jetpack_media'),
+ url(r'^media/api/(?P<path>.*)$', static.serve,
+ {'document_root': os.path.join(
+ settings.MEDIA_PREFIX, 'api', settings.MEDIA_SUFFIX)
+ }, name='api_media'),
+ url(r'^media/tutorial/(?P<path>.*)$', static.serve,
+ {'document_root': os.path.join(
+ settings.MEDIA_PREFIX, 'tutorial', settings.MEDIA_SUFFIX)
+ }, name='tutorial_media'),
url(r'^media/(?P<path>.*)$', static.serve,
{'document_root': settings.MEDIA_ROOT}, name='media'),
Please sign in to comment.
Something went wrong with that request. Please try again.