Loading CSS

2010-11-30 Thread octopusgrabbus
I am running Django 1.2.3 -- python -c "import django; print
django.get_version()" I basically need to know what logs to look at to
fix a css file not loading.

I am trying to load a css file in my base template




{% block title %}Town of Arlington Water Department AMR
System{% endblock %} 

   

Here's the css file -- you could say it's a "test file".

body{ background-color: gray;}
p { color: blue; }
h3{ color: white; }

In urls.py this is inserted into

urlpatterns = patterns('',

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/home/amr/django'}),

Nothing loaded. Then, I tried setting STATIC_DOC_ROOT = '/home/amr/
django/static_media' in settings.py and in urls.py

from django.conf import settings
...
(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_DOC_ROOT}),

and gotten this error

AttributeError at /

'Settings' object has no attribute 'STATIC_DOC_ROOT'

Thanks for any help or pointers.

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



Re: Loading CSS

2010-11-30 Thread Robert S
Well - that's one way
A simpler way is to use your settings.py file to point to your media,
and remove all reference to .css from your url.py files

...

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/path_to_media_root/static_media/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = '/static_media/'

...

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



Re: Loading CSS

2010-12-01 Thread Tom Evans
On Tue, Nov 30, 2010 at 6:21 PM, octopusgrabbus
 wrote:
> I am running Django 1.2.3 -- python -c "import django; print
> django.get_version()" I basically need to know what logs to look at to
> fix a css file not loading.
>
> I am trying to load a css file in my base template
>
> 
>    
>    
>        {% block title %}Town of Arlington Water Department AMR
> System{% endblock %} 
>        
>   

So you are requesting the file '/static_media/amr.css'

>
> Here's the css file -- you could say it's a "test file".
>
> body{ background-color: gray;}
> p { color: blue; }
> h3{ color: white; }
>
> In urls.py this is inserted into
>
> urlpatterns = patterns('',
>
>    (r'^site_media/(?P.*)$', 'django.views.static.serve',
>        {'document_root': '/home/amr/django'}),
>

and you are enabling file serving from a path starting '/site_media/'
(assuming this is your root urlconf).

Is it clear why it isn't working now? 'site_media' != 'static_media'.

In your django dev console, it shows each URL requested, and the HTTP
return code. It will look something like this:

[01/Dec/2010 09:38:47] "GET /static_media/amr.css HTTP/1.1" 404 2572

The first part ('/static_media/') has to match the URL you put in your
urlconf, and the second part ('amr.css') must exist in the folder that
you specify as document_root (or subfolder etc).

This isn't exactly rocket science, just make everything match up, and it works.

BTW, in your template you can use {{ MEDIA_URL }} to get the prefix to
your media - assuming you have correctly set settings.MEDIA_URL, and
have django.core.context_processors.media in
TEMPLATE_CONTEXT_PROCESSORS and use a RequestContext to render with,
which is a few caveats I guess :)

Cheers

Tom

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



Re: Loading CSS

2010-12-01 Thread octopusgrabbus
Thanks for your comments:

Here are the changes I've made, and it still does not load:

A directory css is under the main media directory

a...@h2oamr:~/django/amr$ ls -l media/css
total 4
-rw-r--r-- 1 amr amr 72 Nov 30 14:45 amr.css


Here are the settings.py changes:

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/home/amr/django/media/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

ROOT_URLCONF = 'amr.urls'
STATIC_DOC_ROOT = '/home/amr/django/media'

And here's the reference to it in the base template.




{% block title %}Town of Arlington Water Department AMR
System{% endblock %} 

   



On Dec 1, 4:51 am, Tom Evans  wrote:
> On Tue, Nov 30, 2010 at 6:21 PM, octopusgrabbus
>
>  wrote:
> > I am running Django 1.2.3 -- python -c "import django; print
> > django.get_version()" I basically need to know what logs to look at to
> > fix a css file not loading.
>
> > I am trying to load a css file in my base template
>
> > 
> >    
> >    
> >        {% block title %}Town of Arlington Water Department AMR
> > System{% endblock %} 
> >        
> >   
>
> So you are requesting the file '/static_media/amr.css'
>
>
>
> > Here's the css file -- you could say it's a "test file".
>
> > body{ background-color: gray;}
> > p { color: blue; }
> > h3{ color: white; }
>
> > In urls.py this is inserted into
>
> > urlpatterns = patterns('',
>
> >    (r'^site_media/(?P.*)$', 'django.views.static.serve',
> >        {'document_root': '/home/amr/django'}),
>
> and you are enabling file serving from a path starting '/site_media/'
> (assuming this is your root urlconf).
>
> Is it clear why it isn't working now? 'site_media' != 'static_media'.
>
> In your django dev console, it shows each URL requested, and the HTTP
> return code. It will look something like this:
>
> [01/Dec/2010 09:38:47] "GET /static_media/amr.css HTTP/1.1" 404 2572
>
> The first part ('/static_media/') has to match the URL you put in your
> urlconf, and the second part ('amr.css') must exist in the folder that
> you specify as document_root (or subfolder etc).
>
> This isn't exactly rocket science, just make everything match up, and it 
> works.
>
> BTW, in your template you can use {{ MEDIA_URL }} to get the prefix to
> your media - assuming you have correctly set settings.MEDIA_URL, and
> have django.core.context_processors.media in
> TEMPLATE_CONTEXT_PROCESSORS and use a RequestContext to render with,
> which is a few caveats I guess :)
>
> Cheers
>
> Tom

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



Re: Loading CSS

2010-12-01 Thread Tom Evans
On Wed, Dec 1, 2010 at 2:48 PM, octopusgrabbus
 wrote:
> Thank you. I've done made changes according to your suggestions, but
> the css appears not to load. I am using apache, not the built-in web
> server.
>

Are you expecting django to serve the file through apache or apache to
directly serve the file?

How have you configured apache?

What is output in apache's access log when you try to access the file?

You really need to provide more information. "It doesn't work" doesn't
really help debug.

Cheers

Tom

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



Re: Loading CSS

2010-12-01 Thread octopusgrabbus
Thank you. I've done made changes according to your suggestions, but
the css appears not to load. I am using apache, not the built-in web
server.

On Nov 30, 5:14 pm, Robert S  wrote:
> Well - that's one way
> A simpler way is to use your settings.py file to point to your media,
> and remove all reference to .css from your url.py files
>
> ...
>
> # Absolute path to the directory that holds media.
> # Example: "/home/media/media.lawrence.com/"
> MEDIA_ROOT = '/path_to_media_root/static_media/'
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use
> a
> # trailing slash if there is a path component (optional in other
> cases).
> # Examples: "http://media.lawrence.com";, "http://example.com/media/";
> MEDIA_URL = '/static_media/'
>
> ...

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



Re: Loading CSS

2010-12-01 Thread Tom Evans
On Wed, Dec 1, 2010 at 3:02 PM, Tom Evans  wrote:
> Are you expecting django to serve the file through apache or apache to
> directly serve the file?
>
> How have you configured apache?
>
> What is output in apache's access log when you try to access the file?
>
> You really need to provide more information. "It doesn't work" doesn't
> really help debug.
>
> Cheers
>
> Tom
>

I don't mean to repeat myself, but you still haven't given any of this
information, so there are diminishing returns to helping you further.
How you have configured apache to serve django affects this issue, and
without the information, I'm just speculating.

Tom

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



Re: Loading CSS

2010-12-01 Thread octopusgrabbus
Your right. I should have looked in the logs, and the directory path
is wrong.

10.100.0.88 - - [01/Dec/2010:10:03:06 -0500] "GET /css/amr.css HTTP/
1.1" 404 228
6 "http://amrserver:8002/"; "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
1.9.2.12)
 Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.6.12"


On Dec 1, 10:02 am, Tom Evans  wrote:
> On Wed, Dec 1, 2010 at 2:48 PM, octopusgrabbus
>
>  wrote:
> > Thank you. I've done made changes according to your suggestions, but
> > the css appears not to load. I am using apache, not the built-in web
> > server.
>
> Are you expecting django to serve the file through apache or apache to
> directly serve the file?
>
> How have you configured apache?
>
> What is output in apache's access log when you try to access the file?
>
> You really need to provide more information. "It doesn't work" doesn't
> really help debug.
>
> Cheers
>
> Tom

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



Re: Loading CSS

2010-12-01 Thread octopusgrabbus
My question is what do I need to do to straighten out the media path,
so I can load amr.css.

When trying to load amr.css, my application gets a 404.
10.100.0.88 - - [01/Dec/2010:10:03:06 -0500] "GET /css/amr.css HTTP/
1.1" 404 228
6 "http://amrserver:8002/"; "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:
1.9.2.12)
 Gecko/20101027 Ubuntu/10.04 (lucid) Firefox/3.6.12"

Here's where amr.css is loaded in base.html




{% block title %}Town of Arlington Water Department AMR
System{% endblock %} 

   

Here are the paths in settings.py

MEDIA_ROOT = '/home/amr/django/amr/'
MEDIA_URL = 'media/'
ADMIN_MEDIA_PREFIX = '/media/'

The path to amr.css is /home/amr/django/amr/media/css

and here is the configuration from apache

Listen 8002

Alias /media /home/amr/django/amr/media

SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
SetEnv PYTHON_EGG_CACHE /tmp/.python_eggs
PythonOption django.root /home/amr/django/amr
PythonPath "['/home/amr/django/amr/bin', '/home/amr/django', '/
home/amr/djan
go/amr', '/home/amr/django/amr/media', '/home/django/amr/media/css'] +
sys.path"
PythonDebug On

Any thoughts or pointers would be appreciated.

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



Re: Loading CSS

2010-12-01 Thread octopusgrabbus
Many thanks to the replies and everyone's patience. I can't see the
9th response to this thread because Google Groups appears to be off
line, but here's what I've done to get amr.css to load:

1) Here is the base template portion that loads the css file:




{% block title %}Town of Arlington Water Department AMR
System{% endblock %} 
http://localhost:
8003/css/amr.css" />
   

2) Here is the apache config file. This is choice appears to be in
line with the Django documentation, because Django recommends not
serving static content from the same document root.

Listen 8003

DocumentRoot "/var/www/amr/media"

Options +Includes


Basically media is a symlink
 media -> /home/amr/django/amr/media

I get a 200 from loading the css file

body{ background-color: blue;}
p { color: blue; }
h3{ color: white; }

I picked blue just so I'd see a drastic change. It's not my final
choice.

My question is why don't I see a change?

Thanks.
cmn


On Dec 1, 10:12 am, Tom Evans  wrote:
> On Wed, Dec 1, 2010 at 3:02 PM, Tom Evans  wrote:
> > Are you expecting django to serve the file through apache or apache to
> > directly serve the file?
>
> > How have you configured apache?
>
> > What is output in apache's access log when you try to access the file?
>
> > You really need to provide more information. "It doesn't work" doesn't
> > really help debug.
>
> > Cheers
>
> > Tom
>
> I don't mean to repeat myself, but you still haven't given any of this
> information, so there are diminishing returns to helping you further.
> How you have configured apache to serve django affects this issue, and
> without the information, I'm just speculating.
>
> Tom

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



Re: Loading CSS

2010-12-01 Thread Mike Dewhirst

On 2/12/2010 1:48am, octopusgrabbus wrote:

Thank you. I've done made changes according to your suggestions, but
the css appears not to load. I am using apache, not the built-in web
server.


Here is my working vhost.conf for my Apache. See the aliases below which 
cause Apache to find the css file and make it available to your Django 
pages.


The AliasMatch entries which are commented out should have worked but I 
didn't have the patience so I used Alias entries instead.


Good luck

Mike




 ServerName http://xxx.xxx:80
 DocumentRoot /srv/www/xxx/htdocs/

 HostnameLookups Off
 UseCanonicalName Off

 ErrorLog /var/log/apache2/xxx_error_log
 CustomLog /var/log/apache2/xxx_access_log combined

 Alias /robots.txt /srv/www/xxx/htdocs/static/robots/robots.txt
 Alias /favicon.ico /srv/www/xxx/htdocs/static/img/favicon.ico

#AliasMatch /([^/]*\.css) /srv/xxx/ccm/htdocs/static/css/$1
#AliasMatch /([^/]*\.js) /srv/xxx/ccm/htdocs/static/js/$1
#AliasMatch (^/.+\.js) /srv/xxx/ccm/htdocs/static/js/$1

 Alias /media/ /srv/www/xxx/htdocs/static/
 Alias /static/ /srv/www/xxx/htdocs/static/
 Alias /tiny_mce/ /srv/www/xxx/htdocs/static/js/tiny_mce/
 Alias /jquery/ /srv/www/xxx/htdocs/static/js/jquery/

# now let the public access anything here
 
  AllowOverride None
  Order allow,deny
  Allow from all
 

 WSGIScriptAlias / /srv/www/xxx/climate/wsgi-bin/xxx.wsgi
 
  Order allow,deny
  Allow from all
 








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



order of loading css-files

2019-07-02 Thread Kai Kobschätzki
Hi:

I tried to load bootstrap and an own css-file. But in which order does
django load it?

I have tried in my base.html:



{% load static %}







{% block title %}gyousei{% endblock title %}


 ... and the log is writing: [02/Jul/2019 11:54:38] "GET /
HTTP/1.1" 200 6259 [02/Jul/2019 11:54:38] "GET /static/css/base.css
HTTP/1.1" 304 0 [02/Jul/2019 11:54:38] "GET
/static/bootstrap/css/site.css HTTP/1.1" 404 1690 [02/Jul/2019 11:54:38]
"GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 1702 [02/Jul/2019
11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
[02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404
1690 and if I write 

{% load static %}








{% block title %}gyousei{% endblock title %}


 ...
the log writes

[02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0
[02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
1702
[02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
[02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690

If I understand it correct in both cases django loads my base.css first so 
bootstrap overwrites it.
How can I change this?

Thanks for your response,

bengoshi

-- 
herz-jesu-jugend.de

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6be7f83-ca64-cd9d-b72e-2b9a4aa093cb%40herz-jesu-jugend.de.
For more options, visit https://groups.google.com/d/optout.


Re: order of loading css-files

2019-07-02 Thread Jani Tiainen
Hi.

It's your browser not Django. Django just emits HTML that is parsed by your
browser.


ti 2. heinäk. 2019 klo 15.14 Kai Kobschätzki 
kirjoitti:

> Hi:
>
> I tried to load bootstrap and an own css-file. But in which order does
> django load it?
>
> I have tried in my base.html:
>
> 
> {% load static %}
>
>
> 
> 
>
> {% block title %}gyousei{% endblock title %}
>
> 
> ...
>
> and the log is writing:
>
> [02/Jul/2019 11:54:38] "GET / HTTP/1.1" 200 6259
> [02/Jul/2019 11:54:38] "GET /static/css/base.css HTTP/1.1" 304 0
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
> 1702
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
>
> and if I write
>
> 
> {% load static %}
> 
>
> 
> 
>
>
> {% block title %}gyousei{% endblock title %}
>
> 
> ...
> the log writes
>
> [02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
> 1702
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
>
> If I understand it correct in both cases django loads my base.css first so 
> bootstrap overwrites it.
> How can I change this?
>
> Thanks for your response,
>
> bengoshi
>
> -- herz-jesu-jugend.de
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6be7f83-ca64-cd9d-b72e-2b9a4aa093cb%40herz-jesu-jugend.de
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ocYA%3Da%2BeZgEis76XXvcs0XqT69U5mXXPAV2W4aJ2mNLew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: order of loading css-files

2019-07-02 Thread Kai Kobschätzki
Hi,

thanks for your responses. Damn, but learning something new. Is there
something existing like a "proxy" in django which deliver the browser
only one css (quasi a mixture of all css-files)?

bengoshi

On 7/2/19 2:34 PM, Jani Tiainen wrote:
> Hi.
>
> It's your browser not Django. Django just emits HTML that is parsed by
> your browser.
>
>
> ti 2. heinäk. 2019 klo 15.14 Kai Kobschätzki
> mailto:kai.kobschaet...@gmail.com>>
> kirjoitti:
>
> Hi:
>
> I tried to load bootstrap and an own css-file. But in which order
> does django load it?
>
> I have tried in my base.html:
>
> 
> 
> {% load static %}
> 
>
>
> 
> 
> 
>
> {% block title %}gyousei{% endblock title %}
>
>
>  ... and the log is writing: [02/Jul/2019 11:54:38] "GET /
> HTTP/1.1" 200 6259 [02/Jul/2019 11:54:38] "GET
> /static/css/base.css HTTP/1.1" 304 0 [02/Jul/2019 11:54:38] "GET
> /static/bootstrap/css/site.css HTTP/1.1" 404 1690 [02/Jul/2019
> 11:54:38] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404
> 1702 [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js
> HTTP/1.1" 404 1690 [02/Jul/2019 11:54:38] "GET
> /static/bootstrap/js/popper.js HTTP/1.1" 404 1690 and if I write
> 
> 
> {% load static %}
> 
>
> 
>
> 
> 
>
>
> {% block title %}gyousei{% endblock title %}
>
>
>  ...
> the log writes
>
> [02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 
> 404 1702
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 
> 1690
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 
> 1690
>
> If I understand it correct in both cases django loads my base.css first 
> so bootstrap overwrites it.
> How can I change this?
>
> Thanks for your response,
>
> bengoshi
>
> -- 
> herz-jesu-jugend.de 
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/d6be7f83-ca64-cd9d-b72e-2b9a4aa093cb%40herz-jesu-jugend.de
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91ocYA%3Da%2BeZgEis76XXvcs0XqT69U5mXXPAV2W4aJ2mNLew%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2635d533-dde5-97e9-46a5-64b0104c15f4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: order of loading css-files

2019-07-02 Thread Joe Reitman
You have a 404 error meaning the browser can not find the file on the 
server.
The 304 error code means the file is already loaded in the browser and is 
the same as the file on the server so it won't be modified.

On Tuesday, July 2, 2019 at 7:14:38 AM UTC-5, bengoshi wrote:
>
> Hi:
>
> I tried to load bootstrap and an own css-file. But in which order does 
> django load it?
>
> I have tried in my base.html:
>
> 
> {% load static %}
>
>
> 
> 
>
> {% block title %}gyousei{% endblock title %}
>
> 
> ...
>
> and the log is writing:
>
> [02/Jul/2019 11:54:38] "GET / HTTP/1.1" 200 6259
> [02/Jul/2019 11:54:38] "GET /static/css/base.css HTTP/1.1" 304 0
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
> 1702
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
>
> and if I write 
>
> 
> {% load static %}
> 
>
> 
> 
>
>
> {% block title %}gyousei{% endblock title %}
>
> 
> ...
> the log writes
>
> [02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
> 1702
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
> [02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
>
> If I understand it correct in both cases django loads my base.css first so 
> bootstrap overwrites it.
> How can I change this?
>
> Thanks for your response,
>
> bengoshi
>
> -- herz-jesu-jugend.de
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6830f9b-66c3-4bef-9c8d-d45946804eda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: order of loading css-files

2019-07-04 Thread Andréas Kühne
Hi,

First of all - if you have 404's you won't load your files in any way - you
need to resolve that.

Second the loading of the CSS files doesn't  actually matter - it's the
order in which they are in the file that they are added to the DOM. So if
you first have bootstrap and then your own CSS you are fine.

Finally - the default way of loading CSS / JS files is that a browser only
loads a certain number of files from one domain at the same time (it was
previously 2, don't know if that has changed), so files will be put on hold
until the first 2 have been loaded, then the next 2 and so on.

The main point here is that if you add the css files in the order you want
them to be applied, you are fine.

Regads,

Andréas


Den tis 2 juli 2019 kl 15:15 skrev Kai Kobschätzki <
kai.kobschaet...@gmail.com>:

> Hi,
>
> thanks for your responses. Damn, but learning something new. Is there
> something existing like a "proxy" in django which deliver the browser only
> one css (quasi a mixture of all css-files)?
>
> bengoshi
> On 7/2/19 2:34 PM, Jani Tiainen wrote:
>
> Hi.
>
> It's your browser not Django. Django just emits HTML that is parsed by
> your browser.
>
>
> ti 2. heinäk. 2019 klo 15.14 Kai Kobschätzki 
> kirjoitti:
>
>> Hi:
>>
>> I tried to load bootstrap and an own css-file. But in which order does
>> django load it?
>>
>> I have tried in my base.html:
>>
>> 
>> {% load static %}
>>
>>
>> 
>> 
>>
>> {% block title %}gyousei{% endblock title %}
>>
>> 
>> ...
>>
>> and the log is writing:
>>
>> [02/Jul/2019 11:54:38] "GET / HTTP/1.1" 200 6259
>> [02/Jul/2019 11:54:38] "GET /static/css/base.css HTTP/1.1" 304 0
>> [02/Jul/2019 11:54:38] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
>> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
>> 1702
>> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
>> [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
>>
>> and if I write
>>
>> 
>> {% load static %}
>> 
>>
>> 
>> 
>>
>>
>> {% block title %}gyousei{% endblock title %}
>>
>> 
>> ...
>> the log writes
>>
>> [02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0
>> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 
>> 1702
>> [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690
>> [02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690
>>
>> If I understand it correct in both cases django loads my base.css first so 
>> bootstrap overwrites it.
>> How can I change this?
>>
>> Thanks for your response,
>>
>> bengoshi
>>
>> -- herz-jesu-jugend.de
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d6be7f83-ca64-cd9d-b72e-2b9a4aa093cb%40herz-jesu-jugend.de
>> <https://groups.google.com/d/msgid/django-users/d6be7f83-ca64-cd9d-b72e-2b9a4aa093cb%40herz-jesu-jugend.de?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91ocYA%3Da%2BeZgEis76XXvcs0XqT69U5mXXPAV2W4aJ2mNLew%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHn91ocYA%3Da%2BeZgEis76XXvcs0XqT69U5mXXPAV2W4aJ2mNLew%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the

My page is not loading css correctly

2019-04-01 Thread Patrice Chaula
I am learning django framework for building websites. I am trying to style 
my page with css. I have gone through the tutorial for managing static 
files in django. I have done every step mentioned. I am trying to display a 
jumbtron with a purple background and white text. The code is below. Only 
the text changes to white but background remains the same. I have had this 
problem for days. I have searched on the internet but didn't find any answer

{% block styles %}
  
  .jumbotron{
 background: purple;
 color: white;
  }

  
{% endblock %}
{% block content %}

  Dummy content for testing 

{% endblock %}


I have had this problem with django-allauth forms too. It doesn't apply 
bootstrap when I use crispy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/33c80074-6d8f-4c56-ba96-ae3de917dae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.