First time here? Check out the FAQ!
1

Location of `/media` folder?

I'm new to django and askbot and I'm confused about deployment. I'm trying to set up askbot to run under mod_wsgi with Apache.

All went well with installation and a local server is working (manage.py runserver). Next, I read the instruction about setting up apache configuration, but I'm clueless about the media part (serving "static files"). All examples talk about some media folder that I should alias, but there is no such folder in my project.

Am I supposed to create that folder and somehow copy all non-.py files in there? Where should I create it and what to put in it?

The project was created using askbot-setup, version 0.7.25. Django version 1.3.1, Python2.6, Apache/2.2.16 (Debian). The project directory looks like this:

$ ls
askbot  __init__.py  __init__.pyc  log  manage.py  settings.py  settings.pyc  urls.py  urls.pyc
parenthesis's avatar
15
parenthesis
updated 2011-10-12 18:56:45 -0500, asked 2011-10-12 18:48:15 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Btw, if you have an option, highly recommend combo nginx/uwsgi ili gunicorn, much faster than apache/mod_wsgi and uses less memory.

Evgeny's avatar Evgeny (2011-10-12 19:54:20 -0500) edit

I thought about it, but askbot documentation said apache/mod_wsgi is the most efficient. I will try nginx next :)

parenthesis's avatar parenthesis (2011-10-13 11:03:46 -0500) edit
add a comment see more comments

1 Answer

1

In apache configs the alias is a simple expression mapping a url and anything under that url to a directory on the server's file system - and the corresponding sub-directories.

So the case of askbot we have to alias three directories:

 Alias /m/ /path/to/askbot/skins/
 Alias /upfiles/ /path/to/django-project/askbot/upfiles/
 Alias /admin/media/ /usr/local/lib/python2.6/site-packages/django/contrib/admin/media/

The part that you need adjust manually is where the skins, upfiles and django hosted.

We should indeed just create a script that just creates correct server configuration clause, in fact we will do it this week.

If you tell at what path django is installed and askbot - I could give you a more concrete answer.

Evgeny's avatar
13.2k
Evgeny
answered 2011-10-12 19:39:58 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you, that worked. Looking forward to the update! Sorry I cannot upvote your answer, not enough points.

parenthesis's avatar parenthesis (2011-10-13 11:02:14 -0500) edit
add a comment see more comments