Re: new to django

44 views
Skip to first unread message

Anoop Thomas Mathew

unread,
Aug 21, 2012, 11:08:38 AM8/21/12
to django...@googlegroups.com
What is the error you are getting?

atm
___
Life is short, Live it hard.




On 21 August 2012 12:57, maha <aero.ma...@gmail.com> wrote:
Hi,I am new to django. Right now I am going through the tutorial. I am 
stuck on the creating poll application. 

Here are the settings.py , 

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',
   'poll',
)

here are the models.py

from django.db import models

class Poll(models.Model):
    question = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField()

here are the urls.py,

from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'mysitee.views.home', name='home'),
    # url(r'^mysitee/', include('mysitee.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)
 i got struck, after i was running this command python manage.py shell, (i.e) while exploring the database in python shell.

do u need to show any other code, which i used.

--
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/-/V262IvOrL9kJ.
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.

Dhilip S

unread,
Aug 21, 2012, 11:08:04 AM8/21/12
to django...@googlegroups.com
Hello,

Got struct means you got any error or don't know what to do after that???? 
Just follow the tutorial, read out each and every line in the document. 
>
>
--    Dhilip.S


Joris

unread,
Aug 21, 2012, 11:18:36 AM8/21/12
to django...@googlegroups.com


On Tuesday, August 21, 2012 1:08:04 PM UTC+2, Dhilip wrote:
Hello,

Got struct means you got any error or don't know what to do after that???? 
Just follow the tutorial, read out each and every line in the document. 
>

also make sure you are following the tutorial related to the Django version you are using! Google tends to redirect you to the /dev/ version of the tutorial with is incompatible with django 1.3

jb



Melvyn Sopacua

unread,
Aug 21, 2012, 11:29:25 AM8/21/12
to django...@googlegroups.com
On 21-8-2012 9:27, maha wrote:

> i got stuck, after i was running this command *python manage.py shell,* (i.e)
> while exploring the database in python shell.

Did you forget the `python manage.py syncdb` part?

--
Melvyn Sopacua

maha

unread,
Aug 21, 2012, 4:43:06 PM8/21/12
to django...@googlegroups.com
.don know what to do after that..





Kurtis Mullins

unread,
Aug 21, 2012, 8:17:33 PM8/21/12
to django...@googlegroups.com
python manage.py runserver
Then open your browser and goto http://localhost:8000

On Tue, Aug 21, 2012 at 12:43 PM, maha <aero.ma...@gmail.com> wrote:
.don know what to do after that..

--
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/-/m5g03N065jAJ.

Enyert Viñas

unread,
Aug 21, 2012, 8:21:52 PM8/21/12
to django...@googlegroups.com
u can just do python manage.py runserver. Then django will create a "server" at localhost:8000 or 127.0.0.1:8000

2012/8/21 Kurtis Mullins <kurtis....@gmail.com>

maha

unread,
Aug 31, 2012, 10:35:56 AM8/31/12
to django...@googlegroups.com

thanks kurtis
 
Reply all
Reply to author
Forward
0 new messages