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

  • Home
  • SEARCH
  • 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 7782283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:29:36+00:00 2026-06-01T19:29:36+00:00

I defined two models: class Server(models.Model): owners = models.ManyToManyField(‘Person’) class Person(models.Model): name = models.CharField(max_length=50)

  • 0

I defined two models:

class Server(models.Model):
    owners = models.ManyToManyField('Person')

class Person(models.Model):
    name = models.CharField(max_length=50)

admin.site.register(Server)
admin.site.register(Person)

After that I even checked the sql, just for fun:

BEGIN;
CREATE TABLE "servers_server_owners" (
    "id" integer NOT NULL PRIMARY KEY,
    "server_id" integer NOT NULL,
    "person_id" integer NOT NULL,
    UNIQUE ("server_id", "person_id")
)
;
CREATE TABLE "servers_server" (
    "id" integer NOT NULL PRIMARY KEY,
    "name" varchar(50) NOT NULL,
    "port" integer unsigned NOT NULL,
    "state" integer NOT NULL
)
;
CREATE TABLE "servers_person" (
    "id" integer NOT NULL PRIMARY KEY,
    "name" varchar(50) NOT NULL
)
;
COMMIT;

There it even says CREATE TABLE "servers_server_owners"

I ran syncdb to install the new models to the database. I went to the admin-interface to define some objects to play with, but I got the following error:

DatabaseError at /admin/servers/server/1/  
no such table: servers_server_owners

I shutdown the dev-server, ran syncdb again, started the server: Still same problem. Why can’t it find, the table, even though it just told me it created id?

  • 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-06-01T19:29:39+00:00Added an answer on June 1, 2026 at 7:29 pm

    Actually the problem was that the table never got created. Since I am fairly new with django, I did not know that ./manage.py syncdb does not update existing models, but only creates the ones that do not exist.

    Because the model ‘Server’ existed before I added the other model, and it was already in the db, ‘syncdb’ did not actually create the new tables.

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

Sidebar

Related Questions

models.py: class Item(models.Model): name = models.CharField(max_length=50) class ItemImage(models.Model): image = models.ImageField(upload_to='item_pics') item = models.ForeignKey(Item,
I have a model class defined as below: class Vehicle(models.Model): stock_number = models.CharField(max_length=6) vin
I'm using imagekit provided at: imagekit So, I've defined two class model: class Photo(models.Model):
I have two models: Play and PlayParticipant , defined (in part) as: class PlayParticipant(models.Model):
I have two models related by a foreign key: # models.py class TestSource(models.Model): name
I have two models : class A extends Model { public bool active =
I have defined two models where each one references the other, like so: class
In Play Framework! I defined two models : On one hand, @Entity public class
I have two models, Category and Point . The associations are defined as: Category
In this situation I have two models, Comment and Score. The relationship is defined

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.