Friday, March 16, 2012

Re: css w/ django

here is my config that works fine so far may help you

#settings.py
from os.path import abspath

ROOT_PATH = abspath(dirname(__file__))

MEDIA_ROOT = ROOT_PATH + '/../media/'
#remember to end this with a trailing slash that you forgot in your settings

STATIC_ROOT = ROOT_PATH + '/../static/'
STATIC_URL = '/static/'

ADMIN_MEDIA_PREFIX = '/static/admin/'

STATICFILES_DIRS = (
    
#   but any folders that may hold static files like css of js you may use in your project
    ('bootstrap', ROOT_PATH + '/bootstrap/'), 
    #so u can refer to static files in templat using ie <a href="{{ STATIC_URL}}bootstrap/css/bootsrap.css">
)

and I don't use the 

if settings.DEBUG:
   urlpatterns += patterns('',
       (r'^media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root':     settings.MEDIA_ROOT}),
   )

although every thing works for me without it

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate