django1.3 static file problem
hi, I am new to django,I doing user authentication for my project,Well its works properly.
I have created a folder named 'static' in my projects root folder[now am in local devlopment] and necessary editing in setting.py ,My first page[which contains a login form] displays the images and uses the css file successfully,If login success accounts/profile url map to a view ,which in turn leads to a template 'LoginSuccess.html' but which doesn't displays the images,and css files.
The problem is it doesn't fetc开发者_C百科hes the images from static folder. My command prompt looks as follows
0 errors found Django version 1.3, using settings 'SecondPrjt.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [20/Sep/2011 22:11:47] "GET / HTTP/1.1" 200 5394 [20/Sep/2011 22:11:47] "GET /static/css/style.css HTTP/1.1" 200 3612 [20/Sep/2011 22:11:47] "GET /static/images/favicon.ico HTTP/1.1" 200 1150 [20/Sep/2011 22:12:10] "POST / HTTP/1.1" 302 0 [20/Sep/2011 22:12:10] "GET /accounts/profile/ HTTP/1.1" 200 1930 [20/Sep/2011 22:12:10] "GET /accounts/profile/css/style.css HTTP/1.1" 404 2758 [20/Sep/2011 22:12:10] "GET /accounts/profile/images/logo.jpg HTTP/1.1" 404 2764 [20/Sep/2011 22:12:10] "GET /accounts/profile/images/rss.jpg HTTP/1.1" 404 2761 [20/Sep/2011 22:12:10] "GET /accounts/profile/images/but1.gif HTTP/1.1" 404 2764 Also am confused about the HTTP 302 which not related to the static files
Note: I use a base.html(calls css files,some images) which inherits all of my templates
urls.py (r'^$',login), (r'^accounts/profile/$',views.loginsuccess), (r'^accounts/logout/$',logout),The problem I forgot to pass context while render return render_to_response('user/LoginSuccess.html',context_instance=RequestContext(request)
精彩评论