Django Server impacts path-rules ???

6 views
Skip to first unread message

doniyor

unread,
Feb 4, 2012, 1:48:08 PM2/4/12
to Django users
Hi everyone,

i have a small problem which makes me worry. i have a normal html file
with fotos to see in. and i have created a project and started the
server with "manage.py runserver". this is the point! :

if i open the html file just normal from the folder by doubleclick,
the browser shows the page very perfectly with fotos and so. just as
normal..

but my problem is that if i start the server and open the index.html
in my 127.0.0.1:8000, i see only text and no fotos are there. fotos
are even not downloadable, so the media resource is not reachable, but
why ? from the folder it finds the resources but not in
127.0.0.1:8000.

i will give my actual case here:

this is the project hierarchie i have:

-- transfer
-- contact (das ist app)
-- __init__
-- models.py
-- tests.py
-- views.py
-- media
-- js
-- images
-- css
-- template
-- index.html
-- transfer
-- __init__
-- settings.py
-- urls.py
-- wsgi.py

and how i give the src path in my index.html is here:
<link rel="stylesheet" href="../media/css/style.css" type="text/css"
media="all">

can you please help me with that, is it possible that django 1.4 looks
for path differently from last ones.. ?

thanks
doni

Daniel Roseman

unread,
Feb 4, 2012, 1:58:40 PM2/4/12
to django...@googlegroups.com
Have you set anything up to serve media and images? Have you looked at the documentation on how to do that?
--
DR.

doniyor

unread,
Feb 4, 2012, 11:58:33 PM2/4/12
to Django users
yes, but here you see:
For local development, if you are using runserver or adding
staticfiles_urlpatterns to your URLconf, you’re done with the setup –
your static files will automatically be served at the default (for
newly created projects) STATIC_URL of /static/.

doniyor

unread,
Feb 5, 2012, 12:02:47 AM2/5/12
to Django users
can you please take a look, here is my settings.py.
http://pastebin.com/GSUb2k2e
thanks

doniyor

unread,
Feb 5, 2012, 12:05:51 AM2/5/12
to Django users
now i created a folder named static and put all my media resource
there.

the change is here:
-- transfer
-- contact (das ist app)
-- __init__
-- models.py
-- tests.py
-- views.py
-- static
-- js
-- images
-- css
-- template
-- index.html
-- transfer
-- __init__
-- settings.py
-- urls.py
-- wsgi.py



On 5 Feb., 06:02, doniyor <doniyor....@googlemail.com> wrote:
> can you please take a look, here is my settings.py.http://pastebin.com/GSUb2k2e
Reply all
Reply to author
Forward
0 new messages