montylounge / django-mingus

a Django blog engine leveraging reusable apps for all its features.
Other
508 stars 96 forks source link

Staticfiles Doesn't Work #60

Closed epicserve closed 13 years ago

epicserve commented 13 years ago

I had to make the following changes in order to get mingus setup and running the first time. These changes should be documented in the install doc and also a change needs to be made to the settings.py file.

I hand to change the following changes to the the settings file.

diff --git a/mingus/settings.py b/mingus/settings.py
index e00e0d7..1d52eab 100644
--- a/mingus/settings.py
+++ b/mingus/settings.py
@@ -7,8 +7,8 @@ MEDIA_URL = '/media/'
 ADMIN_MEDIA_PREFIX = '/admin_media/'

 #staticfiles app values
-STATIC_URL = '/media/mingus/'
-STATIC_ROOT = os.path.join(PROJECT_ROOT, 'media')
+STATIC_URL = '/static/'
+STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
 STATICFILES_DIRS = (
     os.path.join(PROJECT_ROOT, 'media', 'mingus'),
 )

Then I had to make the directory static.

mkdir static

Then I had to run...

$ ./manage.py collectstatic
epicserve commented 13 years ago

Forgot to test the admin site, the admin media didn't work so I had to change the ADMIN_MEDIA_PREFIX setting. So these are the changes needed to the settings.py file.

diff --git a/mingus/settings.py b/mingus/settings.py
index e00e0d7..d590c75 100644
--- a/mingus/settings.py
+++ b/mingus/settings.py
@@ -4,11 +4,11 @@ import os
 PROJECT_ROOT = os.path.dirname(__file__)
 MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
 MEDIA_URL = '/media/'
-ADMIN_MEDIA_PREFIX = '/admin_media/'
+ADMIN_MEDIA_PREFIX = '/static/admin/'

 #staticfiles app values
-STATIC_URL = '/media/mingus/'
-STATIC_ROOT = os.path.join(PROJECT_ROOT, 'media')
+STATIC_URL = '/static/'
+STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
 STATICFILES_DIRS = (
     os.path.join(PROJECT_ROOT, 'media', 'mingus'),
 )
montylounge commented 13 years ago

Thanks. I plan on upgrading mingus to support 1.3 now that it's released.