is it fine to name django apps with capital letters?

Viewed 410

In django I named my app as "Home". I created a class named "images" inside models.py and make migrations thus I got table created in my database as "Home_images". but the problem arises when I tried to execute raw query on that table.

  query = "select * from Home_images" 
  cursor.execute(query)

string query gets converted into smaller letters so django couldn't find table named "Home_images". as it tries to find for table names "home_images", which is not present in database.

2 Answers

Unquoted PostgreSQL identifiers are case-insensitive and implicitly lowercased which is database standard and documented

so

select * from Home_images 

is converted to

select * from home_images 

by PostgreSQL

If you want case sensitive return you should quote your name "Home_images"

It's Right but doesn't make queries like this in this condition your project will work file I also named my project app as 'KE' and it's working fine.

Related