Blog
4.7.2011 — These instructions should help you getting Django running with Snow Leopard’s default Apache. They assume that you’ve already gone through the steps described in “Installing Python with mod_wsgi on OS X Snow Leopard’s default Apache“.
- Start by doing the steps described here: http://www.djangoproject.com/download/. For your convenience, the steps are reproduced here:
# wget http://www.djangoproject.com/download/1.3/tarball/
# tar xzvf Django-1.3.tar.gz
# cd Django-1.3
# sudo python setup.py install
-
After this, you can go through the first steps of the tutorial at http://docs.djangoproject.com/en/1.3/intro/tutorial01/ . When the tutorial tells you to “cd into a directory where you’d like to store your code”, do the following:
# cd ~/wsgi_source
# mkdir django-tutorial
# cd django-tutorial
# django-admin.py startproject mysite
When the tutorial tells you to launch the Django development web server, don’t.
If your goal is to develop something that in the end runs under Apache, you should also develop with Apache. There is a lot of discussion on the Internet about Django apps working fine with Django’s own development server, and then failing when installed on Apache.
-
To get your application running Apache, there are a few extra steps to do, and even after that you may end up with strange concurrency problems. There is an in-depth discussion about the problems related to running Django with a WSGI-script in Graham Dumpleton’s blog. The script below is copied from there.
Here you can find Django’s own documentation about the matter, but following that resulted in the dreaded “ImportError: Could not import settings ‘mysite.settings’ (Is it on sys.path?): No module named mysite.settings“-error.
Add a new virtual host to your Apache main configuration file at /etc/apache2/httpd.conf :
<VirtualHost *:80>
WSGIDaemonProcess localdjango processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup localdjango
ServerName localdjango
WSGIScriptAlias / /Users/YOURUSERNAME/wsgi_source/django-tutorial/mysite/apache/django.wsgi
<Directory /Users/YOURUSERNAME/wsgi_source/django-tutorial/mysite/apache>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Note the first two lines, which make Apache serve the Django requests in daemon-mode. This can possibly solve the multithreading issues that have been reported related to running Django on top of Apache.
- Add a new entry in your hosts-file:
127.0.0.1 localdjango
- Then, create the improved WSGI-script, and save it at /Users/YOURUSERNAME/wsgi_source/django-tutorial/mysite/apache/django.wsgi :
import sys
import os
os.environ['PYTHON_EGG_CACHE'] = '/Users/YOURUSERNAME/.python-eggs'
sys.path.insert(0, '/Users/YOURUSERNAME/wsgi_source/django-tutorial/mysite')
import settings
import django.core.management
django.core.management.setup_environ(settings)
utility = django.core.management.ManagementUtility()
command = utility.fetch_command('runserver')
command.validate()
import django.conf
import django.utils
django.utils.translation.activate(django.conf.settings.LANGUAGE_CODE)
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
- And finally:
# sudo apachectl restart
- After this, you should be able to access your Django app from http://localdjango .
There’s one more thing to do before you can get started with the tutorial. Assuming you want to use MySQL during the tutorial, you need to install Python’s MySQL bindings:
Download the tarball from http://sourceforge.net/projects/mysql-python/ and save it to your Desktop. Then:
# cd ~/Desktop
# tar -xvzf MySQL-python-1.2.3.tar.gz
# cd MySQL-python-1.2.3
Edit site.cfg and replace the mysql_config-line with this:
mysql_config = /usr/local/mysql/bin/mysql_config
And then:
# python setup.py build
# sudo python setup.py install
One thing left to do is to set up a server to serve the static files needed by your application. The Django documentation suggests a few web servers, as well as gives an example on how to configure the same Apache virtual server to serve them. Since we want to emulate a production setup, however, we want the static files to be served from a separate server. Another Apache virtual server will do, so we don’t have to install another web server on a local development machine:
- Add this to your Apache configuration file:
<VirtualHost *:80>
DocumentRoot /Users/YOURUSERNAME/wsgi_web/djangotutorial
ServerName localdjangostatic
LogLevel warn
<Directory "/Users/YOURUSERNAME/wsgi_web/djangotutorial">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- Add this to your /etc/hosts:
127.0.0.1 localdjangostatic
- Edit your settings.py, and change the following settings:
STATIC_URL = 'http://localdjangostatic/'
ADMIN_MEDIA_PREFIX = 'http://localdjangostatic/admin/'
- Create a symlink from the Django library to the web root:
# cd ~/wsgi_web/djangotutorial
# ln -s /Library/Python/2.6/site-packages/django/contrib/admin/media admin
- Restart Apache again:
# sudo apachectl restart
That’s it. Go through the tutorial if you’re new to Django, or start developing your own application if not. Note that when the tutorial tells you to “restart the development server”, with your setup you just need to:
touch ~/wsgi_source/django-tutorial/mysite/apache/django.wsgi
More instructions can be found on the mod_wsgi site: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango.
As a final note, Graham’s workaround may not solve all your problems, and apparently the Django developers say that you’re doing something wrong if you need it. This blog post was written during my first attempt to get Django installed on OS X, so there may be omissions or errors in the instructions.
Aihe:
In English,
Technology |
Lisää kommentti »
16.6.2011 — Exove participated in organising the first DrupalCamp Estonia together with Estonian Drupal activists Kristjan Jansen and Henri Laupmaa.
The camp was a success, there were about 60 people present. A lot of new companies in the scene and freelancers as well.
We had two presentations. Kalle Varisvirta talked about using SOLR search in media sites:
And Rami Järvinen discussed on high-performance Drupal sites:
Janne Kalliola took few photos (Flickr) at the camp, including a couple group photos.
Aihe:
Drupal,
Exove,
In English,
Technology |
Lisää kommentti »
10.6.2011 — We had an excellent seminar on Wednesday about designing and implementing iPad and mobile applications. The seminar featured Jarno Koponen from Futureful, Bertrand Maugain from eZ Systems, Norway, and Petri Rahja from Scoopshot. Besides our partners and customers, also our own people, namely Aki-Ville Pöykiö and Juha Jauhiainen from Exove Design had presentations.
The programme of the seminar can be found on the earlier blog post.
A couple of pictures from the event:
Jarno Koponen demoes Futureful application.
Bertrand Maugain discusses about implementing content-driven applications to save time and cost.
Petri Rahja shows Scoopshot plans about their future pro application.
You may download the seminar slides as a PDF file. Please fill in the short query below, and after submitting you’ll get the link to the PDF under the form.
Obligatory fields are marked with a star.
The slides can be viewed also here:
Aihe:
Exove,
In English,
Mobile 2.0,
eZ Publish |
Lisää kommentti »
7.6.2011 — The first DrupalCamp in Estonia will take place on June 14th at Zappi conference center in Ülemiste City.
The event begins at 12.30 and ends at 16:30. We have two sessions; searching media sites with Drupal, and high performance Drupal sites.
Exove is one of the organisers and the sponsors of the event.
Please check www.drupalcamp.ee for more information.
Aihe:
Drupal,
Exove,
In English |
Lisää kommentti »
1.6.2011 — Haemme kasvavaan joukkoomme Front End -kehittäjää vastaamaan asiakkaidemme verkkopalveluiden käyttöliittymien toteutuksesta yhdessä konseptisuunnittelijoiden, graafikoiden ja ohjelmistokehittäjien kanssa. Jos sinulla on käytännön osaamista (X)HTML, CSS ja JavaScript parista sekä kokemusta käyttöliittymien suunnittelusta nykyaikaisten front end –teknologioiden avulla, olet etsimämme henkilö. Tiedät myös, mitä HTML5:n taustalla on sekä tunnet nykyisten mobiiliselainten mahdollisuudet ja rajoitukset.
Tarjoamme erittäin mielenkiintoisia ja vaihtelevia työtehtäviä Suomen eturivin asiakkaiden parissa. Lue lisää työnkuvasta ja laita hakemus tulemaan CV:n kera osoitteeseen jobs@exove.fi.
Aihe:
Exove |
Lisää kommentti »
26.5.2011 — The first day of the first Drupal Business Days is now over. We had two really exciting presentations — Saila Laitinen, our sales director, talked about Fruitful Partnerships and Ecosystems, and Janne Kalliola, CEO, discussed on Growing Drupal Organisations.
As usual, we’ve uploaded the presentations to Slideshare.net. They are also available below.
Saila’s presentation
Janne’s presentation
Aihe:
Drupal,
In English,
Technology |
Lisää kommentti »
23.5.2011 — Most of the instructions here can be found elsewhere on the Internet, but I couldn’t find a comprehensive step-by-step guide that covered everything needed. So, here goes; this should cover everything you need to do to get going with Python, when starting with a stock OS X Snow Leopard Apache:
- Download mod_wsgi from http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2, and save it to your Desktop.
- Untar the archive, and install mod_wsgi:
# cd ~/Desktop
# tar xvfz mod_wsgi-3.3.tar.gz
# cd mod_wsgi-3.3
# ./configure
# make
# sudo make install
- Then, edit your Apache main configuration file:
# cd /etc/apache2
# sudo nano httpd.conf
Add the following line after the other LoadModule lines:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so
- Go back to the directory where you untarred the mod_wsgi source:
# cd ~/Desktop/mod_wsgi-3.3
# make clean
- Create new directories outside your webroot for storing the script files, and to be used as a separate webroot for python apps:
# cd ~
# mkdir wsgi_source
# mkdir wsgi_web
- Save a test script in the new wsgi_source directory as test.wsgi:
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
- Create a new virtual host for your Python applications. Add this to your /etc/apache2/users/YOURUSERNAME.conf :
<VirtualHost *:80>
ServerName localpython
DocumentRoot /Users/YOURUSERNAME/wsgi_web
<Directory /Users/YOURUSERNAME/wsgi_web>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /myapp /Users/YOURUSERNAME/wsgi_source/test.wsgi
<Directory /Users/YOURUSERNAME/wsgi_source>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- Add this to your /etc/hosts:
127.0.0.1 localpython
- Restart Apache:
# sudo apachectl restart
- Go to http://localpython/myapp , and you should see your “hello world”. If you don’t, something has gone wrong. The easiest way to start debugging is to check your Apache error logs at /var/log/apache2/error_log
More instructions can be found on the mod_wsgi site.
Aihe:
In English,
Technology |
Lisää kommentti »
19.5.2011 — Haemme kasvavaan joukkoomme projektipäällikköä vastaamaan asiakasprojektien johtamisesta ja sisäisten kehityshankkeiden koordinoinnista. Jos sinulla on aiempaa kokemusta projektipäällikön työstä ja mahdollisesti myös ketterien menetelmien — esimerkiksi scrum tai kanban — käytöstä, saatat olla juuri oikea henkilö meille.
Tarjoamme erittäin mielenkiintoisia ja vaihtelevia työtehtäviä Suomen eturivin asiakkaiden parissa. Lue lisää työnkuvasta ja laita hakemus tulemaan CV:n kera osoitteeseen jobs@exove.fi.
Aihe:
Työpaikat |
Lisää kommentti »
17.5.2011 — Update May 30: The seminar is full. All new registrations go to waiting list. In case of cancellations, we invite people from the list to participate in the event.
Exove will host a free breakfast seminar on designing and implementing content-driven iPad applications on Wednesday June 8. The seminar takes place in Ruoholahti, HTC Pinta building at Tammasaarenkatu 3, Helsinki.
Enroll (in Finnish) – Seminaariesittely suomeksi – Ilmoittaudu
Mobile and tablet apps are at the forefront of new innovation – the hottest concepts, the brightest people, and the savviest of customers are now converging in the mobile app space.
Apps provide a lot of potential for the industry: devices are ultra-personal, always on and always available; most notably people are easily inclined to spend money on and within mobile apps. App platforms support both high class user interfaces and easy integration to back-end systems.
However, there are some important considerations: for instance, the cost and the time-to-market required can pose challenges when developing mobile applications. Furthermore, an application needs to be developed on several mobile platforms separately.
Fortunately, there are solutions to reduce the time and the cost involved. The content-driven application development model discussed in this seminar allows some of the development to take place on the web, thus reducing cost and time spent dramatically in certain cases.
During the breakfast seminar Exove and Exove Design share their knowledge of application design and implementation. Exove’s partner, eZ Systems, shows how to use their eZ Publish CMS to radically reduce costs whilst Futureful and P2S Media Group showcase their iPad applications and related business cases.
We welcome you to enjoy the presentations and to discuss about content-driven application design and implementation.
Please note that the seminar will be held in Finnish. The seminar material will be available in English.
Programme
Enroll (in Finnish) – Ohjelma suomeksi – Ilmoittaudu
| 8.30 – 9.00 |
Breakfast |
| 9.00 – 9.10 |
Opening Words
Janne Kalliola, CEO, Exove Ltd
Exove designs and implements web sites and services that help our customers conduct better business on the Internet.
|
| 9.10 – 9.25 |
Application concept design
What makes an app great? Application concept design has a lot of similarities to web concept design. But apps also have unique characteristics that make them engaging and powerful. Creating a solid concept plan is the key to launching a successful application.
Aki-Ville Pöykiö, Design Director, Partner, Exove Design Ltd
Exove Design helps their customers to make the most out of their business on the web. The starting point is the customer’s business, brand, and strategy. The way our customers are presented on the web should maximize their potential. We call it business driven design.
|
| 9.25 – 9.40 |
Differences and similarities of web and application design
How to design for multiple platforms with the same content while maintaining the best possible usability and user experience.
Juha Jauhiainen, Art Director, Partner, Exove Design Ltd
|
| 9.40 – 10.00 |
Case: Futureful
“What you want, before you knew you wanted it”
Futureful is developing an exciting new way for you to discover personally relevant content. We are currently in stealth-mode and will be launching our iPad app this summer.
Marko Andersson & Jarno Koponen, Co-founders, Futureful Ltd
This presentation will be held in English.
Futureful’s predictive discovery engine analyzes relevant information flows to open up the potential future around you.
|
| 10.00 – 10.10 |
Break |
| 10.10 – 10.30 |
Content-driven vs. code-driven
With new devices introduced every month on the market, creating and maintaining specific applications for each device can be a nightmare. A good content strategy and a centralization of content in a structured and open Web Content Management system as eZ Publish is a way to avoid those issues.
Bertrand Maugain, Director, International Business Development, eZ Systems Ltd
This presentation will be held in English.
Founded in 1999, eZ Systems is the creator of eZ Publish, the award winning Open Source Web Content Management Platform used by more than 200,000 websites in more than 160 countries. As a company eZ Systems’ focus is on enabling customers to see ROI from our products, by giving them the ability to quickly adapt and adjust their digital offerings whilst helping future proofing their businesses in this ever changing digital landscape.
|
| 10.30 – 10.50 |
Case: Scoopshot Pro
Scoopshot is a smart combination of business, social media and user generated content. Users of smartphones can download a free application with which they send photos and related information to the Scoopshot service. Media is then able to purchase fresh eyewitness photos from the real-time store.
Scoopshot Pro will extend the service for professional photographers. iPad is an ideal platform for Scoopshot Pro and in the presentation we will elaborate why.
Petri Rahja, COO, P2S Media Group
P2S Media Group develops and markets Scoopshot service.
|
| 10.50 – 11.00 |
Discussion |
Enroll (in Finnish) – Ilmoittaudu
Aihe:
Exove,
Mobile 2.0,
eZ Publish |
Lisää kommentti »
11.5.2011 — We have two interesting sessions at Drupal Business Days in Helsinki on May 26-27. Saila Laitinen will talk about What does a fruitful partnership consist of? and Janne Kalliola will have a session about Growing and Managing Drupal Organisations. Both sessions are on Thursday, May 26. The full programme is also available.
We are also a silver sponsor of the event and have made the site on top of COD base system installed by Mearra.
Saila and Janne will be at the event on both days. Please come to say hello to them, if you are around.
Aihe:
Drupal,
Exove,
In English |
Lisää kommentti »