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 7682271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:31:47+00:00 2026-05-31T18:31:47+00:00

I create a new Django app (not project) called Bussinesses, then add following class

  • 0

I create a new Django app (not project) called Bussinesses, then add following class to the models.py.

class Bussinesses(models.Model):
    business_email = models.EmailField()
    password = models.CharField(max_length=20)
    contact_first_name = models.CharField(max_length=30)
    contact_last_name = models.CharField(max_length=30)

If I use Bussinesses directly, the Django will access the “bussinesses_bussinesses” table in the database, which obviously does not exist.

Because the table “bussinesses” is also used by another APP, So can’t rename it.
I want to know how to use the Django model without using table prefix, and I don’t want to use the raw database API directly.

  • 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-31T18:31:48+00:00Added an answer on May 31, 2026 at 6:31 pm

    Just use the model meta options.

    class Bussinesses(models.Model):
        business_email = models.EmailField()
        password = models.CharField(max_length=20)
        contact_first_name = models.CharField(max_length=30)
        contact_last_name = models.CharField(max_length=30)
    
        class Meta:
            db_table = "bussinesses"
    

    BTW businesses is misspelled. Since you’re specifying the name of the table you don’t have to give your model the same name as the table, so if the table name is misspelled and you can’t easily fix it, you can at least change the name of your class to the proper spelling of businesses. I would also get rid of the pluralization, and make it class Business. Finally it’s not uncommon when using Django or Rails on an existing database to need to set a custom table name for every table.

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

Sidebar

Related Questions

in a django-tastypie app I have the following Django-models: class Car(models.Model): name=models.CharField('name',max_length=64) class CarTrack(models.Model):
I have a new Django 1.3 project and app that I've created. I added
I'm new to Django... I have installed a Django external App called Haystack, this
I'm new to Django and I'm creating an app to create and display employee
I want to create a new business application using the Django framework. Any suggestions
I'm really new to Python and Django. I created a class in Python that
I create new blank solution. Add exist web site. Structure: Solution E:...\projectname Folders: bin
I can't create New Project on my Visual Web Developer 2008 Express with SP1.
I'm new to python and django but wanted to start following some tutorials. I
i am trying to create a signup form for my django app. for this

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.