Saturday, March 26, 2011

Re: Django 1.3 - Question about static files

On 26-03-2011, Sandro Dutra <hexodin@gmail.com> wrote:
>Hello everyone!

>I'm using Python 2.7.x with Django 1.3 and I've some questions about
>the new way to set the static files for the dev server.

>abspath = lambda *p: os.path.abspath(os.path.join(*p))
>PROJECT_ROOT = abspath(os.path.dirname(__file__))
>(...)
>MEDIA_ROOT = abspath(PROJECT_ROOT, 'media')
>MEDIA_URL = '/media/'
>ADMIN_MEDIA_PREFIX = '/media/admin/'

>STATIC_ROOT = abspath(PROJECT_ROOT, 'static')
>STATIC_URL = '/static/'
>STATICFILES_DIRS = (
> abspath(STATIC_ROOT, 'css'),
> abspath(STATIC_ROOT, 'javascript'),
> abspath(STATIC_ROOT, 'images'),
>)
I had a similar problem.
I do not remember, but what I have in my project now
it is commented out STATIC_ROOT.

If I uncomment STATIC_ROOT it do not work.

STATIC_ROOT_FILES = os.path.join(os.path.dirname(__file__),
'static').replace('\\', '/')
#STATIC_ROOT = STATIC_ROOT_FILES
STATICFILES_DIRS = (
STATIC_ROOT_FILES,
)
STATIC_URL = "/static/"

--
Practical politics consists in ignoring facts.
-- Henry Adams

--
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