In the settings.py, I added
Also added middleware in the file. memcached is started. But when i tried to run askbot in the production mode, it seems like some files, like css file, javascript file, need to be requested from cache. Some links are like: http://xxx.webfactional.com/m/CACHE/js/85190e85e697.js But it can't be found in the server side. How to configure memcached for the per-site cache? Many thanks. asked 30 Apr '13, 09:37 jqy |
Hello, we have resolved this issue on Askbot support forum, just copying here: @jqy is confused about subdirectory CACHE and Memcached. There is absolutely no connection between the two. The directory If the webserver cannot write into that directory or cannot create subdirectory The solution is to create that directory manually and possibly change permissions so that the webserver can actually build the combined static files. I don't know what is the effective user of the webserver on WebFaction, hopefully WF staff could fill in. Also documentation about the django's compressor app will be helpful. answered 03 May '13, 08:15 Evgeny @seanf @ryans Could you please help him with the static files? I know that WebFaction hosting has special conventions and I don't know what they are. Thanks!
(03 May '13, 08:22)
Evgeny
The effective user that runs your Askbot app is your main account user. The effective user for media served via our front-end Nginx server is "nginx". Our documentation for setting up static media for your Django application is here: Serving Django Static Media If you need more personalized assistance, feel free to open a support ticket via our control panel.
(03 May '13, 14:18)
seanf
The server is not allowed to create directories?
(03 May '13, 14:51)
Evgeny
If by "the server", you mean your Askbot process, then it should be able to create directories anywhere within your home directory, except in ~/logs and directly under ~/webapps. If you need to create a directory directly under ~/webapps, then you can do so by creating a static-only app in our control panel. A corresponding directory will be created for that app.
(03 May '13, 15:25)
seanf
Ok, then it's clear. Yes by the server I mean the python webapp server. He needs to create a subdirectory within the static files app. Django compressor app by default wants to write into the STATICFILES_DIR + '/CACHE' .
(03 May '13, 15:33)
Evgeny
|
In general, the method described in this related topic and the code you've shown looks correct to us. If this isn't working, or not working as you expect, you may need to contact the askbot and memcached communities for support, as we aren't sure where the problem is if it's a bug in third-party software.
Do I need to configure the memcached and python-memcached?
Yes, if you want to use memcached, you need to run an instance of memcached and install the Python bindings for memcached. Here is some more information that may help:
I have already done this before. It works fine when I tried to run askbot in debug mode. But when I turned it off, it would use the cache link. Did I miss something?