Apr 06

Changing default Django project settings

with 0 comments

Now that I've been playing about with django and creating lots of new projects I've got fed up with changing some of the default settings, namely TIME_ZONE and LANGUAGE_CODE Here's how to change the default settings for all your new projects. You first need to determine where your site-packages directory has been installed. To find it execute the following command from a shell prompt.

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

Navigate to your site-packages directory and enter the django/conf/project_template directory. Open the settings.py file in your favourite text editor and change ...

Tagged with django Read More…

Apr 06

Using Textmate

with 0 comments

Being a Mac user one of the best utilities when writing code is Textmate. It has inbuilt support for Python, HTML and CSS among others. To use it best with Django you need to download a bundle which handles Django python code and Django templates. The simplest way to install the bundle is to download it from the Textmate Bundle Browser site. This will download a shell script to install the bundle from the Textmate SVN repository. Once installed you get nice syntax colouring like this:

textmate_syntax

A couple of very useful keyboard shortcuts for Textmate are worth remembering: (Ctrl - CMD ...

Tagged with textmate Read More…

Apr 04

New website update

with 6 comments

The new website was planned to be up and running before I returned to work after christmas, however a stay in hospital put paid to that plans. Hopefully it will be up in the not too distant future

Tagged with django Read More…

Apr 04

My new website is now live

with 0 comments

At last I've rebuilt the website using Django. I've also launched my new domain ianmcconachie.com.here are still some features that I want to add to the site and they'll come along in the near future.Feel free to let me know what you think of the site, good or bad - I can take it.

Tagged with django Read More…

Jan 10

New website

with 0 comments

I'm in the process of relaunching the website. I'm moving it from Wordpress to being powered by Django. I had hoped to have it up and running before starting back to work but I'm having a few niggles. Watch this space. The site will be moving over to my new domain ianmcconachie.com, it's time to stop using my old business domain. Once it is launched morayit.com will redirect to the new domain.

Tagged with django Read More…

Oct 10

Relative paths in settings.py

with 0 comments

The settings.py file in your Django project holds various settings for your database, time zone, media and template folders among others. Directories need to be entered with their full paths, like "/home/html/django_templates" or "C:/www/django/templates". In order to use relative paths, place the following lines at the beginning of the settings.py file

 

import os
def rel(*x):
    return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)

Tagged with django Read More…

Oct 03

Writing a CMS in Django

with 0 comments

I plan to write my own CMS in Django. I'm going to use the site of the local brass band that I'm a member of as a project. The site is currently built with Wordpress and can be viewed here The site should pose me a big enough challenge as it contains photo galleries, a news page and an updating gigs listing. I'm going to develop it on my VPS as I go along so watch this space to see how I get on.

Tagged with django Read More…

Oct 03

Django and MVC

with 2 comments

I've decided to start by learning Django (pronounced JAHNGO) and in the process I'll learn Python. Django is a web framework for python which uses the MVC model. The first job was to get my head around MVC. I'll try and explain my take on it. In a traditionally coded website all the logic behind the site, form processing, database calls etc, was coded into the page. This meant that any changes to the site involved changes to the code of the pages. MVC which stands for Model - View - Controller seperates all this out. The Model deals ...

Tagged with django Read More…

Sep 26

Updating to PHP5.3

with 0 comments

CentOS only has PHP 5.1 in it's repository but Andy Thomson is hosting a 5.3 repo at Webtatic.com with a step by step guide on installing it from fresh or upgrading from an earlier version.

Tagged with php Read More…

Sep 26

Setting up a VPS

with 0 comments

Thought I would add something else into the learning curve - setting up a VPS.

I bought a package from LayerShift. This gives me a 10GB CentOS 5 server with 160MB RAM and 150GB bandwidth a month, all for £4.95 per month.

It took 10 mins from loading their website to the VPS being up and running. The package is unmanaged but comes with Parallels control panel

Parallels control panel

The first job was to set up Apache and PHP5. CentOS installs with the package manager Yum by default but for some reason most VPS providers remove it.

After a bit of searching ...

Tagged with linux vps Read More…