python - deploy static files with Django modpython -


i have wondered how static files found server when using django. deployed django app server , had trouble deploying static files. error following :

using urlconf defined in cms.urls, django tried these url patterns, in order: ^gre/ current url, static/, didn't match of these. 

when asked css file http://gnijuohz.com/static/css/bootstrap.css

so 1)

do have urls.py can find css files , js files?

notice don't have root permission on server,so can't use collectstatic command provided django.

i did set static_root , static_url in setting.py static_root point static files.

2)

i not clear how whole process works. when request css file, through urls.py matches?

thanks help!

1.

no, django should not serving static files on production server. apache (or whatever server use) should serve static files, found in directory /static/. that's collectstatic does: collects static files django apps , puts them in static_root server can serve files.

locally can serve static files adjusting urlpatterns in urls.py.

it's pity can't use collectstatic because that's how django intended used.

2.

as said above, that's not should happen.

now, answer question, create symbolic links in static_root locations static files located. symbolic link each static directory of each django app.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -