Django DatabaseError: no such column error

This is because you have amended your models and you have not changed your database.

Nothing to worry about!

For your info – > python manage.py syncdb ->  will NOT alter the existing schema in the database.

You need to run the python manage.py sqlall <your_app>

and then change your database based on the info given.

You may want to run python manage.py dbshell to do so

Or you can start using the Django addons calles South.

http://south.readthedocs.org/en/latest/installation.html

-> pip install South

-> Open up your apps -> settings.py

->add ‘South’ to your INSTALLED_APPS

-> run python manage. syncdb

-> then run python manage.py schememigration [yourapp_models] –initial

-> and again python manage.py migrate [yourapp_models]

Enjoy!

Did it resolve your problem?

Let me know post your comments !!

SSD Hosting for 5 dollars a month https://www.digitalocean.com/?refcode=71a52388956e

Advertisements

How to Install Django

Install Setuptools first

Mac OS

> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O – | python

Linux/Unix

Note that you will may need to invoke the command with superuser privileges to install to the system Python.

Alternatively, on Python 2.6 and later, Setuptools may be installed to a user-local path:

> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
> python ez_setup.py –user

Install Pip

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py

$ python get-pip.py

or

Using Package Managers

On Linux, pip will generally be available for the system install of python using the system package manager, although often the latest version lags behind. Installing python-pip will also install python-setuptools.

On Debian and Ubuntu:

$ sudo apt-get install python-pip

On Fedora:

$ sudo yum install python-pip

Then Install Django: ( You can check the latest version on https://www.djangoproject.com/download/)

pip install Django==1.5.5

Now you are ready to rock!