Whilst Django is checking out of SVN I’ll give you a quick checklist to get it up and running on OSX.
- Install MySQL
- Install darwinports
$ sudo port install subversion$ sudo port install python24- Add
/opt/local/bin:/opt/local/sbin:/usr/local/mysql/binto your path (before $PATH so as to use Python 2.4) - Download and extract mysql-python bindings
- Change dir into the extracted mysql-python
$ python setup.py build$ sudo python setup.py install$ mkdir ~/django$ svn co http://code.djangoproject.com/svn/django/trunk/ ~/django/django_src- Add
$HOME/django/django_src/django/binto your path - Add
export PYTHONPATH=$PYTHONPATH:$HOME/django/django_src:$HOME/django/django_projectsto your .profile
And there you have it:
$ django-admin.py
usage: django-admin.py action [options]
actions:
adminindex [appname ...]
Prints the admin-index template snippet for the given app name(s).
...
Instead of placing it in ~/django you could have put it somewhere nicer, like /usr/local/django, but I thought I’d keep it consistent with Jeff Croft’s article on setting up DJango on dreamhost.
Archived comments
Comments were previously allowed on articles. Though no new comments are being accepted you can see the old comments below.
-
Excellent, concise instructions, thought i would add a wee bit of clarity that might help:
Step 5: If using default bash shell the actual code should be:echo 'PATH=/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:$PATH' >> ~/.bash_profilethen:source .bash_profileStep 12:echo 'PATH=$PATH:$HOME/django/django_src/django/bin' >> ~/.bash_profilethen, again:source .bash_profileStep 13:echo 'export PYTHONPATH=$PYTHONPATH:$HOME/django/django_src:$HOME/django/django_projects' >> ~/.profilefinally:source .profileCheers TT!
-
Thanks Allan! Glad you found it useful.
Apologies for the line breaks…
-
Can you please explain the difference between .profile and .bash_profile ?
Why is some stuff going in one and other stuff in the other?
-
Most (all?) shells have their own preferred config file, and then fall back on
.profile. If it’s BASH specific it should probably go into.bash_profile. I’m usually too lazy to pay much attention…Why Allan’s last step suggests using
.profilebeats me. -
That was sweet Tim!
cheers, very much
-
That my newbie mistake, you’re quite right – the final step should have been consistant with the rest and read .bash_profile’ not ’.profile’. But as Tim’s instructions indicate you can use .profile all the way through, I just put up what worked for me!
-
how to make this step in osx?
Add $HOME/django/django_src/django/bin to your path
I don’t know where is the “path” thing..
-
baldo: See the first comment by Allan above.
-
Just wondering. Since you are already installing Darwinports, why can’t you use that to install Django? Does it not work?
-
Screw MacPorts, just…
sudo easy_install http://code.djangoproject.com/svn/django/trunk/
Nothing wrong with the Python that comes in Leopard. You will need setuptools at least for this.
-
Also no need to install Subversion from MacPorts… comes pre-installed.