Wow, mate, you're the hero! Worked like a charm!
Thank you very much!
--
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.
Have you tried to run manage.py collectstatic ?
The devserver with debug serve static file from each app, but it
doesn't do it without debug.
The idea is that static files should be served directly by your server
or with a CDN and not requiring any CPU time from django.
2017-02-11 22:37 GMT+01:00
On 02/12/2017 12:40 AM, Rafał eM wrote:
Guys,
I'm following one of the Django tutorials but currently stuck with a
problem. When running django webserver on my local machine everything
works fine, but when upload the project to the server it doesn't read
css file anymore.
settings.ps:
|
STAT
Hello,
While it's not easy to know exactly what the problem is in your case without
more information (such as the web server's configuration), a general
understanding of Django's static files in production can help, and to this end
I've made a schematic that you may find useful, at
https://djangod
Guys,
I'm following one of the Django tutorials but currently stuck with a
problem. When running django webserver on my local machine everything works
fine, but when upload the project to the server it doesn't read css file
anymore.
settings.ps:
STATIC_URL = '/static/'
base.html:
{% load s
Guys,
Following tutorial from djangoproject.com I stuck with loading CSS to the
site.
Django 1.10
settings.py:
STATIC_URL = '/static/'
base.html:
the path to blog.css in my project is:
blog/static/blog/css/blog.css
it works perfectly fine when running django webserver on my local machine
Hallo everyone,
thanks for the many answers, the problem is solved. There must have
been an error in the urls.py. Now it works with the static serving:
# from urls.py:
site_media = os.path.join(os.path.dirname(__file__), 'site_media')
urlpatterns += patterns('',
url(r'^site_media/(?P.*)$', 'djang
static is a folder, it is not a view
our project code can be found here
http://github.com/vaxXxa/projector
You may look at and compare.
Good luck.
--
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.
On Jul 28, 4:21 pm, Andreas Pfrengle wrote:
> Hi,
>
> we've been trying for hours now to include a css-file in our project,
> but it just doesn't work and we don't know why. We've already reduced
> the project to the absolute minimum of necessary code:
>
> #settings.py
2010/7/28 Andreas Pfrengle :
> Hello Kostia,
>
> I get a template syntax error with your method, since I haven't
> defined a "static" view. How does your static-view look like?
> I've already tried it like described here --> docs.djangoproject.com/en/dev/howto/static-files/> but I don't get it
> w
Hello Kostia,
I get a template syntax error with your method, since I haven't
defined a "static" view. How does your static-view look like?
I've already tried it like described here --> but I don't get it
work either, I get a TypeError: bad operand type for unary +: 'list'
for the urlpattern that
the css should be {% MEDIA_URL %} but you have to be sure you pass the
RequestConext on your render_to_response method.
If you're are on the development server you have to add additional
urls to urls.py to serve static content.
Is explained in the docs, but I suppose some examples you'll be
better
I use in settings.py:
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'main',
'templates', 'static').replace('\\', '/')
MEDIA_URL = '/static/'
And then simply in an html file:
Where the full folder path is the ../project_name/main/templates/
static/styles/nav.css
--
You received this
Hi,
we've been trying for hours now to include a css-file in our project,
but it just doesn't work and we don't know why. We've already reduced
the project to the absolute minimum of necessary code:
#settings.py:
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)
14 matches
Mail list logo