problem with admin settings

71 views
Skip to first unread message

Sophia

unread,
Mar 17, 2012, 5:11:20 PM3/17/12
to django...@googlegroups.com
Hi all,

I'm trying to set my admin settings so I will get the web page asking for user name and password, I did all the settings that is needed and mentioned in the online django book(chapter6), but the page keep giving me this error :

Exception Type: DatabaseError
Exception Value:
no such table: django_session

this my settings.py what could be wrong with my code?

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test.db',                     
        'USER': '',                     
        'PASSWORD': '',                 
        'HOST': '',                     
        'PORT': '',                     
    }
}

Thanks in advance
Sophia

Swaroop Shankar V

unread,
Mar 17, 2012, 5:23:10 PM3/17/12
to django...@googlegroups.com
Sophia,
Please check if you have enabled the app 'django.contrib.sessions' in your INSTALLED_APPS, if not do that and then do a syncdb, this issue should be resolved.

Thanks and Regards,
Swaroop Shankar V




Sophia

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/huWdNc8xUycJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Sophia

unread,
Mar 17, 2012, 5:37:20 PM3/17/12
to django...@googlegroups.com
Thank you for helping, I had enabled it. But I don't know what's wrong with it!
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

Swaroop Shankar V

unread,
Mar 17, 2012, 5:46:25 PM3/17/12
to django...@googlegroups.com
Did you run the syncdb after enabling it? While doing a syncdb did you encounter any errors? From the error it looks like django_session table is not created.

Thanks and Regards,
Swaroop Shankar V



To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/DkRv66Jz-lYJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Sophia

unread,
Mar 18, 2012, 6:45:24 AM3/18/12
to django...@googlegroups.com
Actually I use PyCharm environment, and I right click on the database file and  click synchronization 'database.db', I think that would do the syncdb that we use in command prompt. But here I still have the problem.

Martynas Sklizmantas

unread,
Mar 18, 2012, 6:57:21 AM3/18/12
to django...@googlegroups.com
http://flask.pocoo.org/

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/hYJeERqd4bsJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Sophia

unread,
Mar 18, 2012, 6:33:33 PM3/18/12
to django...@googlegroups.com
Swaroop,

I run sync.db this is what it shows after running sync.db :

Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.

Process finished with exit code 0

without any error, but it still doesn't work, would you please help me with it, I really stuck :(

Swaroop Shankar V

unread,
Mar 19, 2012, 12:25:12 AM3/19/12
to django...@googlegroups.com

Sophia,
Could you please provide me with your settings.py file?

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0ic5kH1PfwIJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Sophia

unread,
Mar 19, 2012, 1:33:32 PM3/19/12
to django...@googlegroups.com
Of course I attach it, Thanks for helping Swaroop.
settings.py

Swaroop Shankar V

unread,
Mar 20, 2012, 9:02:53 AM3/20/12
to django...@googlegroups.com
Sophia,
I created a project, and tired your settings.py file on that project. Did a syncdb and everything is working perfectly fine at my end. As i said before it looks like due to some reason the django_session table is not getting created at your end. Instead of running syncdb from pycharm environment try to do that from the terminal and check if that table is being created or if there are not much important code in your project just zip it and send over. Will try at my end and will update you.

Thanks and Regards,
Swaroop Shankar V



To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2xcOHcE41RoJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Sophia

unread,
Mar 22, 2012, 7:28:33 AM3/22/12
to django...@googlegroups.com
Thanks again Swaroop,

I tried it by using terminal and it was ok. But I don't know what's the problem with the Pycharm environment.
Here is my code.

I really appreciate your help.

Sophia
Training.rar

Swaroop Shankar V

unread,
Mar 23, 2012, 2:33:55 PM3/23/12
to django...@googlegroups.com
Hello Sophia,

I have made some changes to the structure of your project. Now it seems to be working. Mine is a linux machine, so am completely not sure if it would work on your widows machine, but mostly it should. So please check the attachment and let me know if it works for you.

Thanks and Regards,

Swaroop Shankar V



To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zI3dCjsWYiwJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
Training.zip

Sophia

unread,
Mar 24, 2012, 8:32:50 AM3/24/12
to django...@googlegroups.com
Thanks a lot Swaroop it finally works. I really appreciate your help.

But could you please tell me what was wrong with my code I search through it and found a change in settings :

'Training.src.training'

in "INSTALLED_APPS" would you please explain why it was wrong?

and I found changing the path of 'static' file in which I think it should have been in 'src' file and I did it wrong.

I just wanted a little explanation about what you've done that it worked, apart from my previous question.

And again thanks a million for helping :)

Sophia

Swaroop Shankar V

unread,
Mar 24, 2012, 3:24:37 PM3/24/12
to django...@googlegroups.com
Sophia,

Happy to know that it worked for you. Actually there was not much issue in the files you had provided. I rearranged it since i could not understand the reason for creating a python package (src) within the root package (Training) and then creating a manage.py and settings.py within src and again having settings.py in training. The structure didn't make sense to me. That's why i rearranged your files.
If you still want to continue with your old structure following changes needs to be made. Open the manage.py file in you src folder and change 'from src import settings' to just import settings. Since your root is src you dont need to specify the from src. Next do a python manage.py syncdb. It should work. Hope that helps you. Thanks

Regards,
Swaroop Shankar V



To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/c3SwQN9pyCAJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages