Django Dairy 1

Here is a new story, I try to use my poor English to record the days struggling with Django and related Web Technology. A big challenge for me~~

Some days before, I meet a programmer in a start-up meet. and heard about Django. A really interesting web framework using python.

At that time, I just wished to create a new site, and I think this is the time to learn new things.

However, the story between me and Django is not so sweat at the beginning. Since I am not a web guy, I do not familiar with Python, MySql also Apache, or anything related with Web……

I am a C programmer, and after that I used C++, C# and so on, but just for embedded system or window application. I only did some Joomla issue or HTML coding before. Now I can say I am facing a totally new world. This is the most exciting news for me!

Before, my trip of Django, I have to set up the environment of it, I have one laptop, one MAC mini, one windows desktop. I am newbie for MAC, and being attracted by it. So now, I turn to MAC world. I decide to set up a MAMP environment on MAC. I heard of that I should stop MAC default web server, and installed a new one, I do not know is it right or not, but I just followed.

My habit, go the Google type in MAMP, and I saw a very fantastic work, MAMP(, and first tried to use it, but I got stuck… while I am trying add

LoadModule wsgi_module modules/

in httpd.conf to load wsgi module for Apache which is recommended by Django.

It is not working. Either my Apache will not work, or my MySql. I can not get through it. So that I drop this way, and decided to installed it separately.

I found a article writing about Django working on MAMP by just put MAMP Django two words in Google searching box.

It is a blog written by Chris Gilmer, it is really helpful. I followed this article to setup everything up.

But it mostly depends on Mac Port, forgive my ignorant, I know nothing about it before. What can I do is just following the words it said.

But, things will not work in this way.

It will really good till I come this step:

To improve security of the mysql server configuration, please run mysql_secure_installation5 script and configure mysql password for root, network access, etc:

$cd /opt/local/bin


System asked me to input password……, I do not remember I have set up any password before, I tried everything I can come through, and system still do not let me go…

Finally I found a way to resetting the root password of MySql at

I used the Generic Instructions to pass my problem.

At the step of Starting/Stopping Apache and MySQL, I got to know what a fool I am……

first, I followed the way article told me, nothing happened……

After that my teacher Google told me that I should modify the file named ~/.tcshrc not ~/.cshrc so I did it. And it will not work, and bring me more error, at last I got to know, the syntax of alias is not right.

The article write like this

# Apache Aliases
alias apache2ctl 'sudo /opt/local/apache2/bin/apachectl'

# MySQL Aliases
#alias mysqlstart 'sudo /opt/local/bin/mysqld_safe5 &'
alias mysqlstart 'sudo /opt/local/share/mysql5/mysql5/mysql/mysql.server start'
alias mysqlstop '/opt/local/bin/mysqladmin5 -u root -p shutdown'

# PHP Aliases
alias php ”/opt/local/bin/php”

But what works for me is following this format:

# Apache Aliases
alias apache2ctl="sudo /opt/local/apache2/bin/apachectl"

# MySQL Aliases
#alias mysqlstart 'sudo /opt/local/bin/mysqld_safe5 &'
alias mysqlstart="sudo /opt/local/share/mysql5/mysql5/mysql/mysql.server start"
alias mysqlstop="/opt/local/bin/mysqladmin5 -u root -p shutdown"

# PHP Aliases
alias php=”/opt/local/bin/php”

I know I am not familiar with all the things I faced, maybe I made a stupid mistake, but anyway I got this point, And I will continue try it tomorrow.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s