WebFaction
Community site: login faq
0
1

In the settings.py, I added

 CACHES = {
     'default': {
             'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
            'LOCATION': 'unix:/home/jqy/perexp/data/memcached/memcached.sock',
        }
 }

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
525
accept rate: 0%

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.

(01 May '13, 04:00) ryans ♦♦

Do I need to configure the memcached and python-memcached?

(01 May '13, 08:46) jqy

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:

(01 May '13, 10:07) seanf

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?

(01 May '13, 18:28) 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 CACHE is created (or is attempted to be created) inside the directory for the static files by the staticfiles app, then new directories and files are written into that directory (the combined javascript and the css files).

If the webserver cannot write into that directory or cannot create subdirectory CACHE in the staticfiles directory then the combined assets will not be created and your site may look as completely stripped of styles and be unfunctional.

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.

permanent link

answered 03 May '13, 08:15

Evgeny
112
accept rate: 0%

edited 03 May '13, 15:48

@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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34
×17

question asked: 30 Apr '13, 09:37

question was seen: 2,851 times

last updated: 03 May '13, 15:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM