Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7584697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:59:04+00:00 2026-05-30T18:59:04+00:00

I’m currently working on my first Django project and have hit a roadblock in

  • 0

I’m currently working on my first Django project and have hit a roadblock in regard to adding an ImageField to an existing model.

I currently have a model for a user posting content and one for django-profiles. For the former, I added an ImageField so the used can submit a photo to accompany the text content. For the latter, I want to allow users to upload a profile photo (not worried at the moment about avatar resizing).

Things were working well until I added ImageFields to both models. I then synced the database with South. What resulted when I try to pull up the once working templates for profiles is:

“no such column: report_userprofile.profile_pic”

A similar error occurs when trying to view the submitted text content.

I set both of the fields to “blank=True” so it seemed as if not having an image file would not cause an error. I’m obviously wrong.

I did not initially put these fields in the models, which in hindsight was a big mistake. I’ve also just set up the MEDIA_ROOT and MEDIA_URL as follows:

MEDIA_ROOT = 'os.path.join(BASE_DIR, "media")'

MEDIA_URL = 'http://localhost:8000/media'

The models I’m now using are:

class Story(models.Model):
title = models.CharField(max_length=100)
topic = models.CharField(max_length=50)
copy = models.TextField()
author = models.ForeignKey(User)
zip_code = models.CharField(max_length=10)
latitude = models.FloatField(blank=False, null=False)
longitude = models.FloatField(blank=False, null=False)
date = models.DateTimeField(auto_now=True, auto_now_add=True)
pic = models.ImageField(upload_to='pictures', blank=True)   
def __unicode__(self):
    return " %s" % (self.title)

class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
first_name = models.CharField(max_length=25)
last_name = models.CharField(max_length=35)
email = models.EmailField()
birth_date = models.DateField(blank=True, null=True)
city = models.CharField(max_length=25)
state = models.CharField(max_length=20)
zip_code = models.CharField(max_length=10)
profile_pic = models.ImageField(upload_to='pictures', blank=True)

The URLs file is set up as follows:

    url(r'^admin/', include(admin.site.urls)),

(r'^media/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': settings.MEDIA_ROOT},

The core problem here is I have no idea what the error might be (the previous templates even?). Or better yet, errors, as I’m sure I’ve made several. It’s a bit of a soup right now along with the resulting distress.

Just as an FYI, I have installed the PIL.

Any insight at all, even small insight, into what I need to do to remedy this situation would be beyond appreciated. I’ve searched for similar issues but none this specific emerges. (The first lesson for the future would be to obviously set up the ImageFiles when initially assembling the models.)

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:59:06+00:00Added an answer on May 30, 2026 at 6:59 pm

    This is exactly as you would expect if you add a column that doesn’t exist in the database (syncdb does not update database columns).

    If this is a question about django south, you should add it to the tags and add more background about what you did in south that failed.

    This should be a simple operation for south:

    1. Comment out the ImageField
    2. Run python manage convert_to_south myapp (or manage.py schemamigration myapp --initial, then then python manage migrate myapp --fake)
    3. Uncomment ImageField;
    4. Run python manage schemamigration myapp --auto
    5. Run python manage migrate myapp

    If you’re just trying to make it work without South you have 2 other options..

    Manually add the column to your database or reset the database table manage.py reset myapp – removes all data.

    Manually modifying the DB is very easy if you run the python manage.py sqlall myapp command — it will list the SQL used to build the table, so you can copy and paste the missing field line into a python manage.py dbshell session (in your case, sqlite3) if you convert the key parts to an alter table statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.