Permalink
Browse files

static files

  • Loading branch information...
1 parent fe7491c commit 0c1d2900d535ee57094bbb3a5f23bc54bd9ec2af @watchcat committed Mar 13, 2012
Showing with 11 additions and 1 deletion.
  1. +2 −1 settings.py
  2. +9 −0 urls.py
View
@@ -51,7 +51,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_URL = '/static_media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
@@ -73,6 +73,7 @@
# 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
View
@@ -1,5 +1,7 @@
from django.conf.urls.defaults import patterns, include, url
from geoapp.views import main, ajaxmap
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
@@ -17,4 +19,11 @@
# url(r'^admin/', include(admin.site.urls)),
(r'^$', main),
(r'^ajaxmap/(?P<location>.+)/$', ajaxmap),
+
)
+
+urlpatterns += patterns('django.views.static',
+ (r'^static_media/(?P<path>.*)$',
+ 'serve', {
+ 'document_root': '/home/watchcat/work/geocoding/geoproj/geoapp/static',
+ 'show_indexes': True }),)

0 comments on commit 0c1d290

Please sign in to comment.