[extensions-web/django/upgrade-1.8] django: move MEDIA_URL out of STATIC_URL.



commit c8489b4c7a1a59506bfe4a945d30f1dd61ced7df
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Tue Oct 25 23:25:36 2016 +0300

    django: move MEDIA_URL out of STATIC_URL.
    
    This is not works as expected in newer django.

 etc/sweettooth.httpd.conf.example |    4 ++--
 sweettooth/settings.py            |    2 +-
 sweettooth/urls.py                |    5 ++---
 3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/etc/sweettooth.httpd.conf.example b/etc/sweettooth.httpd.conf.example
index 24a8e5b..4f7c0aa 100644
--- a/etc/sweettooth.httpd.conf.example
+++ b/etc/sweettooth.httpd.conf.example
@@ -9,7 +9,7 @@ WSGISocketPrefix /run/wsgi
         WSGIDaemonProcess ego processes=1 threads=10
         WSGIProcessGroup ego
 
-        Alias /static/extension-data/ /home/jstpierre/Source/sweettooth/sweettooth/uploaded-files/
+        Alias /extension-data/ /home/jstpierre/Source/sweettooth/sweettooth/uploaded-files/
         Alias /static/ /home/jstpierre/Source/sweettooth/sweettooth/static/
 </VirtualHost>
 
@@ -21,7 +21,7 @@ WSGISocketPrefix /run/wsgi
         WSGIDaemonProcess ego-tls processes=1 threads=10
         WSGIProcessGroup ego-tls
 
-        Alias /static/extension-data/ /home/jstpierre/Source/sweettooth/sweettooth/uploaded-files/
+        Alias /extension-data/ /home/jstpierre/Source/sweettooth/sweettooth/uploaded-files/
         Alias /static/ /home/jstpierre/Source/sweettooth/sweettooth/static/
 
         SSLEngine on
diff --git a/sweettooth/settings.py b/sweettooth/settings.py
index 5b6024b..0ddec88 100644
--- a/sweettooth/settings.py
+++ b/sweettooth/settings.py
@@ -50,7 +50,7 @@ MEDIA_ROOT = os.path.join(SITE_ROOT, '..', 'uploaded-files')
 # 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 = '/static/extension-data/'
+MEDIA_URL = '/extension-data/'
 
 # Absolute path to the directory static files should be collected to.
 # Don't put anything in this directory yourself; store your static files
diff --git a/sweettooth/urls.py b/sweettooth/urls.py
index aab1fc2..7c44d25 100644
--- a/sweettooth/urls.py
+++ b/sweettooth/urls.py
@@ -26,10 +26,9 @@ urlpatterns = patterns('',
 
 if settings.DEBUG:
     # Use static.serve for development...
-    urlpatterns.append(url(r'^static/extension-data/(?P<path>.*)', static.serve,
+    urlpatterns.append(url(r'^extension-data/(?P<path>.*)', static.serve,
                            dict(document_root=settings.MEDIA_ROOT), name='extension-data'))
-    urlpatterns += static_urls.staticfiles_urlpatterns()
 else:
     # and a dummy to reverse on for production.
-    urlpatterns.append(url(r'^static/extension-data/(?P<path>.*)', lambda *a, **kw: HttpResponse(),
+    urlpatterns.append(url(r'^extension-data/(?P<path>.*)', lambda *a, **kw: HttpResponse(),
                            name='extension-data'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]