Sunday, February 6, 2011

Re: Help on adding CSS to django project

Guys,
Can anyone zipped a working django project which made use of css and
mail it to
me at hackstockpie@gmail.com so that I can study how he went about
doing it?
Thanks in advance.
Best Wishes,
h@ck5t0ck

On Feb 6, 12:36 pm, "h@ck5t0ck" <hackstock...@gmail.com> wrote:
> Ronghui Yu,
> Can you please tell me which middleware you're talking about here?
> I've still not been able to get my css to work.
>
> On Feb 5, 11:29 am, Ronghui Yu <stone...@gmail.com> wrote:
>
> > It seems that you need to setup your web server to support static contents,
> > django has a middleware to do the job, but it is not recommended to use it
> > in product environment. I had this similar problem when I started to learn
> > django.
>
> > On Sat, Feb 5, 2011 at 6:15 AM, Chris Hannam <bassdr...@gmail.com> wrote:
> > > Apologies for that premature send:
>
> > >> Hi,
> > >> The way I have approached this is to have a static dir set in my urls.py:
>
> > > (r'^static/(?P<path>.*)$', 'django.views.static.serve', {
> > >             'document_root': settings.MEDIA_ROOT }
> > >          )
>
> > > settings.py has the following
> > > MEDIA_ROOT = os.path.join(PATH_SITE_ROOT, 'static')
> > > PATH_SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
>
> > > I reference the css files in the html as /static/css/style.css etc
>
> > > The urls.py maps the url to the location on disk of the css files.
>
> > > Can you supply the error messages and some of your config if you are still
> > > having issues?
>
> > > CH
>
> > > --
> > > 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<django-users%2Bunsubscribe@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > ===========================
> > Regards
> > Ronghui Yu

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