June 2011
3 posts
South Migration Issue. Relation already exists...
I was having this issue today where I was trying to migrate my database changes but it kept giving me this error DatabaseError: column ‘Enter Column Name Here ‘of relation ‘Enter Relation Name here’ already exists. Everytime I did ./manage.py migrate app it would give me the same error. I tried doing ./manage.py migrate —list to see the list of migrations and it...
3 tags
Uploading Images and files in django forms.
If you want to upload an image in a django model form, all you need is a ImageField in your django model. ImageField inherits all attributes and methods from FileField but also validates that the uploaded object is a valid image.
Next thing you need is to specify where the image is supposed to be uploaded. This is done via the upload_to option to tell django which subdirectory of MEDIA_ROOT...
3 tags
PostgreSql database dropping issue
I was involved in a case today where I had to drop a Postgresql database using the command dropdb -U database_user database but it was giving me this error,
dropdb: database removal failed: ERROR: database “Enter Database Name Here” is being accessed by other users.
Intially, I thought it was because i was using ipython to access the database by making some django querries, but...