Ask Your Question
1

Location of `/media` folder?

asked 2011-10-12 18:48:15 -0600

parenthesis gravatar image

updated 2011-10-12 18:56:45 -0600

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
edit retag flag offensive 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 gravatar imageEvgeny ( 2011-10-12 19:54:20 -0600 )edit

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

parenthesis gravatar imageparenthesis ( 2011-10-13 11:03:46 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-10-12 19:39:58 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

Comments

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

parenthesis gravatar imageparenthesis ( 2011-10-13 11:02:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-10-12 18:48:15 -0600

Seen: 136 times

Last updated: Oct 12 '11