Re: Playing with API- DjangoProject Part 1

2015-07-15 Thread James Schneider
Best advice is to read the overview page, and then follow the tutorial
link. After you've completed the tutorial, you should have a good
understanding of where to go and what you can do with Django:

https://docs.djangoproject.com/en/1.8/intro/overview/

-James
On Jul 15, 2015 9:51 AM, "Auj Nizkgi"  wrote:

> Thank you for your help James. I have deleted the the folder the contained
> the framework and will be starting from scratch.
>
> I completed 'learn python the hard way' along with a few more beginner
> level courses for python. I'm sure you read or get this question daily, but
> what would you recommend is a good place to start for Django. I feel I need
> some more explanations and basic level knowledge than what's on the
> djangoproject. I want to create my own landing page that has sign in and
> log in features for a set of questions to be asked. Ultimately, I want to
> get familiar with Django. I started coding about 3 months ago and I have
> absorbed a lot considering my background prior experience.
>
> Any advice would be helpful. Thanks for all the support!
>
> On Tue, Jul 14, 2015 at 7:06 PM, James Schneider 
> wrote:
>
>> > When I run the shell, I keep getting errors. Also, I have created the
>> > question three times now so when I type q.id , I get a return value of
>> 3.
>> > How can I delete them. 
>>
>> Easy enough.
>>
>> q.delete()
>>
>> You may have to perform a query to gather up the other questions that
>> you've already created and perform delete operations on each of those.
>>
>>
>> >  Also when I ask the question text (q.question_text) I
>> > get "" instead of the "Whats up".
>>
>>
>> That is odd. I'd be interested to see the series of commands that you
>> are running to get this result. Can you paste everything that you are
>> typing into the shell and all of the responses? It's almost as though
>> you've done something like p.question_text = p before printing out p.
>>
>>
>> >
>> > Any help would be greatly appreciated.
>> >
>> > The error when I run the shell:
>> >
>> > q$ python manage.py shell
>> >
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
>> > RuntimeWarning: Model 'polls.question' was already registered. Reloading
>> > models is not advised as it can lead to inconsistencies, most notably
>> with
>> > related models.
>> >   new_class._meta.apps.register_model(new_class._meta.app_label,
>> new_class)
>> >
>> >
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
>> > RuntimeWarning: Model 'polls.choice' was already registered. Reloading
>> > models is not advised as it can lead to inconsistencies, most notably
>> with
>> > related models.
>> >   new_class._meta.apps.register_model(new_class._meta.app_label,
>> new_class)
>> >
>> > Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
>> > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>> > Type "help", "copyright", "credits" or "license" for more information.
>> > (InteractiveConsole)
>> 
>> >
>>
>> While I've never seen this error before, it would seem that something
>> is amiss in your models.py and/or possibly your admin.py. I've seen a
>> few google posts saying that this error was received because they were
>> importing models in both models.py and in admin.py.
>>
>> Please post both files, along with your settings.py, which may shed
>> more light on the issue.
>>
>> -James
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/rkHCIznabR0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXKpkuF3nY%2BbLanHUEN1T9AEr%2B_0ZtbCk911U6krqqfsQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMSjUQXOubVhT3yjW_6jvHF63MxXdQzojT7rfo52JwO-tDH21A%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


Re: Playing with API- DjangoProject Part 1

2015-07-15 Thread Harish Challa
Hi all please let me know if you know how to fix following

[7/15, 21:54] h@rish!: solivr@harish-Inspiron-5421:~$ sudo apt-get update
[sudo] password for solivr:
Sorry, try again.
[sudo] password for solivr:
Sorry, try again.
[sudo] password for solivr:
[7/15, 21:55] h@rish!: solivr is not in the sudoers file.  This incident
will be reported.
[7/15, 21:55] h@rish!: Do u know how to solve it?
Thanks
Harish
On Jul 15, 2015 10:21 PM, "Auj Nizkgi"  wrote:

> Thank you for your help James. I have deleted the the folder the contained
> the framework and will be starting from scratch.
>
> I completed 'learn python the hard way' along with a few more beginner
> level courses for python. I'm sure you read or get this question daily, but
> what would you recommend is a good place to start for Django. I feel I need
> some more explanations and basic level knowledge than what's on the
> djangoproject. I want to create my own landing page that has sign in and
> log in features for a set of questions to be asked. Ultimately, I want to
> get familiar with Django. I started coding about 3 months ago and I have
> absorbed a lot considering my background prior experience.
>
> Any advice would be helpful. Thanks for all the support!
>
> On Tue, Jul 14, 2015 at 7:06 PM, James Schneider 
> wrote:
>
>> > When I run the shell, I keep getting errors. Also, I have created the
>> > question three times now so when I type q.id , I get a return value of
>> 3.
>> > How can I delete them. 
>>
>> Easy enough.
>>
>> q.delete()
>>
>> You may have to perform a query to gather up the other questions that
>> you've already created and perform delete operations on each of those.
>>
>>
>> >  Also when I ask the question text (q.question_text) I
>> > get "" instead of the "Whats up".
>>
>>
>> That is odd. I'd be interested to see the series of commands that you
>> are running to get this result. Can you paste everything that you are
>> typing into the shell and all of the responses? It's almost as though
>> you've done something like p.question_text = p before printing out p.
>>
>>
>> >
>> > Any help would be greatly appreciated.
>> >
>> > The error when I run the shell:
>> >
>> > q$ python manage.py shell
>> >
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
>> > RuntimeWarning: Model 'polls.question' was already registered. Reloading
>> > models is not advised as it can lead to inconsistencies, most notably
>> with
>> > related models.
>> >   new_class._meta.apps.register_model(new_class._meta.app_label,
>> new_class)
>> >
>> >
>> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
>> > RuntimeWarning: Model 'polls.choice' was already registered. Reloading
>> > models is not advised as it can lead to inconsistencies, most notably
>> with
>> > related models.
>> >   new_class._meta.apps.register_model(new_class._meta.app_label,
>> new_class)
>> >
>> > Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
>> > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>> > Type "help", "copyright", "credits" or "license" for more information.
>> > (InteractiveConsole)
>> 
>> >
>>
>> While I've never seen this error before, it would seem that something
>> is amiss in your models.py and/or possibly your admin.py. I've seen a
>> few google posts saying that this error was received because they were
>> importing models in both models.py and in admin.py.
>>
>> Please post both files, along with your settings.py, which may shed
>> more light on the issue.
>>
>> -James
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/rkHCIznabR0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXKpkuF3nY%2BbLanHUEN1T9AEr%2B_0ZtbCk911U6krqqfsQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMSjUQXOubVhT3yjW_6jvHF63MxXdQzojT7rfo52JwO-tDH21A%40mail.gmail.com
> 

Re: Playing with API- DjangoProject Part 1

2015-07-15 Thread Auj Nizkgi
Thank you for your help James. I have deleted the the folder the contained
the framework and will be starting from scratch.

I completed 'learn python the hard way' along with a few more beginner
level courses for python. I'm sure you read or get this question daily, but
what would you recommend is a good place to start for Django. I feel I need
some more explanations and basic level knowledge than what's on the
djangoproject. I want to create my own landing page that has sign in and
log in features for a set of questions to be asked. Ultimately, I want to
get familiar with Django. I started coding about 3 months ago and I have
absorbed a lot considering my background prior experience.

Any advice would be helpful. Thanks for all the support!

On Tue, Jul 14, 2015 at 7:06 PM, James Schneider 
wrote:

> > When I run the shell, I keep getting errors. Also, I have created the
> > question three times now so when I type q.id , I get a return value of
> 3.
> > How can I delete them. 
>
> Easy enough.
>
> q.delete()
>
> You may have to perform a query to gather up the other questions that
> you've already created and perform delete operations on each of those.
>
>
> >  Also when I ask the question text (q.question_text) I
> > get "" instead of the "Whats up".
>
>
> That is odd. I'd be interested to see the series of commands that you
> are running to get this result. Can you paste everything that you are
> typing into the shell and all of the responses? It's almost as though
> you've done something like p.question_text = p before printing out p.
>
>
> >
> > Any help would be greatly appreciated.
> >
> > The error when I run the shell:
> >
> > q$ python manage.py shell
> >
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> > RuntimeWarning: Model 'polls.question' was already registered. Reloading
> > models is not advised as it can lead to inconsistencies, most notably
> with
> > related models.
> >   new_class._meta.apps.register_model(new_class._meta.app_label,
> new_class)
> >
> >
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> > RuntimeWarning: Model 'polls.choice' was already registered. Reloading
> > models is not advised as it can lead to inconsistencies, most notably
> with
> > related models.
> >   new_class._meta.apps.register_model(new_class._meta.app_label,
> new_class)
> >
> > Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
> > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)
> 
> >
>
> While I've never seen this error before, it would seem that something
> is amiss in your models.py and/or possibly your admin.py. I've seen a
> few google posts saying that this error was received because they were
> importing models in both models.py and in admin.py.
>
> Please post both files, along with your settings.py, which may shed
> more light on the issue.
>
> -James
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/rkHCIznabR0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXKpkuF3nY%2BbLanHUEN1T9AEr%2B_0ZtbCk911U6krqqfsQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMSjUQXOubVhT3yjW_6jvHF63MxXdQzojT7rfo52JwO-tDH21A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Playing with API- DjangoProject Part 1

2015-07-14 Thread James Schneider
> When I run the shell, I keep getting errors. Also, I have created the
> question three times now so when I type q.id , I get a return value of 3.
> How can I delete them. 

Easy enough.

q.delete()

You may have to perform a query to gather up the other questions that
you've already created and perform delete operations on each of those.


>  Also when I ask the question text (q.question_text) I
> get "" instead of the "Whats up".


That is odd. I'd be interested to see the series of commands that you
are running to get this result. Can you paste everything that you are
typing into the shell and all of the responses? It's almost as though
you've done something like p.question_text = p before printing out p.


>
> Any help would be greatly appreciated.
>
> The error when I run the shell:
>
> q$ python manage.py shell
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> RuntimeWarning: Model 'polls.question' was already registered. Reloading
> models is not advised as it can lead to inconsistencies, most notably with
> related models.
>   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
>
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> RuntimeWarning: Model 'polls.choice' was already registered. Reloading
> models is not advised as it can lead to inconsistencies, most notably with
> related models.
>   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
>
> Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)

>

While I've never seen this error before, it would seem that something
is amiss in your models.py and/or possibly your admin.py. I've seen a
few google posts saying that this error was received because they were
importing models in both models.py and in admin.py.

Please post both files, along with your settings.py, which may shed
more light on the issue.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXKpkuF3nY%2BbLanHUEN1T9AEr%2B_0ZtbCk911U6krqqfsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Playing with API- DjangoProject Part 1

2015-07-14 Thread NĂ©stor
This worked for me in ubuntu:
python manage.py shell
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

*>>> from polls.models import Question, Choice*
*>>> from django.utils import timezone*

*>>> q = Question(question_text="What's up?", pub_date=timezone.now())*

*>>> q.save()*
*>>> q.id *
1
*>>> q.question_text*
"What's up?"


I just did the above and I got a message
from this page url:*https://docs.djangoproject.com/en/1.8/intro/tutorial01/
*

I hope this helps, try it again


On Tue, Jul 14, 2015 at 1:47 PM, Auj Snow  wrote:

> When I run the shell, I keep getting errors. Also, I have created the
> question three times now so when I type q.id , I get a return value of 3.
> How can I delete them. Also when I ask the question text (q.question_text)
> I get "" instead of the "Whats up".
>
> Any help would be greatly appreciated.
>
> *The error when I run the shell:*
>
> q$ python manage.py shell
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> RuntimeWarning: Model 'polls.question' was already registered. Reloading
> models is not advised as it can lead to inconsistencies, most notably with
> related models.
>   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
>
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
> RuntimeWarning: Model 'polls.choice' was already registered. Reloading
> models is not advised as it can lead to inconsistencies, most notably with
> related models.
>   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
>
> Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/46c118d5-7b70-4575-b714-edf2d05334b3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAON-vCPEDhVuEjc02_smiE8CATcbqN2FRHoAh9mQHN6wVLEuXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Playing with API- DjangoProject Part 1

2015-07-14 Thread Auj Snow
When I run the shell, I keep getting errors. Also, I have created the 
question three times now so when I type q.id , I get a return value of 3. 
How can I delete them. Also when I ask the question text (q.question_text) 
I get "" instead of the "Whats up". 

Any help would be greatly appreciated. 

*The error when I run the shell:*

q$ python manage.py shell
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
 
RuntimeWarning: Model 'polls.question' was already registered. Reloading 
models is not advised as it can lead to inconsistencies, most notably with 
related models.
  new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py:309:
 
RuntimeWarning: Model 'polls.choice' was already registered. Reloading 
models is not advised as it can lead to inconsistencies, most notably with 
related models.
  new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/46c118d5-7b70-4575-b714-edf2d05334b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.