Posted
on February 27, 2009, 1:15 am,
by admin,
under
Django.
I hope that I finally got it right, since I can see the admin interface and the media files are being served by the same development server as the site. The machine is an Intel MacBook running OS X 10.5.6 and python 2.6.1 I suggest reading the official Django documentation on setting it with up mod_python first. I hope that this article can fill in the gaps. Remember to change the paths and names to the ones that you use.
Configure the virtual hosts
In this case 'mysite' is the name of the virtual host and 'my_site' is the name of the project, and server root directory. The server root was in my /Users/discodancer/Dev/my_site directory
<VirtualHost *:80>
ServerAdmin jordanovskid@gmail.com
DocumentRoot "/Users/discodancer/Dev/my_site"
ServerName mysite
ServerAlias mysite
ErrorLog "/private/var/log/apache2/my_site-error_log"
CustomLog "/private/var/log/apache2/my_site-access_log" common
<Directory "/Users/discodancer/Dev/my_site">
Options FollowSymLinks MultiViews Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Location "/">
SetHandler mod_python
SetEnv DJANGO_SETTINGS_MODULE my_site.settings
PythonHandler django.core.handlers.modpython
PythonPath sys.path+['/Users/discodancer/Dev/']
</Location>
# Do not use python interpreter for /media
<Location "/media">
SetHandler none
</Location>
# Do not use python interpreter for images
<LocationMatch ".(jpg|gif|png)$">
SetHandler None
</LocationMatch>
</VirtualHost>
Then, to allow serving of media files, you need to make a symlink from django's contrib/admin/media directory to your project. The apache user normally does not have privileges to the django installation, so you need to do this.
ln -s /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/
contrib/admin/media/Users/discodancer/Dev/my_site/media
(the path is too long, try not to paste the line breaks in your terminal :) Then make a file apache_settings.py in your project directory/server root and paste these lines in it:
import osos.environ['PYTHON_EGG_CACHE'] = '/Users/discodancer/Temp'
The path in my case is writable by the webserver (anyone for that matter). Finally add these 2 lines in the apache httpd.conf file. They will tell apache to load the settings from the file you just created.
PythonInterpreter my_site
PythonImport /Users/discodancer/Dev/my_site/apache_settings.py my_site
Restart the web server. I suppose you already know, but the apache httpd.conf file can be found in /etc/apache2/httpd.conf and the virtual hosts file can be found in /etc/apache2/extra/httpd-vhosts.conf. This should work :) at least it did for me. One more note: at the moment of writing there is no current MySQLdb module for python 2.6. I am using the one that works with python 2.5 and each time I import it it throws a warning that the sets module is deprecated. Just ignore this, it didn't cause any trouble to me. If someone can explain what it really means, i'd be grateful.
Posted
on February 26, 2009, 1:16 am,
by admin,
under
Django.
This is not my article, i copied it from here for safe keeping.
First, you?ll need to grab the source to mod_python. I recommend version 3.3.1, which is what I?ve worked with. Then, you?ll need to unpack it:
$ tar xvzf mod_python-3.3.1.tar
$ cd mod_python-3.3.1
$ ./configure --with-apxs=/usr/sbin/apxs
At that point, the configuration script will spit out a lot of things that you shouldn?t really care much about. Just make sure at the end it spits out a bunch of things about creating Makefiles. From there comes the normal sequence of events with most open source software:
$ make
$ sudo make install
The last requires the sudo command because it installs a bunch of pieces in privileged areas. Never run as root; always use sudo for your administrative needs. Finally, you need to add the module to your httpd.conf file, which is located in the /etc/apache2/directory, after making a back-up of course.
$ cd /etc/apache2
$ sudo cp httpd.conf httpd.conf.orig
$ sudo vi /etc/apache2/httpd.conf
Then, scroll down to where you?ll find all the LoadModule commands, and add another line:
LoadModule python_module /usr/libexec/apache2/mod_python.so
Now all that?s left is to reload Apache to make sure it loads the module for you:
$ sudo /usr/sbin/apachectl restart
At that point, you?re ready to proceed. The best place to start is the mod_python documentation, specifically the section on testing.
Posted
on February 25, 2009, 2:07 am,
by admin,
under
Programming.
Bronze framework is a PHP MVC framework for building web applications. It was inspired by many other frameworks that can be found around. It uses a system of internal redirects and a recursive front controller to allow the developer to reuse code as much as possible, and avoid repetition.
For now, the only thing you can get is the source and consult :) I need some time to write proper documentation.
Anyway, download here, and please comment on it here
Posted
on January 21, 2009, 12:41 am,
by admin,
under
Uncategorized.
This is not a blog post, more like personal notes. I'll jot these down so I don't forget them and structure them into a post later (maybe never :D ).
1. Pirate sites for .pdf books
2. Colleagues (depends on where you're workin')
3. Apparently, iTunes podcasts (screencasts)
4. Coding forums (stackoverflow)
5. K&R - The C Programming language :)
Now I only need to find a way to filter out and read the GIGANTIQUE amount of information i download every week. Most of it is probably stuff I already know of - for example the first few chapters of every book are about for loops and operator precedence - but the sheer amount of programming knowledge out there is simply indigestible. Maybe someday Ill try summing it all up. Or maybe that was an overly enthusiastic idea ...
Posted
on January 18, 2009, 3:15 pm,
by admin,
under
General.
These days I am doing a little pre-purchase research on virtual machine hosting services. The company I work for needs a testing environment for the projects in development and I figured it would be best to get a server on which we could install SVN and make a shadow copy of the most recent version directly in the server root so we can avoid uploading files manually every time we make a change.
I checked the 'internets' for some hosting options and i found out about few. One of the first hosting providers I found was Rackspace. Now, i want to mention that looking for hosting companies and checking thir prices isn't exactly my favorite thing to do, and these companies aren't making my life easier. If you visit Rackspace's website, the first thing your sight lands on is some guy saying "If you're looking for a partner, you can look no furter than Rackspace". Gee, thanks, that's just what I needed, now i just need to find the subscribtion form. Rackspace is one of the leading hosting companies on the market and the experience fron visiting their website is almost like visiting Godaddy. I see a bunch of stuff I dont care about that are only obscuring the link I really need: Pricing information for their services.
It's not rocket science to find out why a visitor is really coming to your website. He needs either support or info about your merchandise (read: prices). If you really want to respect your customer's time the only 2 things on your website would be: A large button saying 'SUPPORT', and a nice, formatted table showing the prices on your different hosting plans. That simple.
It's not just rackspace. After visiting a bunch of websites, it turns out that almost none of the hosting companies have the info I am looking for on their home page.After a while, i got tired of clicking links and if I didn't find the pricing tables on the hompage I just started to click the back button.
The only hosting company who's website I enjyed using so far is Slicehost. For now, they are on top of my list.
Update: I'm going with Slicehost. See how a nice and clean website DOES get you the cash? :)
Posted
on January 11, 2009, 12:39 am,
by admin,
under
Uncategorized.
I always thought that MS Office is *THE* best office software out there. I've been using it since ever. I only tried OpenOffice while I was using linux and I have to say that although is does give you the most bang for the buck (infinite :) it just sucks in comparison with MS office. I never tried out the iWork office suite and when I got a Mac i installed a MS office on it (its slow and not as good as the windows version), but today I ran into the homepage of Apple's Keynote (it's the Powerpoint's counterpart) and I just loved it (the homepage). The most important thing is right there in front of you and it looks good. And the most important thing about this kind of apps is ... making a cool presentation. On the other hand, if you visit the MS Powerpoint homepage, it looks cluttered with stuff and cheap. It has ribbons in the navigation (lol!). It even has a menu link called "Product Overview", which makes it look like "just another" product. I mean ... it looks like those $4.99 website templates.
Suppose I never made a presentation in my life and now I'm in a need of such an app. The first place to go to in search for a tool would be the internet. And after taking a look at both of the websites I'm pretty sure I'd chose Keynote. As I'm doing right now. The first thing I learned on Keynote's homepage is that you can do very very cool animations with it like "magic move" and those perspective slide transitions. And this precious information was just ONE click away in a video.
You know how my search for a similar video describing the features of Powerpoint went? Well, I'll let the screenshot speak for itself:

After all, what else could I want besides that uber-cool perspective transition and flash-like animations. Why on earth would I want to buy Powerpoint. And this is not just my impressed half talking. The other, rational half is thinking it too. Marble graph bars?! Cool! Tinted glass pie charts?! Wow! As far as I'm concerned (a presentation noob) Powerpoint is just some application that everyone's using, but Keynote is fun fun fun. I have this big urge to make a presentation. About anything. Im going out to buy the Economist and redraw all it's charts in Keynote. Srsly.
So thoughts are welcome on why would I want to use Powerpoint after visiting Keynote's website.
The links ( Even the URL is prettier on apple's site ):
http://www.apple.com/iwork/keynote/
http://office.microsoft.com/en-us/powerpoint/default.aspx
Posted
on January 7, 2009, 1:26 am,
by admin,
under
General.
This is the homepage of Dusko Jordanovski. For info click here.