"python manage.py runserver" creates not tables (tutorial)

150 views
Skip to first unread message

angelika

unread,
Nov 2, 2011, 5:42:11 AM11/2/11
to Django users
I've started the Django tutorial and I get as far as running python
manage.py runserver, but when I do, nothing happens. I get no messages
and the database connected to the project is still empty. The database
exists and I've made no modifications to any of the files created,
accept for the info to connect to the database. My settings.py has
this snippet in it:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)

If django is not able to find or connect to the database, I would
expect there to be at least an error message, right? Is there a
command I can run make sure? Any other ideas?

/Angelika

angelika

unread,
Nov 2, 2011, 5:45:00 AM11/2/11
to Django users
Sorry, title is supposed to be "python manage.py runserver" creates no
tables (tutorial)

nisa balakrishnan

unread,
Nov 2, 2011, 5:44:45 AM11/2/11
to django...@googlegroups.com, angelika
did u do a syncdb ?

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> 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.
>

angelika

unread,
Nov 2, 2011, 5:47:26 AM11/2/11
to Django users
Christ, I totally messed up this post. I did not mean "python
manage.py runserver" but "python manage.py syncdb". That is the
command that does not create any tables. Sorry.

On Nov 2, 10:44 am, nisa balakrishnan <snisa.balakrish...@gmail.com>
wrote:

kenneth gonsalves

unread,
Nov 2, 2011, 6:43:11 AM11/2/11
to django...@googlegroups.com
On Wed, 2011-11-02 at 02:47 -0700, angelika wrote:
> Christ, I totally messed up this post. I did not mean "python
> manage.py runserver" but "python manage.py syncdb". That is the
> command that does not create any tables. Sorry.
>
>
https://code.djangoproject.com/ticket/11494 - it may be due to this. To
check it out go to the shell and try:

from yourapp import * - if it fails, fix the import error and try syncdb
again.

--
regards
Kenneth Gonsalves

angelika

unread,
Nov 2, 2011, 7:37:22 AM11/2/11
to Django users
Thanks, Kenneth.

I'm new to both Python and Django. I'm doing the tutorial and I named
the site mysite, to keep it simple. Does that mean mysite is the name
of the app? And the command should be:

from mysite import *

I did that, but nothing happened. Same as with 'python manage.py
runserver'. No messages, no errors, nothing.

/Angelika

On Nov 2, 11:43 am, kenneth gonsalves <law...@thenilgiris.com> wrote:
> On Wed, 2011-11-02 at 02:47 -0700, angelika wrote:
> > Christ, I totally messed up this post. I did not mean "python
> > manage.py runserver" but "python manage.py syncdb". That is the
> > command that does not create any tables. Sorry.
>
> https://code.djangoproject.com/ticket/11494- it may be due to this. To

kenneth gonsalves

unread,
Nov 2, 2011, 7:46:39 AM11/2/11
to django...@googlegroups.com
On Wed, 2011-11-02 at 04:37 -0700, angelika wrote:
> I'm new to both Python and Django. I'm doing the tutorial and I named
> the site mysite, to keep it simple. Does that mean mysite is the name
> of the app? And the command should be:

you must have created an app under mysite - probably named 'polls' under
which you have your models.py and views.py etc
>
> from mysite import *

go to the mysite directory and type
python manage.py shell

the python shell will appear. Then type:

from polls import *

(this assumes that you have an app named polls, and that you have
populated your models.py)
>
>
--
regards
Kenneth Gonsalves

angelika

unread,
Nov 2, 2011, 7:59:14 AM11/2/11
to Django users
I'm following the tutorial on this page:
https://docs.djangoproject.com/en/1.3/intro/tutorial01/

In it, the 'python manage.py syncdb' command is supposed to be run to
create tables for the apps in the INSTALLED_APPS setting, right? And
this bit seems to come before you start creating an app. Or have I
misunderstood it?

/Angelika

kenneth gonsalves

unread,
Nov 2, 2011, 8:05:18 AM11/2/11
to django...@googlegroups.com
On Wed, 2011-11-02 at 04:59 -0700, angelika wrote:
> I'm following the tutorial on this page:
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/
>
> In it, the 'python manage.py syncdb' command is supposed to be run to
> create tables for the apps in the INSTALLED_APPS setting, right? And
> this bit seems to come before you start creating an app. Or have I
> misunderstood it?

*after* creating the app and adding at least *one* model.
--
regards
Kenneth Gonsalves

Flavia Missi

unread,
Nov 2, 2011, 8:12:09 AM11/2/11
to django...@googlegroups.com
You do not need to run syncdb before creating your first app, syncdb search for the apps in INSTALLED_APPS and sync their models with the database, so you can run it anytime. Note that if you just change an existing model syncdb won't sync anything, you'll need migrations for that.

[]'s

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.

angelika

unread,
Nov 2, 2011, 8:17:43 AM11/2/11
to Django users
Well, here I am, confessing my stupidity to the internet. Like I said,
I'm new to both Python and Django. I've been trying to run the
commands in the same terminal window where I ran the 'python manage.py
runserver'. When I run it in a separate window, it all works as
expected. The tables are created.

Sorry for taking up your time.
Until next time,
/Angelika
> @flaviamissi <http://twitter.com/flaviamissi>
> flaviamissi.com.brhttps://github.com/flaviamissi

Martin Chiteri

unread,
Nov 2, 2011, 9:55:11 AM11/2/11
to django...@googlegroups.com
What about if you do a

python manage.py sqlall

From the settings file, I do not see any of your apps added in the
list of installed apps, like

INSTALLED_APPS = (
'django.contrib.auth',

'mysite.news',
.....,
)

Martin.

Andre Terra

unread,
Nov 3, 2011, 3:31:26 AM11/3/11
to django...@googlegroups.com
$ python manage.py dbshell

If you can't reach a database shell through that, then there's something wrong with your database setup.


Cheers,
AT

Reply all
Reply to author
Forward
0 new messages