Re: Accessing Django models using DJANGO_SETTINGS_MODULE

2015-03-12 Thread Tom Evans
On Sun, Mar 8, 2015 at 5:21 AM, Dheerendra Rathor wrote: > I've a django project and I've few models like ChatRoom and Chat etc > > I'm accessing the ChatRooms from commandline using ipython as follow > In [1]: import os > > In [2]: os.environ['DJANGO_SETTINGS_MODULE']

Re: Accessing Django models using DJANGO_SETTINGS_MODULE

2015-03-10 Thread Collin Anderson
Hi, Hmm... maybe try ChatRoom.objects.all().all() ? :) If you run this, you can see if it's actually running sql or not: import logging; logging.basicConfig(level=logging.DEBUG) Are you sure you're using the same database? :) Collin On Sunday, March 8, 2015 at 8:41:30 AM UTC-4, Dheerendra

Accessing Django models using DJANGO_SETTINGS_MODULE

2015-03-08 Thread Dheerendra Rathor
I've a django project and I've few models like ChatRoom and Chat etc I'm accessing the ChatRooms from commandline using ipython as follow In [1]: import os In [2]: os.environ['DJANGO_SETTINGS_MODULE'] = 'chat_project.settings' In [3]: from chat.models import Chat, ChatRoom In [4]: