Hello,
I tried click. Error 404.
Vladimir
06.08.2011, 07:31, django-users@googlegroups.com:
> I am out of office right now and will get back to you when I return. If you
> don't hear from me, my assistant should contact you shortly. In the meantime,
> you should take a look at this product I
Hello,
I can't use static files too.
urls:
urlpatterns = patterns('',
(r'^', 'testjquery.views.first'),
)
if settings.DEBUG:
urlpatterns += patterns('django.views.static',
(r'^%s/(?P.*)$' % settings.STATIC_URL[1:], 'serve',
{ 'document_root': settings.STATIC_ROOT }),
)
Guillaume,
Here are some settings that you should compare to see if your project is
set up correctly:
In settings.py
# define the root directory to your project - this is just a convenience
so everything is referenced correctly.
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
#
Hi, you should conform the django.contrib.staticfiles in your
INSTALLED_APPS, then add the prefix to your template:{% load static %},
On Thursday, August 4, 2011, Guillaume Chorn
wrote:
> Hi All,
>
> It's been a couple of days since I last wrote and no response so I'm
Hi All,
It's been a couple of days since I last wrote and no response so I'm trying
again (see below). Please help if you can; without being able to link to
external static files I really can't do anything else with my site. CSS is
the very least of my concerns--worst case I can include that
Ok, so I did use quotes in my link, and I changed my STATIC_URL setting (in
settings.py) from '/static/' to 'http://127.0.0.1:8000/static/' (I am
currently using the built-in development server at this address), but still
no luck.
I'm not sure exactly what you mean by my "staticfiles settings."
Try this way which works well.
create folder static_media in project.
In urls.py give below url
(r'^static_media/(?P.*)','django.views.static.serve',
{'document_root':'static_media'}),
in settings give,
MEDIA_URL = '/static_media/'
it should work.
On Aug 1, 6:17 am, Gchorn
Last thing, I made a typo, the address you could use should start with http,
like: http://127.0.0.1/static/
Le 2 août 2011 12:01, "Thomas Orozco" a écrit :
> A little detail, but you never know: you should put some ' ' in your link.
> Like this :
>
>
>
>
> If there are
A little detail, but you never know: you should put some ' ' in your link.
Like this :
If there are spaces in your path, this could cause the lookup to fail.
And even if that's not the case, don't rely on the user's browser to fix
coding mistakes.
Le 2 août 2011 10:28, "Guillaume Chorn"
Could you show us the following:
Your staticfiles settings.
The link where your browser fetches the css file (see rendered source head
when browsing) to gets 404'ed.
If you are using a local server, you could try using a STATIC URL of
127.0.0.1:8000/static/.
Note that this will not work if you
hi,
Did you use the django development server to test it??
I have ever published my project on Lighttpd, but lost all the css.
I solved this problem by specified the midia and site-midia.
Like below on lighttpd.conf
"/site_media/" => "/root/web/Affair/gmadmin/media/",
"/media/"
Thomas and Lokesh,
Thanks very much for your help. I've modified the link in my HTML file to
be:
where "stylesheet" is the name of the CSS file, and this file is located
inside the directory listed under STATIC_DIRS in my settings.py file. As
mentioned in my prior email, I also already have
You can use below in setttings.py, create a folder called static
inside project and u can use it for static files.
STATIC_URL = '/static/'
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/
static".
# Always use forward slashes, even on Windows.
#
If your css file is locatedr in your staticfiles dir, you should use
something such as {{ STATIC_URL }}main.css, assuming your CSS file is called
main and is located in one of the STATIC_DIRS.
Using staticfiles_dirs in a template makes no sense. Not only your are
passing a parameter that has to
Hello All,
I'm using Django to develop a website, and I'm having trouble getting
it to see my static files. I've looked through Django's static file
documentation and the steps I've taken to get Django to see my files
(using a CSS file as an example) are as follows:
First, I created a folder
15 matches
Mail list logo