Re: i am trying to learn django from django documentation but i am getting an error message in the first part of the documentation

2021-07-04 Thread Lalit Suthar
rewrite polls/urls.py like below
path(''", views.index, name='index'),

On Fri, 25 Jun 2021 at 18:59, Symaxx  wrote:

> I started learning Django from the documentation but it was very hard for
> me and it took me a very long time to grasp the concept
>
> I suggest you try using books by w.s vincent http://wsvincent.com/books/ these
> are the best for me and them help you stay engaged
>
> On Wed, Jun 23, 2021 at 5:19 PM vatsal narula 
> wrote:
>
>> Using the URLconf defined in blogs.urls, Django tried these URL patterns,
>> in this order:
>>
>> admin/ The current path, polls/, didn’t match any of these. this is the
>> error i am getting after i wrote the following code:
>>
>>1.
>>
>>for urls.py
>>from django.contrib import admin from django.urls import include,
>>path urlpatterns = [ path('polls/', include('polls.urls')), path('admin/',
>>admin.site.urls), ]
>>2.
>>
>>for polls/urls.py
>>from django.urls import path from . import views urlpatterns = [
>>path('', views.index, name='index'), ]
>>
>> 3.for polls/views.py
>>
>>  """ from django.http import HttpResponse
>> def index(request): return HttpResponse("Hello, world. You're at the
>> polls index.") """
>>
>> *how i can i remove this error in vs code*
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/5750b076-eddf-400d-b180-4ec7d46aa0e3n%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANPYDAttdvo3pLcQQ_j5uS3T0%2BNvYB_eSXn%2BMmS%2BO9s9n0i4OQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVEmazmCMq-01YuibMWmT7ecR2kYY%2BhezB2em%3DGcbst88Q%40mail.gmail.com.


Re: i am trying to learn django from django documentation but i am getting an error message in the first part of the documentation

2021-06-25 Thread Symaxx
I started learning Django from the documentation but it was very hard for
me and it took me a very long time to grasp the concept

I suggest you try using books by w.s vincent http://wsvincent.com/books/ these
are the best for me and them help you stay engaged

On Wed, Jun 23, 2021 at 5:19 PM vatsal narula 
wrote:

> Using the URLconf defined in blogs.urls, Django tried these URL patterns,
> in this order:
>
> admin/ The current path, polls/, didn’t match any of these. this is the
> error i am getting after i wrote the following code:
>
>1.
>
>for urls.py
>from django.contrib import admin from django.urls import include, path
>urlpatterns = [ path('polls/', include('polls.urls')), path('admin/',
>admin.site.urls), ]
>2.
>
>for polls/urls.py
>from django.urls import path from . import views urlpatterns = [
>path('', views.index, name='index'), ]
>
> 3.for polls/views.py
>
>  """ from django.http import HttpResponse
> def index(request): return HttpResponse("Hello, world. You're at the polls
> index.") """
>
> *how i can i remove this error in vs code*
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5750b076-eddf-400d-b180-4ec7d46aa0e3n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANPYDAttdvo3pLcQQ_j5uS3T0%2BNvYB_eSXn%2BMmS%2BO9s9n0i4OQ%40mail.gmail.com.


i am trying to learn django from django documentation but i am getting an error message in the first part of the documentation

2021-06-23 Thread vatsal narula


Using the URLconf defined in blogs.urls, Django tried these URL patterns, 
in this order:

admin/ The current path, polls/, didn’t match any of these. this is the 
error i am getting after i wrote the following code:

   1. 
   
   for urls.py
   from django.contrib import admin from django.urls import include, path 
   urlpatterns = [ path('polls/', include('polls.urls')), path('admin/', 
   admin.site.urls), ] 
   2. 
   
   for polls/urls.py
   from django.urls import path from . import views urlpatterns = [ 
   path('', views.index, name='index'), ] 

3.for polls/views.py

 """ from django.http import HttpResponse
def index(request): return HttpResponse("Hello, world. You're at the polls 
index.") """ 

*how i can i remove this error in vs code*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5750b076-eddf-400d-b180-4ec7d46aa0e3n%40googlegroups.com.


Re: about django documentation

2021-01-31 Thread Ryan Nowakowski
I recommend following the tutorial all the way through. Getting that tutorial 
running in your own computer will answer 95% of a beginner's questions.

https://docs.djangoproject.com/en/3.1/intro/tutorial01/

On January 18, 2021 9:27:56 PM CST, a a  wrote:
>i have end the django introduction but i do not know where continue
>i was start with models but there are error in terminal
>
>NameError: name 'Person' is not defined
>
>this is link: https://docs.djangoproject.com/en/3.1/topics/db/models/
>
>-- 
>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 view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/fc1736d7-3fb0-456a-b5f4-27ace775fb70n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/764D4CB1-4D7C-4258-8DDD-74E203FCFEB1%40fattuba.com.


Re: about django documentation

2021-01-26 Thread Bmt Herald
https://www.youtube.com/watch?v=-s7e_Fy6NRU=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p=10

On Tue, Jan 19, 2021 at 5:11 PM dupakoor kannan 
wrote:

> Hi,
>
> Try this first https://youtu.be/UmljXZIypDc and read the documentation
> again.
>
> Hope it helps
>
>
>
> On Tue, Jan 19, 2021 at 8:40 AM a a  wrote:
>
>> how can i understand from documentation?
>> i was ended the introduction then i have continue to models but how can
>> i  implementation?
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/04961371-e2b4-45f3-a5b9-1354109a4799n%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADiZb_f9P8iO5d6bWk7OsHUbPEspLoBCFfJB9nHBmMOnFB7csA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD19P%3DqQGHw9DL7GZX18E%3DOSx7DVU%2BjjEs5kmcDQiDaDq28pdw%40mail.gmail.com.


Re: about django documentation

2021-01-19 Thread dupakoor kannan
Hi,

Try this first https://youtu.be/UmljXZIypDc and read the documentation
again.

Hope it helps



On Tue, Jan 19, 2021 at 8:40 AM a a  wrote:

> how can i understand from documentation?
> i was ended the introduction then i have continue to models but how can i
> implementation?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/04961371-e2b4-45f3-a5b9-1354109a4799n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADiZb_f9P8iO5d6bWk7OsHUbPEspLoBCFfJB9nHBmMOnFB7csA%40mail.gmail.com.


about django documentation

2021-01-19 Thread a a
i have end the django introduction but i do not know where continue
i was start with models but there are error in terminal

NameError: name 'Person' is not defined

this is link: https://docs.djangoproject.com/en/3.1/topics/db/models/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fc1736d7-3fb0-456a-b5f4-27ace775fb70n%40googlegroups.com.


about django documentation

2021-01-19 Thread a a
how can i understand from documentation? 
i was ended the introduction then i have continue to models but how can i  
implementation?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04961371-e2b4-45f3-a5b9-1354109a4799n%40googlegroups.com.


Re: [Django Documentation] Auto Scrolling the contents along with the page

2019-09-13 Thread Lokesh Sanapalli
yeah... the contents should be fixed on the right side just like in django 
rest framework docs. please refer to the link above

On Friday, September 13, 2019 at 7:31:58 PM UTC+5:30, mohamed khaled wrote:
>
> Do you mean when you are in the middle of the page should notes you about 
> where you in the right side ? like make bold text as marker to know you 
> where you are ???
>
> On Friday, 13 September 2019 13:54:57 UTC+2, Lokesh Sanapalli wrote:
>>
>> Hi Everyone,
>>
>> I am a big fan of django and using it since long. While reading the 
>> django documentation I felt that we need the feature of auto scrolling the 
>> right side contents along with the page.
>>
>> For example take this page: 
>> https://docs.djangoproject.com/en/2.2/topics/cache/
>>
>> As you can see from the image, there's a contents section on the right 
>> side which says what are the different topics discussed. It is very much 
>> helpful. But, while reading the doc, in the middle of the page, you don't 
>> know which section you are in. So, making that scrollable along with page 
>> makes it more convenient for reading.
>>
>>
>> [image: django_screenshot.png]
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/137804b2-43e8-4313-a35c-a23595e41859%40googlegroups.com.


Re: [Django Documentation] Auto Scrolling the contents along with the page

2019-09-13 Thread mohamed khaled
Do you mean when you are in the middle of the page should notes you about 
where you in the right side ? like make bold text as marker to know you 
where you are ???

On Friday, 13 September 2019 13:54:57 UTC+2, Lokesh Sanapalli wrote:
>
> Hi Everyone,
>
> I am a big fan of django and using it since long. While reading the django 
> documentation I felt that we need the feature of auto scrolling the right 
> side contents along with the page.
>
> For example take this page: 
> https://docs.djangoproject.com/en/2.2/topics/cache/
>
> As you can see from the image, there's a contents section on the right 
> side which says what are the different topics discussed. It is very much 
> helpful. But, while reading the doc, in the middle of the page, you don't 
> know which section you are in. So, making that scrollable along with page 
> makes it more convenient for reading.
>
>
> [image: django_screenshot.png]
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eb452fac-5803-4762-ac74-374ddf2957fa%40googlegroups.com.


Re: [Django Documentation] Auto Scrolling the contents along with the page

2019-09-13 Thread Lokesh Sanapalli
If you look at django rest framework docs, the topics are fixed on the left 
side as you scroll through.

For example take this page : 
https://www.django-rest-framework.org/api-guide/serializers/


On Friday, September 13, 2019 at 5:24:57 PM UTC+5:30, Lokesh Sanapalli 
wrote:
>
> Hi Everyone,
>
> I am a big fan of django and using it since long. While reading the django 
> documentation I felt that we need the feature of auto scrolling the right 
> side contents along with the page.
>
> For example take this page: 
> https://docs.djangoproject.com/en/2.2/topics/cache/
>
> As you can see from the image, there's a contents section on the right 
> side which says what are the different topics discussed. It is very much 
> helpful. But, while reading the doc, in the middle of the page, you don't 
> know which section you are in. So, making that scrollable along with page 
> makes it more convenient for reading.
>
>
> [image: django_screenshot.png]
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/36ef017f-7ef7-4a9c-8d26-af6334752fc8%40googlegroups.com.


Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
Hi Carsten,

Thank you!
I finally understood what's happening.
I should have added choices into each question.
Now, choice_set.all thing is working!

Thank you for your advice!

Nori

On Sunday, February 3, 2019 at 3:20:39 PM UTC-5, Carsten Fuchs wrote:
>
> Well, you're adding choices to q = Question.objects.get(pk=1). 
> But is this also the question you call the view with? 
>
> I suggest you add a few more print statements below your existing 
>
> print(question) 
>
> For example: 
>
> print(question.pk) 
> print(question.choice_set.all()) 
>
> # Or, a bit more verbose, for example: 
> for c in question.choice_set.all(): 
> print(c.pk, c) 
>
> # Is the following a valid PK among the choices printed above? 
> print(request.POST['choice']) 
>
> Best regards, 
> Carsten 
>
>
> Am 2019-02-03 um 16:58 schrieb Atsunori Kaneshige: 
> > *_Here is the codes about choice_* 
> > 
> > 
> > In [27]: q = Question.objects.get(pk=1) 
> > 
> > 
> > In [28]: q.choice_set.all() 
> > 
> > Out[28]:  
> > 
> > 
> > In [29]: q.choice_set.create(choice_text='Not much',votes=0) 
> > 
> > Out[29]:  
> > 
> > 
> > In [30]: q.choice_set.create(choice_text='The sky',votes=0) 
> > 
> > Out[30]:  
> > 
> > 
> > In [31]: c = q.choice_set.create(choice_text='Just hacking 
> again',votes=0) 
> > 
> > 
> > In [32]: c.question 
> > 
> > Out[32]:  
> > 
> > 
> > In [33]: q.choice_set.all() 
> > 
> > Out[33]: , , 
> ]> 
> > 
> > 
> > In [34]: q.choice_set.count() 
> > 
> > Out[34]: 3 
> > 
> > 
> > 
> > choice exits, or correctly working? 
> > 
> > Nori 
> > 
> > On Sunday, February 3, 2019 at 10:55:48 AM UTC-5, Atsunori Kaneshige 
> wrote: 
> > 
> > Hi Carsten, 
> > 
> > Sorry, are you talking about Writing Your First App, Part2? The page 
> below? 
> > https://docs.djangoproject.com/en/2.1/intro/tutorial02/ <
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/> 
> > 
> > Yeah, when I tried this, there was something wrong. 
> > 
> > *_I did that again. I copied and pasted my terminal below._* 
> > *_seems like migration was successful when I did before._* 
> > *_I am not sure what 'python sqlmigrate polls 001' is doing._* 
> > 
> > 
> > MacBook-Pro-3:mysite Koitaro$ python manage.py migrate 
> > 
> > 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>>. 
> > 
> >   """) 
> > 
> > Operations to perform: 
> > 
> >   Apply all migrations: admin, auth, contenttypes, polls, sessions 
> > 
> > Running migrations: 
> > 
> >   No migrations to apply. 
> > 
> > MacBook-Pro-3:mysite Koitaro$ python manage.py makemigrations polls 
> > 
> > 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>>. 
> > 
> >   """) 
> > 
> > No changes detected in app 'polls' 
> > 
> > MacBook-Pro-3:mysite Koitaro$ python manage.py sqlmigrate polls 0001 
> > 
> > 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>>. 
> > 
> >   """) 
> > 
> > BEGIN; 
> > 
> > -- 
> > 
> > -- Create model Choice 
> > 
> > -- 
> > 
> > CREATE TABLE "polls_choice" ("id" serial NOT NULL PRIMARY KEY, 
> "choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL); 
> > 
> > -- 
> > 
> > -- Create model Question 
> > 
> > -- 
> > 
> > CREATE TABLE "polls_question" ("id" serial NOT NULL PRIMARY KEY, 
> "question_text" varchar(200) NOT NULL, "pub_date" timestamp with time zone 
> NOT NULL); 
> > 
> > -- 
> > 
> > -- Add field question to choice 
> > 
> > -- 
> > 
> > ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT 
> NULL; 
> > 
> > CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" 
> ("question_id"); 
> > 
> > ALTER TABLE "polls_choice" ADD CONSTRAINT 
> "polls_choice_question_id_c5b4b260_fk_polls_question_id" FOREIGN KEY 
> ("question_id") REFERENCES "polls_question" ("id") DEFERRABLE INITIALLY 
> DEFERRED; 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
Hi Nitin,

Thank you!
I finally understood what you said.
Now working fine. Actually it was working, but I did not understand.

Thank you!

Nori

On Sunday, February 3, 2019 at 11:08:34 AM UTC-5, Nitin Kalmaste wrote:
>
> You have to add Choices for each questions you have created in database 
> like the process is same as you used for the questions.
> On Sun, Feb 3, 2019, 8:53 PM Atsunori Kaneshige   wrote:
>
>> Hi Nitin,
>>
>> Thank you for your comment.
>>
>> I did  
>>
>> jango-admin startproject mysite
>>
>> and cd mysite, then
>>
>> python manage.py runserver
>>
>> and server is working, so I did
>>
>> opython manage.py startapp polls
>>
>> polls app was successfully created, and stopped the server because I 
>> wanted to user postgresql instead of the default SQLite3(?).
>> I did below
>>
>> pg_ctl -D /user/local/var/posgres start
>>
>> postgres successfully started running, then stopped
>>
>> *By the way, I registered polls app in settings.py (I just copied and 
>> pasted part of codes from the file below)*
>> INSTALLED_APPS = [
>> 'polls.apps.PollsConfig',
>>
>> *Also, I followed the way to add postgres as database, I looked as Django 
>> docs*
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.postgresql',
>> 'NAME': 'Koitaro',
>> 'USER': '',
>> 'PASSWORD': '',
>> 'HOST': '',
>> 'PORT': '',
>> }
>> }
>>
>> *I did migration too, like migrate, makemigration etc, just copied and 
>> pasted from Django Docs*
>> *This is my models.py*
>>
>> import datetime
>> from django.db import models
>> from django.utils import timezone
>>
>> # Create your models here.
>>
>>
>> class Question(models.Model):
>> question_text = models.CharField(max_length=200)
>> pub_date = models.DateTimeField('date published')
>>
>> def __str__(self):
>> return self.question_text
>>
>> def was_published_recently(self):
>> return self.pub_date >= timezone.now() - 
>> datetime.timedelta(days=1)
>>
>>
>> class Choice(models.Model):
>> question = models.ForeignKey(Question, on_delete=models.CASCADE)
>> choice_text = models.CharField(max_length=200)
>> votes = models.IntegerField(default=0)
>>
>> def __str__(self):
>> return self.choice_text
>>
>> *mygration was successfully generated*
>> from django.db import migrations, models
>> import django.db.models.deletion
>>
>>
>> class Migration(migrations.Migration):
>>
>> initial = True
>>
>> dependencies = [
>> ]
>>
>> operations = [
>> migrations.CreateModel(
>> name='Choice',
>> fields=[
>> ('id', models.AutoField(auto_created=True, 
>> primary_key=True, serialize=False, verbose_name='ID')),
>> ('choice_text', models.CharField(max_length=200)),
>> ('votes', models.IntegerField(default=0)),
>> ],
>> ),
>> migrations.CreateModel(
>> name='Question',
>> fields=[
>> ('id', models.AutoField(auto_created=True, 
>> primary_key=True, serialize=False, verbose_name='ID')),
>> ('question_text', models.CharField(max_length=200)),
>> ('pub_date', models.DateTimeField(verbose_name='date 
>> published')),
>> ],
>> ),
>> migrations.AddField(
>> model_name='choice',
>> name='question',
>> 
>> field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, 
>> to='polls.Question'),
>> ),
>> ]
>>
>> *When I go to admin, I added 5 or 6 questions, and successfully added in 
>> database.*
>> *the database name I made is 'Koitaro'.*
>> *I registered in settings.py and I have this database named as Koitaro in 
>> my posgresql*
>>
>>
>> question has data, but choice thing doesn't seem having any data...
>>
>> I really appreciate your thoughts.
>>
>> Nori
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sunday, February 3, 2019 at 1:56:18 AM UTC-5, Nitin Kalmaste wrote:
>>>
>>> Have you migrated database and added any question there?
>>>
>>> On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige >> wrote:
>>>
 Oh, one note is that I am using postgresql.
 everything else except vote function in views.py seems working.

 Sorry, any help would be really appreciated!

 Nori

 On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige 
 wrote:
>
> Hi Django users,
>
> I started using Django recently.
> I am following the official Django tutorial.
> I am just at Writing Your First Django App, Part4, and I have been 
> just copying and pasting all codes.
>
> But I have a problem in vote.
> I inserted print(question) and this is printed in detail.html
> also, question.id is also printed.
>
> BUT, choice part doesn't seem working.
>
> **
> def vote(request, question_id):
> question = get_object_or_404(Question, 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Carsten Fuchs
Well, you're adding choices to q = Question.objects.get(pk=1).
But is this also the question you call the view with?

I suggest you add a few more print statements below your existing

print(question)

For example:

print(question.pk)
print(question.choice_set.all())

# Or, a bit more verbose, for example:
for c in question.choice_set.all():
print(c.pk, c)

# Is the following a valid PK among the choices printed above?
print(request.POST['choice'])

Best regards,
Carsten


Am 2019-02-03 um 16:58 schrieb Atsunori Kaneshige:
> *_Here is the codes about choice_*
> 
> 
> In [27]: q = Question.objects.get(pk=1)
> 
> 
> In [28]: q.choice_set.all()
> 
> Out[28]: 
> 
> 
> In [29]: q.choice_set.create(choice_text='Not much',votes=0)
> 
> Out[29]: 
> 
> 
> In [30]: q.choice_set.create(choice_text='The sky',votes=0)
> 
> Out[30]: 
> 
> 
> In [31]: c = q.choice_set.create(choice_text='Just hacking again',votes=0)
> 
> 
> In [32]: c.question
> 
> Out[32]: 
> 
> 
> In [33]: q.choice_set.all()
> 
> Out[33]: , ,  Not much>]>
> 
> 
> In [34]: q.choice_set.count()
> 
> Out[34]: 3
> 
> 
> 
> choice exits, or correctly working?
> 
> Nori
> 
> On Sunday, February 3, 2019 at 10:55:48 AM UTC-5, Atsunori Kaneshige wrote:
> 
> Hi Carsten,
> 
> Sorry, are you talking about Writing Your First App, Part2? The page 
> below?
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/ 
> 
> 
> Yeah, when I tried this, there was something wrong.
> 
> *_I did that again. I copied and pasted my terminal below._*
> *_seems like migration was successful when I did before._*
> *_I am not sure what 'python sqlmigrate polls 001' is doing._*
> 
> 
> MacBook-Pro-3:mysite Koitaro$ python manage.py migrate
> 
> 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in 
> order to keep installing from binary please use "pip install psycopg2-binary" 
> instead. For details see: 
>  >.
> 
>   """)
> 
> Operations to perform:
> 
>   Apply all migrations: admin, auth, contenttypes, polls, sessions
> 
> Running migrations:
> 
>   No migrations to apply.
> 
> MacBook-Pro-3:mysite Koitaro$ python manage.py makemigrations polls
> 
> 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in 
> order to keep installing from binary please use "pip install psycopg2-binary" 
> instead. For details see: 
>  >.
> 
>   """)
> 
> No changes detected in app 'polls'
> 
> MacBook-Pro-3:mysite Koitaro$ python manage.py sqlmigrate polls 0001
> 
> 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in 
> order to keep installing from binary please use "pip install psycopg2-binary" 
> instead. For details see: 
>  >.
> 
>   """)
> 
> BEGIN;
> 
> --
> 
> -- Create model Choice
> 
> --
> 
> CREATE TABLE "polls_choice" ("id" serial NOT NULL PRIMARY KEY, 
> "choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL);
> 
> --
> 
> -- Create model Question
> 
> --
> 
> CREATE TABLE "polls_question" ("id" serial NOT NULL PRIMARY KEY, 
> "question_text" varchar(200) NOT NULL, "pub_date" timestamp with time zone 
> NOT NULL);
> 
> --
> 
> -- Add field question to choice
> 
> --
> 
> ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT NULL;
> 
> CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" 
> ("question_id");
> 
> ALTER TABLE "polls_choice" ADD CONSTRAINT 
> "polls_choice_question_id_c5b4b260_fk_polls_question_id" FOREIGN KEY 
> ("question_id") REFERENCES "polls_question" ("id") DEFERRABLE INITIALLY 
> DEFERRED;
> 
> COMMIT;
> 
> MacBook-Pro-3:mysite Koitaro$ 
> 
> 
> 
> 
> *_After this, when I typed 'python manage.py shell',_*
> *_By the way, I am not doing this in virtual environment, is it fine?_*
> *_Django docs doesn't say anything about it._*
> 
> *_Here is the result of shell_*
> 
> MacBook-Pro-3:mysite Koitaro$ python manage.py shell
> 
> 
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in 
> order to keep installing from binary please use "pip 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Nitin Kalmaste
You have to add Choices for each questions you have created in database
like the process is same as you used for the questions.
On Sun, Feb 3, 2019, 8:53 PM Atsunori Kaneshige  Hi Nitin,
>
> Thank you for your comment.
>
> I did
>
> jango-admin startproject mysite
>
> and cd mysite, then
>
> python manage.py runserver
>
> and server is working, so I did
>
> opython manage.py startapp polls
>
> polls app was successfully created, and stopped the server because I
> wanted to user postgresql instead of the default SQLite3(?).
> I did below
>
> pg_ctl -D /user/local/var/posgres start
>
> postgres successfully started running, then stopped
>
> *By the way, I registered polls app in settings.py (I just copied and
> pasted part of codes from the file below)*
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
>
> *Also, I followed the way to add postgres as database, I looked as Django
> docs*
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': 'Koitaro',
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': '',
> 'PORT': '',
> }
> }
>
> *I did migration too, like migrate, makemigration etc, just copied and
> pasted from Django Docs*
> *This is my models.py*
>
> import datetime
> from django.db import models
> from django.utils import timezone
>
> # Create your models here.
>
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> def __str__(self):
> return self.question_text
>
> def was_published_recently(self):
> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
>
>
> class Choice(models.Model):
> question = models.ForeignKey(Question, on_delete=models.CASCADE)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
> def __str__(self):
> return self.choice_text
>
> *mygration was successfully generated*
> from django.db import migrations, models
> import django.db.models.deletion
>
>
> class Migration(migrations.Migration):
>
> initial = True
>
> dependencies = [
> ]
>
> operations = [
> migrations.CreateModel(
> name='Choice',
> fields=[
> ('id', models.AutoField(auto_created=True,
> primary_key=True, serialize=False, verbose_name='ID')),
> ('choice_text', models.CharField(max_length=200)),
> ('votes', models.IntegerField(default=0)),
> ],
> ),
> migrations.CreateModel(
> name='Question',
> fields=[
> ('id', models.AutoField(auto_created=True,
> primary_key=True, serialize=False, verbose_name='ID')),
> ('question_text', models.CharField(max_length=200)),
> ('pub_date', models.DateTimeField(verbose_name='date
> published')),
> ],
> ),
> migrations.AddField(
> model_name='choice',
> name='question',
>
> field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
> to='polls.Question'),
> ),
> ]
>
> *When I go to admin, I added 5 or 6 questions, and successfully added in
> database.*
> *the database name I made is 'Koitaro'.*
> *I registered in settings.py and I have this database named as Koitaro in
> my posgresql*
>
>
> question has data, but choice thing doesn't seem having any data...
>
> I really appreciate your thoughts.
>
> Nori
>
>
>
>
>
>
>
>
>
>
> On Sunday, February 3, 2019 at 1:56:18 AM UTC-5, Nitin Kalmaste wrote:
>>
>> Have you migrated database and added any question there?
>>
>> On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige >
>>> Oh, one note is that I am using postgresql.
>>> everything else except vote function in views.py seems working.
>>>
>>> Sorry, any help would be really appreciated!
>>>
>>> Nori
>>>
>>> On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige
>>> wrote:

 Hi Django users,

 I started using Django recently.
 I am following the official Django tutorial.
 I am just at Writing Your First Django App, Part4, and I have been just
 copying and pasting all codes.

 But I have a problem in vote.
 I inserted print(question) and this is printed in detail.html
 also, question.id is also printed.

 BUT, choice part doesn't seem working.

 **
 def vote(request, question_id):
 question = get_object_or_404(Question, pk=question_id)
 print(question)
 try:
 selected_choice =
 question.choice_set.get(pk=request.POST['choice'])
 except (KeyError, Choice.DoesNotExist) as e:
 # Redisplay the question voting form.
 print(e)
 return render(request, 'polls/detail.html', {
 'question': question,
 'error_message': "You didn't select a choice.",
 })
 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
*Here is the codes about choice*


In [27]: q = Question.objects.get(pk=1)


In [28]: q.choice_set.all()

Out[28]: 


In [29]: q.choice_set.create(choice_text='Not much',votes=0)

Out[29]: 


In [30]: q.choice_set.create(choice_text='The sky',votes=0)

Out[30]: 


In [31]: c = q.choice_set.create(choice_text='Just hacking again',votes=0)


In [32]: c.question

Out[32]: 


In [33]: q.choice_set.all()

Out[33]: , , 
]>


In [34]: q.choice_set.count()

Out[34]: 3


choice exits, or correctly working?

Nori

On Sunday, February 3, 2019 at 10:55:48 AM UTC-5, Atsunori Kaneshige wrote:
>
> Hi Carsten,
>
> Sorry, are you talking about Writing Your First App, Part2? The page below?
> https://docs.djangoproject.com/en/2.1/intro/tutorial02/
>
> Yeah, when I tried this, there was something wrong.
>
> *I did that again. I copied and pasted my terminal below.*
> *seems like migration was successful when I did before.*
> *I am not sure what 'python sqlmigrate polls 001' is doing.*
>
>
> MacBook-Pro-3:mysite Koitaro$ python manage.py migrate
>
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>
>   """)
>
> Operations to perform:
>
>   Apply all migrations: admin, auth, contenttypes, polls, sessions
>
> Running migrations:
>
>   No migrations to apply.
>
> MacBook-Pro-3:mysite Koitaro$ python manage.py makemigrations polls
>
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>
>   """)
>
> No changes detected in app 'polls'
>
> MacBook-Pro-3:mysite Koitaro$ python manage.py sqlmigrate polls 0001
>
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>
>   """)
>
> BEGIN;
>
> --
>
> -- Create model Choice
>
> --
>
> CREATE TABLE "polls_choice" ("id" serial NOT NULL PRIMARY KEY, 
> "choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL);
>
> --
>
> -- Create model Question
>
> --
>
> CREATE TABLE "polls_question" ("id" serial NOT NULL PRIMARY KEY, 
> "question_text" varchar(200) NOT NULL, "pub_date" timestamp with time zone 
> NOT NULL);
>
> --
>
> -- Add field question to choice
>
> --
>
> ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT NULL;
>
> CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" 
> ("question_id");
>
> ALTER TABLE "polls_choice" ADD CONSTRAINT 
> "polls_choice_question_id_c5b4b260_fk_polls_question_id" FOREIGN KEY 
> ("question_id") REFERENCES "polls_question" ("id") DEFERRABLE INITIALLY 
> DEFERRED;
>
> COMMIT;
>
> MacBook-Pro-3:mysite Koitaro$ 
>
>
>
> *After this, when I typed 'python manage.py shell',*
> *By the way, I am not doing this in virtual environment, is it fine?*
> *Django docs doesn't say anything about it.*
>
> *Here is the result of shell*
>
> MacBook-Pro-3:mysite Koitaro$ python manage.py shell
>
> /Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing from binary please use "pip install 
> psycopg2-binary" instead. For details see: <
> http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>
>   """)
>
> Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37) 
>
> Type 'copyright', 'credits' or 'license' for more information
>
> IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>
>
> In [1]: from polls.models import Choice, Question
>
>
> In [2]: Question.objects.all()
>
> Out[2]: , , 
> , ]>
>
>
> In [3]: from django.utils import timezone
>
>
> In [4]: q = Question(question_text='What's up?,pub_data=timezone.now())
>
>   File "", line 1
>
> q = Question(question_text='What's up?,pub_data=timezone.now())
>
>  ^
>
> SyntaxError: invalid syntax
>
>
>
> In [5]: q = Question(question_text="What's up?",pub_data=timezone.now())
>
> ---
>
> TypeError Traceback (most recent call 
> last)
>
>  in ()
>
> > 1 q = Question(question_text="What's up?",pub_data=timezone.now())
>
>
>
> /Applications/anaconda3/lib/python3.6/site-packages/django/db/models/base.py 
> in __init__(self, *args, 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
Hi Carsten,

Sorry, are you talking about Writing Your First App, Part2? The page below?
https://docs.djangoproject.com/en/2.1/intro/tutorial02/

Yeah, when I tried this, there was something wrong.

*I did that again. I copied and pasted my terminal below.*
*seems like migration was successful when I did before.*
*I am not sure what 'python sqlmigrate polls 001' is doing.*


MacBook-Pro-3:mysite Koitaro$ python manage.py migrate

/Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
in order to keep installing from binary please use "pip install 
psycopg2-binary" instead. For details see: 
.

  """)

Operations to perform:

  Apply all migrations: admin, auth, contenttypes, polls, sessions

Running migrations:

  No migrations to apply.

MacBook-Pro-3:mysite Koitaro$ python manage.py makemigrations polls

/Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
in order to keep installing from binary please use "pip install 
psycopg2-binary" instead. For details see: 
.

  """)

No changes detected in app 'polls'

MacBook-Pro-3:mysite Koitaro$ python manage.py sqlmigrate polls 0001

/Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
in order to keep installing from binary please use "pip install 
psycopg2-binary" instead. For details see: 
.

  """)

BEGIN;

--

-- Create model Choice

--

CREATE TABLE "polls_choice" ("id" serial NOT NULL PRIMARY KEY, 
"choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL);

--

-- Create model Question

--

CREATE TABLE "polls_question" ("id" serial NOT NULL PRIMARY KEY, 
"question_text" varchar(200) NOT NULL, "pub_date" timestamp with time zone 
NOT NULL);

--

-- Add field question to choice

--

ALTER TABLE "polls_choice" ADD COLUMN "question_id" integer NOT NULL;

CREATE INDEX "polls_choice_question_id_c5b4b260" ON "polls_choice" 
("question_id");

ALTER TABLE "polls_choice" ADD CONSTRAINT 
"polls_choice_question_id_c5b4b260_fk_polls_question_id" FOREIGN KEY 
("question_id") REFERENCES "polls_question" ("id") DEFERRABLE INITIALLY 
DEFERRED;

COMMIT;

MacBook-Pro-3:mysite Koitaro$ 



*After this, when I typed 'python manage.py shell',*
*By the way, I am not doing this in virtual environment, is it fine?*
*Django docs doesn't say anything about it.*

*Here is the result of shell*

MacBook-Pro-3:mysite Koitaro$ python manage.py shell

/Applications/anaconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: 
UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
in order to keep installing from binary please use "pip install 
psycopg2-binary" instead. For details see: 
.

  """)

Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37) 

Type 'copyright', 'credits' or 'license' for more information

IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.


In [1]: from polls.models import Choice, Question


In [2]: Question.objects.all()

Out[2]: , , 
, ]>


In [3]: from django.utils import timezone


In [4]: q = Question(question_text='What's up?,pub_data=timezone.now())

  File "", line 1

q = Question(question_text='What's up?,pub_data=timezone.now())

 ^

SyntaxError: invalid syntax



In [5]: q = Question(question_text="What's up?",pub_data=timezone.now())

---

TypeError Traceback (most recent call last)

 in ()

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


/Applications/anaconda3/lib/python3.6/site-packages/django/db/models/base.py 
in __init__(self, *args, **kwargs)

483 pass

484 for kwarg in kwargs:

--> 485 raise TypeError("'%s' is an invalid keyword 
argument for this function" % kwarg)

486 super().__init__()

487 post_init.send(sender=cls, instance=self)


TypeError: 'pub_data' is an invalid keyword argument for this function


In [6]: q = Question(question_text="What's up?",pub_date=timezone.now())


In [7]: q.save()


In [8]: q.id

Out[8]: 5


In [9]: q.question_text

Out[9]: "What's up?"


In [10]: q.pub_date

Out[10]: datetime.datetime(2019, 2, 3, 15, 43, 10, 354354, tzinfo=)


In [11]: q.question_text = "What's up?"


In [12]: q.save()


In [13]: Question.objects.all()

Out[13]: , , 
, , ]>


In [14]: from polls.models import Choice, Question


In [15]: Question.objects.all()

Out[15]: , 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige


On Sunday, February 3, 2019 at 10:22:56 AM UTC-5, Atsunori Kaneshige wrote:
>
> Hi Nitin,
>
> Thank you for your comment.
>
> I did  
>
> jango-admin startproject mysite
>
> and cd mysite, then
>
> python manage.py runserver
>
> and server is working, so I did
>
> opython manage.py startapp polls
>
> polls app was successfully created, and stopped the server because I 
> wanted to user postgresql instead of the default SQLite3(?).
> I did below
>
> pg_ctl -D /user/local/var/posgres start
>
> postgres successfully started running, then stopped
>
> *By the way, I registered polls app in settings.py (I just copied and 
> pasted part of codes from the file below)*
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
>
> *Also, I followed the way to add postgres as database, I looked as Django 
> docs*
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': 'Koitaro',
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': '',
> 'PORT': '',
> }
> }
>
> *I did migration too, like migrate, makemigration etc, just copied and 
> pasted from Django Docs*
> *This is my models.py*
>
> import datetime
> from django.db import models
> from django.utils import timezone
>
> # Create your models here.
>
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> def __str__(self):
> return self.question_text
>
> def was_published_recently(self):
> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
>
>
> class Choice(models.Model):
> question = models.ForeignKey(Question, on_delete=models.CASCADE)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
> def __str__(self):
> return self.choice_text
>
> *mygration was successfully generated*
> from django.db import migrations, models
> import django.db.models.deletion
>
>
> class Migration(migrations.Migration):
>
> initial = True
>
> dependencies = [
> ]
>
> operations = [
> migrations.CreateModel(
> name='Choice',
> fields=[
> ('id', models.AutoField(auto_created=True, 
> primary_key=True, serialize=False, verbose_name='ID')),
> ('choice_text', models.CharField(max_length=200)),
> ('votes', models.IntegerField(default=0)),
> ],
> ),
> migrations.CreateModel(
> name='Question',
> fields=[
> ('id', models.AutoField(auto_created=True, 
> primary_key=True, serialize=False, verbose_name='ID')),
> ('question_text', models.CharField(max_length=200)),
> ('pub_date', models.DateTimeField(verbose_name='date 
> published')),
> ],
> ),
> migrations.AddField(
> model_name='choice',
> name='question',
> 
> field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, 
> to='polls.Question'),
> ),
> ]
>
> *When I go to admin, I added 5 or 6 questions, and successfully added in 
> database.*
> *the database name I made is 'Koitaro'.*
> *I registered in settings.py and I have this database named as Koitaro in 
> my posgresql*
>
>
> question has data, but choice thing doesn't seem having any data...
>
> I really appreciate your thoughts.
>
> Nori
>
>
>
>
>
>
>
>
>
>
> On Sunday, February 3, 2019 at 1:56:18 AM UTC-5, Nitin Kalmaste wrote:
>>
>> Have you migrated database and added any question there?
>>
>> On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige >
>>> Oh, one note is that I am using postgresql.
>>> everything else except vote function in views.py seems working.
>>>
>>> Sorry, any help would be really appreciated!
>>>
>>> Nori
>>>
>>> On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige 
>>> wrote:

 Hi Django users,

 I started using Django recently.
 I am following the official Django tutorial.
 I am just at Writing Your First Django App, Part4, and I have been just 
 copying and pasting all codes.

 But I have a problem in vote.
 I inserted print(question) and this is printed in detail.html
 also, question.id is also printed.

 BUT, choice part doesn't seem working.

 **
 def vote(request, question_id):
 question = get_object_or_404(Question, pk=question_id)
 print(question)
 try:
 selected_choice = 
 question.choice_set.get(pk=request.POST['choice'])
 except (KeyError, Choice.DoesNotExist) as e:
 # Redisplay the question voting form.
 print(e)
 return render(request, 'polls/detail.html', {
 'question': question,
 'error_message': "You didn't select a choice.",
 })
 else:
 selected_choice.votes += 1
 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
Hi Nitin,

Thank you for your comment.

I did  

jango-admin startproject mysite

and cd mysite, then

python manage.py runserver

and server is working, so I did

opython manage.py startapp polls

polls app was successfully created, and stopped the server because I wanted 
to user postgresql instead of the default SQLite3(?).
I did below

pg_ctl -D /user/local/var/posgres start

postgres successfully started running, then stopped

*By the way, I registered polls app in settings.py (I just copied and 
pasted part of codes from the file below)*
INSTALLED_APPS = [
'polls.apps.PollsConfig',

*Also, I followed the way to add postgres as database, I looked as Django 
docs*
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'Koitaro',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}

*I did migration too, like migrate, makemigration etc, just copied and 
pasted from Django Docs*
*This is my models.py*

import datetime
from django.db import models
from django.utils import timezone

# Create your models here.


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

def __str__(self):
return self.question_text

def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)


class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

def __str__(self):
return self.choice_text

*mygration was successfully generated*
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
('choice_text', models.CharField(max_length=200)),
('votes', models.IntegerField(default=0)),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
('question_text', models.CharField(max_length=200)),
('pub_date', models.DateTimeField(verbose_name='date 
published')),
],
),
migrations.AddField(
model_name='choice',
name='question',

field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, 
to='polls.Question'),
),
]

*When I go to admin, I added 5 or 6 questions, and successfully added in 
database.*
*the database name I made is 'Koitaro'.*
*I registered in settings.py and I have this database named as Koitaro in 
my posgresql*


question has data, but choice thing doesn't seem having any data...

I really appreciate your thoughts.

Nori










On Sunday, February 3, 2019 at 1:56:18 AM UTC-5, Nitin Kalmaste wrote:
>
> Have you migrated database and added any question there?
>
> On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige   wrote:
>
>> Oh, one note is that I am using postgresql.
>> everything else except vote function in views.py seems working.
>>
>> Sorry, any help would be really appreciated!
>>
>> Nori
>>
>> On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige 
>> wrote:
>>>
>>> Hi Django users,
>>>
>>> I started using Django recently.
>>> I am following the official Django tutorial.
>>> I am just at Writing Your First Django App, Part4, and I have been just 
>>> copying and pasting all codes.
>>>
>>> But I have a problem in vote.
>>> I inserted print(question) and this is printed in detail.html
>>> also, question.id is also printed.
>>>
>>> BUT, choice part doesn't seem working.
>>>
>>> **
>>> def vote(request, question_id):
>>> question = get_object_or_404(Question, pk=question_id)
>>> print(question)
>>> try:
>>> selected_choice = 
>>> question.choice_set.get(pk=request.POST['choice'])
>>> except (KeyError, Choice.DoesNotExist) as e:
>>> # Redisplay the question voting form.
>>> print(e)
>>> return render(request, 'polls/detail.html', {
>>> 'question': question,
>>> 'error_message': "You didn't select a choice.",
>>> })
>>> else:
>>> selected_choice.votes += 1
>>> selected_choice.save()
>>> # Always return an HttpResponseRedirect after successfully 
>>> dealing
>>> # with POST data. This prevents data from being posted twice if a
>>> # user hits the Back button.
>>> return HttpResponseRedirect(reverse('polls:results', args=(
>>> question.id,)))
>>>
>>> **
>>> {{ 

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Malick Cisse
Hi, copy and paste wouldn't actually make you understand Django. Try to 
write the code yourself and you see how quickly your understanding grow. 

On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige 
wrote:
>
> Hi Django users,
>
> I started using Django recently.
> I am following the official Django tutorial.
> I am just at Writing Your First Django App, Part4, and I have been just 
> copying and pasting all codes.
>
> But I have a problem in vote.
> I inserted print(question) and this is printed in detail.html
> also, question.id is also printed.
>
> BUT, choice part doesn't seem working.
>
> **
> def vote(request, question_id):
> question = get_object_or_404(Question, pk=question_id)
> print(question)
> try:
> selected_choice = 
> question.choice_set.get(pk=request.POST['choice'])
> except (KeyError, Choice.DoesNotExist) as e:
> # Redisplay the question voting form.
> print(e)
> return render(request, 'polls/detail.html', {
> 'question': question,
> 'error_message': "You didn't select a choice.",
> })
> else:
> selected_choice.votes += 1
> selected_choice.save()
> # Always return an HttpResponseRedirect after successfully dealing
> # with POST data. This prevents data from being posted twice if a
> # user hits the Back button.
> return HttpResponseRedirect(reverse('polls:results', args=(
> question.id,)))
>
> **
> {{ question.question_text }}
>
> {% if error_message %}{{ error_message }}{% endif 
> %}
>
> 
> {% csrf_token %}
> {% for choice in question.choice_set.all %}
>  value="{{ choice.id }}">
> {{ choice.choice_text 
> }}
> {% endfor %}
> 
> 
>
> 
> {{ question }}
> #printed 
>  
> {{ question.id }}
> #printed
> 
> *{{ question.choice_set.all }}*
> *# #what is this? empty? why?*
> 
> {{ question.question_text }}
> #printed
> 
> {{ question.question_text }}
> #printed
> 
> *{% for choice in question.choice_set.all %}*
> *{{ choice.choice_text }}*
> *{% endfor %}*
> *#nothing printed!*
> 
>
> Also when I click button 'vote', I only get error.
> *You didn't select a choice.*
>
> I am just copying and pasting so that I can understand Django, but I am 
> having hard time in this Part 4.
>
> I really appreciate advice from anybody!
>
> Nori
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ee9f1c3-3ab0-4c26-8417-920a642a1469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Carsten Fuchs
Hi Nori,

does the choice actually exist?
Can you find it if you query the choices using the ORM in `./manage.py shell`?

Best regards,
Carsten


Am 03.02.19 um 03:59 schrieb Atsunori Kaneshige:
> Hi Django users,
> 
> I started using Django recently.
> I am following the official Django tutorial.
> I am just at Writing Your First Django App, Part4, and I have been just 
> copying and pasting all codes.
> 
> But I have a problem in vote.
> I inserted print(question) and this is printed in detail.html
> also, question.id is also printed.
> 
> BUT, choice part doesn't seem working.
> 
> **
> def vote(request, question_id):
>     question = get_object_or_404(Question, pk=question_id)
>     print(question)
>     try:
>         selected_choice = question.choice_set.get(pk=request.POST['choice'])
>     except (KeyError, Choice.DoesNotExist) as e:
>         # Redisplay the question voting form.
>         print(e)
>         return render(request, 'polls/detail.html', {
>             'question': question,
>             'error_message': "You didn't select a choice.",
>         })
>     else:
>         selected_choice.votes += 1
>         selected_choice.save()
>         # Always return an HttpResponseRedirect after successfully dealing
>         # with POST data. This prevents data from being posted twice if a
>         # user hits the Back button.
>         return HttpResponseRedirect(reverse('polls:results', 
> args=(question.id,)))
> 
> **
> {{ question.question_text }}
> 
> {% if error_message %}{{ error_message }}{% endif %}
> 
> 
> {% csrf_token %}
> {% for choice in question.choice_set.all %}
>      value="{{ choice.id }}">
>     {{ choice.choice_text 
> }}
> {% endfor %}
> 
> 
> 
> 
> {{ question }}
> #printed 
>  
> {{ question.id }}
> #printed
> 
> _{{ question.choice_set.all }}_
> _# #what is this? empty? why?_
> 
> {{ question.question_text }}
> #printed
> 
> {{ question.question_text }}
> #printed
> 
> _{% for choice in question.choice_set.all %}_
> _    {{ choice.choice_text }}_
> _{% endfor %}_
> _#nothing printed!_
> 
> 
> Also when I click button 'vote', I only get error.
> *You didn't select a choice.*
> *
> *
> I am just copying and pasting so that I can understand Django, but I am 
> having hard time in this Part 4.
> 
> I really appreciate advice from anybody!
> 
> Nori
> 

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/713d3030-a03a-453a-a169-28cf980acd2a%40cafu.de.
For more options, visit https://groups.google.com/d/optout.


Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Nitin Kalmaste
Have you migrated database and added any question there?

On Sun, Feb 3, 2019, 8:39 AM Atsunori Kaneshige  Oh, one note is that I am using postgresql.
> everything else except vote function in views.py seems working.
>
> Sorry, any help would be really appreciated!
>
> Nori
>
> On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige
> wrote:
>>
>> Hi Django users,
>>
>> I started using Django recently.
>> I am following the official Django tutorial.
>> I am just at Writing Your First Django App, Part4, and I have been just
>> copying and pasting all codes.
>>
>> But I have a problem in vote.
>> I inserted print(question) and this is printed in detail.html
>> also, question.id is also printed.
>>
>> BUT, choice part doesn't seem working.
>>
>> **
>> def vote(request, question_id):
>> question = get_object_or_404(Question, pk=question_id)
>> print(question)
>> try:
>> selected_choice =
>> question.choice_set.get(pk=request.POST['choice'])
>> except (KeyError, Choice.DoesNotExist) as e:
>> # Redisplay the question voting form.
>> print(e)
>> return render(request, 'polls/detail.html', {
>> 'question': question,
>> 'error_message': "You didn't select a choice.",
>> })
>> else:
>> selected_choice.votes += 1
>> selected_choice.save()
>> # Always return an HttpResponseRedirect after successfully dealing
>> # with POST data. This prevents data from being posted twice if a
>> # user hits the Back button.
>> return HttpResponseRedirect(reverse('polls:results', args=(
>> question.id,)))
>>
>> **
>> {{ question.question_text }}
>>
>> {% if error_message %}{{ error_message }}{% endif
>> %}
>>
>> 
>> {% csrf_token %}
>> {% for choice in question.choice_set.all %}
>> > value="{{ choice.id }}">
>> {{ choice.choice_text
>> }}
>> {% endfor %}
>> 
>> 
>>
>> 
>> {{ question }}
>> #printed
>>  
>> {{ question.id }}
>> #printed
>> 
>> *{{ question.choice_set.all }}*
>> *# #what is this? empty? why?*
>> 
>> {{ question.question_text }}
>> #printed
>> 
>> {{ question.question_text }}
>> #printed
>> 
>> *{% for choice in question.choice_set.all %}*
>> *{{ choice.choice_text }}*
>> *{% endfor %}*
>> *#nothing printed!*
>> 
>>
>> Also when I click button 'vote', I only get error.
>> *You didn't select a choice.*
>>
>> I am just copying and pasting so that I can understand Django, but I am
>> having hard time in this Part 4.
>>
>> I really appreciate advice from anybody!
>>
>> Nori
>>
>> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a581da0f-abd9-435e-8693-db9126b9bac1%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKroR%2B2iPLXaocX7_yFxLY_A2vokpRAvNc9PVOuLNbVVu3UsqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Atsunori Kaneshige
Oh, one note is that I am using postgresql.
everything else except vote function in views.py seems working.

Sorry, any help would be really appreciated!

Nori

On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige 
wrote:
>
> Hi Django users,
>
> I started using Django recently.
> I am following the official Django tutorial.
> I am just at Writing Your First Django App, Part4, and I have been just 
> copying and pasting all codes.
>
> But I have a problem in vote.
> I inserted print(question) and this is printed in detail.html
> also, question.id is also printed.
>
> BUT, choice part doesn't seem working.
>
> **
> def vote(request, question_id):
> question = get_object_or_404(Question, pk=question_id)
> print(question)
> try:
> selected_choice = 
> question.choice_set.get(pk=request.POST['choice'])
> except (KeyError, Choice.DoesNotExist) as e:
> # Redisplay the question voting form.
> print(e)
> return render(request, 'polls/detail.html', {
> 'question': question,
> 'error_message': "You didn't select a choice.",
> })
> else:
> selected_choice.votes += 1
> selected_choice.save()
> # Always return an HttpResponseRedirect after successfully dealing
> # with POST data. This prevents data from being posted twice if a
> # user hits the Back button.
> return HttpResponseRedirect(reverse('polls:results', args=(
> question.id,)))
>
> **
> {{ question.question_text }}
>
> {% if error_message %}{{ error_message }}{% endif 
> %}
>
> 
> {% csrf_token %}
> {% for choice in question.choice_set.all %}
>  value="{{ choice.id }}">
> {{ choice.choice_text 
> }}
> {% endfor %}
> 
> 
>
> 
> {{ question }}
> #printed 
>  
> {{ question.id }}
> #printed
> 
> *{{ question.choice_set.all }}*
> *# #what is this? empty? why?*
> 
> {{ question.question_text }}
> #printed
> 
> {{ question.question_text }}
> #printed
> 
> *{% for choice in question.choice_set.all %}*
> *{{ choice.choice_text }}*
> *{% endfor %}*
> *#nothing printed!*
> 
>
> Also when I click button 'vote', I only get error.
> *You didn't select a choice.*
>
> I am just copying and pasting so that I can understand Django, but I am 
> having hard time in this Part 4.
>
> I really appreciate advice from anybody!
>
> Nori
>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a581da0f-abd9-435e-8693-db9126b9bac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Atsunori Kaneshige
Hi Django users,

I started using Django recently.
I am following the official Django tutorial.
I am just at Writing Your First Django App, Part4, and I have been just 
copying and pasting all codes.

But I have a problem in vote.
I inserted print(question) and this is printed in detail.html
also, question.id is also printed.

BUT, choice part doesn't seem working.

**
def vote(request, question_id):
question = get_object_or_404(Question, pk=question_id)
print(question)
try:
selected_choice = question.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist) as e:
# Redisplay the question voting form.
print(e)
return render(request, 'polls/detail.html', {
'question': question,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
# Always return an HttpResponseRedirect after successfully dealing
# with POST data. This prevents data from being posted twice if a
# user hits the Back button.
return HttpResponseRedirect(reverse('polls:results', 
args=(question.id,)))

**
{{ question.question_text }}

{% if error_message %}{{ error_message }}{% endif %}


{% csrf_token %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text 
}}
{% endfor %}




{{ question }}
#printed 
 
{{ question.id }}
#printed

*{{ question.choice_set.all }}*
*# #what is this? empty? why?*

{{ question.question_text }}
#printed

{{ question.question_text }}
#printed

*{% for choice in question.choice_set.all %}*
*{{ choice.choice_text }}*
*{% endfor %}*
*#nothing printed!*


Also when I click button 'vote', I only get error.
*You didn't select a choice.*

I am just copying and pasting so that I can understand Django, but I am 
having hard time in this Part 4.

I really appreciate advice from anybody!

Nori

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/81acb823-ce5b-40c5-8060-573a61136697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py shell I get the console error.

2018-04-30 Thread Avitab Ayan Sarmah
Thank you Mathew now it is working fine

On Tue 1 May, 2018, 2:39 AM Matthew Pava, <matthew.p...@iss.com> wrote:

> You need a space between def and __str__
>
>
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Avitab Ayan Sarmah
> *Sent:* Monday, April 30, 2018 4:07 PM
> *To:* Django users
> *Subject:* I am following the official Django documentation and trying to
> make the polls app. But when I run the command python manage.py shell I get
> the console error.
>
>
>
> The code of my polls/models.py is:
>
> import datetime
>
>
>
> from django.db import models
>
> from django.utils import timezone
>
>
>
>
>
> class Question(models.Model):
>
> #...
>
> def was_published_recently(self):
>
> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
>
> def__str__(self):
>
> return self.question_text
>
> question_text = models.CharField(max_length=200)
>
> pub_date = models.DateTimeField('date published')
>
>
>
> class Choice(models.Model):
>
> #...
>
> def__str__(self):
>
> return self.choice_text
>
> question = models.ForeignKey(Question, on_delete=models.CASCADE)
>
> choice_text = models.CharField(max_length=200)
>
> votes = models.IntegerField(default=0)
>
>
>
> Please find the error in my code and help me run my code.The error is
> attached above
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/84560734-c5cd-4e32-9da4-7aba3202c402%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/84560734-c5cd-4e32-9da4-7aba3202c402%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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/xTxwDaYLcYk/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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/93d21fa128fa46c5a57ec72b7cfd997b%40ISS1.ISS.LOCAL
> <https://groups.google.com/d/msgid/django-users/93d21fa128fa46c5a57ec72b7cfd997b%40ISS1.ISS.LOCAL?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEx5wm7snNfKwsLCLh8H96taGkEizFQmtnChomb0CzyPZQ070g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py shell I get the console error.

2018-04-30 Thread Matthew Pava
You need a space between def and __str__

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Avitab Ayan Sarmah
Sent: Monday, April 30, 2018 4:07 PM
To: Django users
Subject: I am following the official Django documentation and trying to make 
the polls app. But when I run the command python manage.py shell I get the 
console error.

The code of my polls/models.py is:
import datetime

from django.db import models
from django.utils import timezone


class Question(models.Model):
#...
def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
def__str__(self):
return self.question_text
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
#...
def__str__(self):
return self.choice_text
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

Please find the error in my code and help me run my code.The error is attached 
above
--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84560734-c5cd-4e32-9da4-7aba3202c402%40googlegroups.com<https://groups.google.com/d/msgid/django-users/84560734-c5cd-4e32-9da4-7aba3202c402%40googlegroups.com?utm_medium=email_source=footer>.
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/93d21fa128fa46c5a57ec72b7cfd997b%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py shell I get the console error.

2018-04-30 Thread Avitab Ayan Sarmah
The code of my polls/models.py is:
import datetime

from django.db import models
from django.utils import timezone


class Question(models.Model):
#...
def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
def__str__(self):
return self.question_text
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
#...
def__str__(self):
return self.choice_text
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

Please find the error in my code and help me run my code.The error is 
attached above

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84560734-c5cd-4e32-9da4-7aba3202c402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py makemigrations polls I get the console error.

2018-04-30 Thread Avitab Ayan Sarmah
Yes I found the error George, I mistakenly typed polss in settings. Now the
code is running fine

On Tue 1 May, 2018, 1:03 AM George Lubaretsi,  wrote:

> Looks like you have a typo somewhere.
>
> Exception says that it can't find a module `polss` while it should be
> `polls`. Check your settings and imports
>
> On Mon, Apr 30, 2018 at 11:29 PM Avitab Ayan Sarmah 
> wrote:
>
>> The code I am using for the models is:
>>
>> from django.db import models
>>
>> class Question(models.Model):
>> question_text = models.CharField(max_length=200)
>> pub_date = models.DateTimeField('date published')
>>
>> class Choice(models.Model):
>>question = models.ForeignKey(Question)
>>choice_text = models.CharField(max_length=200)
>>votes = models.IntegerField(default=0)
>>
>> The code i am using for mysite/settings is:
>>
>> INSTALLED_APPS = [
>> 'polls.apps.PollsConfig',
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',]
>>
>>
>> It would be great if you could point out the error.
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/434e4e83-13f5-4688-b388-6c4d767a5273%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/zgCUS5eWxOs/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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACAWh81_WY%3Dw%2BNm%3DeCYinFJm01ZHbWk9XE2xdm6ursSb8EEnXw%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEx5wm5%3D%3D_nocV1jJ8PgSjvzYJ4TDYRPaaA5C%2BN4cFDw5LaUYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py makemigrations polls I get the console error.

2018-04-30 Thread George Lubaretsi
Looks like you have a typo somewhere.

Exception says that it can't find a module `polss` while it should be
`polls`. Check your settings and imports

On Mon, Apr 30, 2018 at 11:29 PM Avitab Ayan Sarmah 
wrote:

> The code I am using for the models is:
>
> from django.db import models
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
>question = models.ForeignKey(Question)
>choice_text = models.CharField(max_length=200)
>votes = models.IntegerField(default=0)
>
> The code i am using for mysite/settings is:
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',]
>
>
> It would be great if you could point out the error.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/434e4e83-13f5-4688-b388-6c4d767a5273%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACAWh81_WY%3Dw%2BNm%3DeCYinFJm01ZHbWk9XE2xdm6ursSb8EEnXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


I am following the official Django documentation and trying to make the polls app. But when I run the command python manage.py makemigrations polls I get the console error.

2018-04-30 Thread Avitab Ayan Sarmah


The code I am using for the models is:

from django.db import models

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

class Choice(models.Model):
   question = models.ForeignKey(Question)
   choice_text = models.CharField(max_length=200)
   votes = models.IntegerField(default=0)

The code i am using for mysite/settings is:

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',]


It would be great if you could point out the error.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/434e4e83-13f5-4688-b388-6c4d767a5273%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2017-09-11 Thread Deep Sukhwani
The answer is in the first post in this thread!

--
Regards
Deep L Sukhwani

On 11 September 2017 at 10:51, margana harika 
wrote:

>
> hello sir,
>even i got the same problem can you just tell me how did
> you solve this please!!
>
> --
> 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/LsFZVzhj4v4/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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/d81aa114-77dc-4a61-9e73-42913b8196c6%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEMqiPdbdbW62NM1Q5_UQLtcL_qEc6XGKPY1gKCHb01a9qyHAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2017-09-11 Thread margana harika

hello sir,
   even i got the same problem can you just tell me how did you 
solve this please!!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d81aa114-77dc-4a61-9e73-42913b8196c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error even after following the django documentation

2017-06-16 Thread Andréas Kühne
Hi,

Could you please include your models.py file? So that we can see the model
declarations.

Regards,

Andréas

2017-06-16 14:07 GMT+02:00 danbmathew :

> Thanks for the reply.Well i used the same model shown in the
> documentation.I even cross checked all my codes to verify that anything is
> out of place.Even then the error appears.
>
>
> On Thursday, June 15, 2017 at 11:12:55 PM UTC+5:30, Hemhem wrote:
>>
>> TypeError: 'choice_text' is an invalid keyword argument for this function
>> That above, is where the problem is where the problem is so I am going to
>> guess you need to check your model if you wrote everything correctly.
>> If I can see what your model looks like, I can probe in.
>>
>> On Thu, Jun 15, 2017 at 10:34 AM, danbmathew  wrote:
>>
>>> Well I'm new to django and my code is just as in the documentation.But
>>> got an error while trying to run the codeline q.choice_set.create(c
>>> hoice_text='Not much', votes=0).
>>> This part of the code is almost at the end of the segment named Playing
>>> With API.I will also post the error.
>>>
>>> Traceback (most recent call last):
>>>   File "", line 1, in 
>>>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib
>>> \site-packages\django\db\models\fields\related_descriptors.py", line
>>> 653, in create
>>> return super(RelatedManager, self.db_manager(db)).create(**kwargs)
>>>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib
>>> \site-packages\django\db\models\manager.py", line 85, in manager_method
>>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib
>>> \site-packages\django\db\models\query.py", line 392, in create
>>> obj = self.model(**kwargs)
>>>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib
>>> \site-packages\django\db\models\base.py", line 571, in __init__
>>> raise TypeError("'%s' is an invalid keyword argument for this
>>> function" % list(kwargs)[0])
>>> TypeError: 'choice_text' is an invalid keyword argument for this function
>>>
>>>
>>> Please help me.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/f53b5d7f-baa4-4fa6-91de-e75e4fb97af5%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Elegbede Muhammed Oladipupo
>>
>> web: www.dipoelegbede.com
>> skype: dipo.elegbede
>> mobile: (917) 860 1542 <(917)%20860-1542>
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/5bd8118a-a3e6-4590-91d7-ae4daedc9fde%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCf1-Ls5TFU3B77L6%2BuOybnSaZuFBANS9DuaR%2BkN%3Dxv7Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error even after following the django documentation

2017-06-16 Thread danbmathew
Thanks for the reply.Well i used the same model shown in the 
documentation.I even cross checked all my codes to verify that anything is 
out of place.Even then the error appears.


On Thursday, June 15, 2017 at 11:12:55 PM UTC+5:30, Hemhem wrote:
>
> TypeError: 'choice_text' is an invalid keyword argument for this function
> That above, is where the problem is where the problem is so I am going to 
> guess you need to check your model if you wrote everything correctly.
> If I can see what your model looks like, I can probe in.
>
> On Thu, Jun 15, 2017 at 10:34 AM, danbmathew  > wrote:
>
>> Well I'm new to django and my code is just as in the documentation.But 
>> got an error while trying to run the codeline q.choice_set.create(
>> choice_text='Not much', votes=0).
>> This part of the code is almost at the end of the segment named Playing 
>> With API.I will also post the error.
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File 
>> "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\fields\related_descriptors.py",
>>  
>> line 653, in create
>> return super(RelatedManager, self.db_manager(db)).create(**kwargs)
>>   File 
>> "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\manager.py",
>>  
>> line 85, in manager_method
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>   File 
>> "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py",
>>  
>> line 392, in create
>> obj = self.model(**kwargs)
>>   File 
>> "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\base.py",
>>  
>> line 571, in __init__
>> raise TypeError("'%s' is an invalid keyword argument for this 
>> function" % list(kwargs)[0])
>> TypeError: 'choice_text' is an invalid keyword argument for this function
>>
>>
>> Please help me.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f53b5d7f-baa4-4fa6-91de-e75e4fb97af5%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Elegbede Muhammed Oladipupo
>
> web: www.dipoelegbede.com
> skype: dipo.elegbede
> mobile: (917) 860 1542
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5bd8118a-a3e6-4590-91d7-ae4daedc9fde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error even after following the django documentation

2017-06-15 Thread Oladipupo Elegbede
TypeError: 'choice_text' is an invalid keyword argument for this function
That above, is where the problem is where the problem is so I am going to
guess you need to check your model if you wrote everything correctly.
If I can see what your model looks like, I can probe in.

On Thu, Jun 15, 2017 at 10:34 AM, danbmathew  wrote:

> Well I'm new to django and my code is just as in the documentation.But got
> an error while trying to run the codeline q.choice_set.create(choice_text='Not
> much', votes=0).
> This part of the code is almost at the end of the segment named Playing
> With API.I will also post the error.
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\db\models\fields\related_descriptors.py", line
> 653, in create
> return super(RelatedManager, self.db_manager(db)).create(**kwargs)
>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\db\models\manager.py", line 85, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\db\models\query.py", line 392, in create
> obj = self.model(**kwargs)
>   File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\
> lib\site-packages\django\db\models\base.py", line 571, in __init__
> raise TypeError("'%s' is an invalid keyword argument for this
> function" % list(kwargs)[0])
> TypeError: 'choice_text' is an invalid keyword argument for this function
>
>
> Please help me.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/f53b5d7f-baa4-4fa6-91de-e75e4fb97af5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Elegbede Muhammed Oladipupo

web: www.dipoelegbede.com
skype: dipo.elegbede
mobile: (917) 860 1542

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHjgLX40T5JiY-UbtE5B2rAk0kWqWGwSu5JiKKCDshHA6eZTMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Error even after following the django documentation

2017-06-15 Thread danbmathew
Well I'm new to django and my code is just as in the documentation.But got 
an error while trying to run the codeline q.choice_set.create(choice_text='Not 
much', votes=0).
This part of the code is almost at the end of the segment named Playing 
With API.I will also post the error.

Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\fields\related_descriptors.py",
 
line 653, in create
return super(RelatedManager, self.db_manager(db)).create(**kwargs)
  File 
"C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\manager.py",
 
line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File 
"C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py",
 
line 392, in create
obj = self.model(**kwargs)
  File 
"C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\base.py",
 
line 571, in __init__
raise TypeError("'%s' is an invalid keyword argument for this function" 
% list(kwargs)[0])
TypeError: 'choice_text' is an invalid keyword argument for this function


Please help me.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f53b5d7f-baa4-4fa6-91de-e75e4fb97af5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-15 Thread Dário Carvalho
Yeah, was that.

2017-02-14 17:32 GMT-02:00 Alexis Carmona <alexis...@gmail.com>:

> Hey, I checked your code on githubt and i think that you missed yo import
> your views in your urls file
>
> El lunes, 6 de febrero de 2017, 17:12:30 (UTC-4), Philip escribió:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation,
>> and I am confused as to why my url is not working. I have the most recent
>> versions of django and python (the ones that the tutorial says to use) and
>> I believe my file structure is correct, you can see it on
>> https://github.com/philipkiely/docexample to verify. However, I get a
>> 404 error when I try localhost:8000/polls/, where the documentation
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
> --
> 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/d45I92r6cCo/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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/31b1f171-cf30-49dd-9c06-02d5d4f691de%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/31b1f171-cf30-49dd-9c06-02d5d4f691de%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN%3Du3d%3Dzwb62XWZ0CpJU29om05F9axvsVBstY-oyi81FD0Lbkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-14 Thread Alexis Carmona
Hey, I checked your code on githubt and i think that you missed yo import 
your views in your urls file

El lunes, 6 de febrero de 2017, 17:12:30 (UTC-4), Philip escribió:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/31b1f171-cf30-49dd-9c06-02d5d4f691de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-14 Thread Dário Carvalho
I'm seeing your post only know. Sorry. In deed I used 127.0.0.1:8000
without the /polls when I first ran the server. When I tried with the
/polls could finally see the page.

2017-02-07 11:18 GMT-02:00 Gerald Brown <gerbre...@gmail.com>:

> Have you tried using "127.0.0.1" instead of "localhost"?  I had a similar
> problem when I used "localhost"
>
> On Tuesday, February 7, 2017 at 5:12:30 AM UTC+8, Philip wrote:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation,
>> and I am confused as to why my url is not working. I have the most recent
>> versions of django and python (the ones that the tutorial says to use) and
>> I believe my file structure is correct, you can see it on
>> https://github.com/philipkiely/docexample to verify. However, I get a
>> 404 error when I try localhost:8000/polls/, where the documentation
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
> --
> 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/d45I92r6cCo/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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN%3Du3dm5qEvycaehu8i5k5kEe4fYPDfeUbwvvM%3DhYA_8ahCwwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-07 Thread Gerald Brown
Have you tried using "127.0.0.1" instead of "localhost"?  I had a similar 
problem when I used "localhost" 

On Tuesday, February 7, 2017 at 5:12:30 AM UTC+8, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Dário Carvalho
You welcome. I'm new in django too.

Em segunda-feira, 6 de fevereiro de 2017 21:47:46 UTC-2, Philip escreveu:
>
> Solved.
>
> On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5ea8473-f14b-4a17-b10c-e769dfa802e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip
Solved.

On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/876a526c-3346-4549-ac99-edaa94c568b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip


On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f900f03f-79fa-431b-8837-43af641ddbfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip
Thanks to the link you posted, I figured it out! I had the url in the wrong 
urls file. Thank you so much!

On Monday, February 6, 2017 at 3:58:48 PM UTC-6, Dário Carvalho wrote:
>
> The "urls.py" at docexample should look like:
>
> """mysite URL Configuration
>
> The `urlpatterns` list routes URLs to views. For more information please 
> see:
> https://docs.djangoproject.com/en/1.10/topics/http/urls/
> Examples:
> Function views
> 1. Add an import:  from my_app import views
> 2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
> Class-based views
> 1. Add an import:  from other_app.views import Home
> 2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
> Including another URLconf
> 1. Import the include() function: from django.conf.urls import url, 
> include
> 2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
> """
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
>
> I think it's going to work now.
>
> Em segunda-feira, 6 de fevereiro de 2017 19:12:30 UTC-2, Philip escreveu:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0dd2a814-45dc-4784-ba43-61584e58b8c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip


Not Found: /polls/

[06/Feb/2017 23:34:00] "GET /polls/ HTTP/1.1" 404 1925

Not Found: /polls/

[06/Feb/2017 23:34:01] "GET /polls/ HTTP/1.1" 404 1925


Above is my console output. My run server command is python3 manage.py 
runserver. 
I need to use python3 as the command otherwise it does not work at all.

On Monday, February 6, 2017 at 3:21:59 PM UTC-6, Sergiy Khohlov wrote:
>
> I have not seen  setting.py in your project . Also could you please  send 
> your runserver command  and output 
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
> On Mon, Feb 6, 2017 at 7:49 PM, Philip <phil...@gmail.com > 
> wrote:
>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bac33ef0-dc27-4b5b-83ca-ebcba5f76b98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Dário Carvalho
The "urls.py" at docexample should look like:

"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please 
see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import:  from my_app import views
2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
1. Add an import:  from other_app.views import Home
2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, 
include
2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]

I think it's going to work now.

Em segunda-feira, 6 de fevereiro de 2017 19:12:30 UTC-2, Philip escreveu:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3648cd75-b76d-44d8-a0b8-8e628f7553e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Sergiy Khohlov
I have not seen  setting.py in your project . Also could you please  send
your runserver command  and output

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Feb 6, 2017 at 7:49 PM, Philip <philop...@gmail.com> wrote:

> Hello,
>
> I am working through the tutorial included with the django documentation,
> and I am confused as to why my url is not working. I have the most recent
> versions of django and python (the ones that the tutorial says to use) and
> I believe my file structure is correct, you can see it on
> https://github.com/philipkiely/docexample to verify. However, I get a 404
> error when I try localhost:8000/polls/, where the documentation tutorials
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNHMNZhdG1vdEAJowWX5GL-CPdseBd0%2BNw8F7YxN_ogcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django documentation tutorial part 1

2017-02-06 Thread Philip
Hello,

I am working through the tutorial included with the django documentation, 
and I am confused as to why my url is not working. I have the most recent 
versions of django and python (the ones that the tutorial says to use) and 
I believe my file structure is correct, you can see it on 
 https://github.com/philipkiely/docexample to verify. However, I get a 404 
error when I try localhost:8000/polls/, where the documentation tutorials 
says that I should be seeing the page that I built.

Thank you,

Philip

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation release 1.10.1a1

2016-08-30 Thread Rich Shepard

On Tue, 30 Aug 2016, Tim Graham wrote:


I don't think there have been any recent changes to the styling, but if
you'd like to contribute, the place to look is probably
https://github.com/django/django/tree/master/docs/_theme.


Tim,

  I don't know what to do once I'm on that page but when time permits I'll
look around and see if I can find the source. Wonder if it's written in
LaTeX; if so, the typefaces can easily be change.

Thanks,

Rich


Re: Django documentation release 1.10.1a1

2016-08-30 Thread Tim Graham
I don't think there have been any recent changes to the styling, but if 
you'd like to contribute, the place to look is probably 
https://github.com/django/django/tree/master/docs/_theme.

On Tuesday, August 30, 2016 at 6:15:45 PM UTC-4, Rich Shepard wrote:
>
>   I don't know how this PDF displays in other viewers, but in xpdf, mupdf, 
> and acroread important strings in the text are very difficult to read 
> because they have very low contrast with the white background. 
>
>For example, comments are in a light grey and important strings are in 
> a 
> very pale yellow. Page 14 has many examples of this. 
>
>Perhaps for very young eyeballs it's not an issue, but for those of us 
> with many miles on our eyes it's extremely hard to read this light text on 
> the white background. 
>
>It would be very helpful if this situation was quickly remedied and a 
> revised version released. 
>
> Thanks in advance, 
>
> Rich 
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0708dd3c-bcb2-4fa8-addf-e6d7241446bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django documentation release 1.10.1a1

2016-08-30 Thread Rich Shepard

  I don't know how this PDF displays in other viewers, but in xpdf, mupdf,
and acroread important strings in the text are very difficult to read
because they have very low contrast with the white background.

  For example, comments are in a light grey and important strings are in a
very pale yellow. Page 14 has many examples of this.

  Perhaps for very young eyeballs it's not an issue, but for those of us
with many miles on our eyes it's extremely hard to read this light text on
the white background.

  It would be very helpful if this situation was quickly remedied and a
revised version released.

Thanks in advance,

Rich


Re: Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2015-03-04 Thread James Schneider
Not technically a bug, although it is a common point of confusion. It
depends on how you installed Django. Both perform the same function on
their respective systems. There's a note with this link on the first page
of the tutorial, although admittedly I believe they should be more explicit
with this issue on the tutorial page.

https://docs.djangoproject.com/en/1.7/faq/troubleshooting/#troubleshooting-django-admin-py

-James
On Mar 4, 2015 10:13 PM, "Deep Sukhwani"  wrote:

> Hi,
>
> I am a newbie to this community and I am not sure how should I submit this
> bug/error in 1st part of Django Tutorial.
>
> Here's the error:
> On page Writing your first Django app, part 1 | Creating a project
>  
> notice
> it says *django-admin.py startproject mysite* whereas it should actually
> be *django-admin startproject mysite*
>
> Note: I am not sure if the documentation here: Problems running
> django-admin
> 
>  relates
> to this issue (Screenshot below):
>
>
> 
>
>
> I am on a Windows 7 64-bit machine, running Django 1.7.5 with Python 2.7.9
> (64-bit). If I run *django-admin.py startproject mysite*, I get following
> response:
>
> Usage: django-admin.py subcommand [options] [args]
>
>
> Options:
>   -v VERBOSITY, --verbosity=VERBOSITY
> Verbosity level; 0=minimal output, 1=normal output
> ,
> 2=verbose output, 3=very verbose output
>   --settings=SETTINGS   The Python path to a settings module, e.g.
> "myproject.settings.main". If this isn't
> provided, the
> DJANGO_SETTINGS_MODULE environment variable will be
> used.
>   --pythonpath=PYTHONPATH
> A directory to add to the Python path, e.g.
> "/home/djangoprojects/myproject".
>   --traceback   Raise on exception
>   --no-colorDon't colorize the command output.
>   --version show program's version number and exit
>   -h, --helpshow this help message and exit
>
>
> Type 'django-admin.py help ' for help on a specific
> subcommand.
>
>
> Available subcommands:
>
>
> [django]
> check
> compilemessages
> createcachetable
> dbshell
> diffsettings
> dumpdata
> flush
> inspectdb
> loaddata
> makemessages
> makemigrations
> migrate
> runfcgi
> runserver
> shell
> sql
> sqlall
> sqlclear
> sqlcustom
> sqldropindexes
> sqlflush
> sqlindexes
> sqlinitialdata
> sqlmigrate
> sqlsequencereset
> squashmigrations
> startapp
> startproject
> syncdb
> test
> testserver
> validate
> Note that only Django core commands are listed as settings are not
> properly configured (error: Requested setting INSTALLED_AP
> PS, but settings are not configured. You must either define the
> environment variable DJANGO_SETTINGS_MODULE or call settings.
> configure() before accessing settings.).
>
> However if I run, *django-admin startproject mysite*, the new mysite
> directory is created along with all the default files
>
> --
> 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/78dc0cb3-6269-40ca-9c08-358e9a67d0fd%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/CA%2Be%2BciUMv7B96igb8eUyudfEc30_rEnGrtGc_8OxQwaLGE%3DYGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2015-03-04 Thread Deep Sukhwani
Hi,

I am a newbie to this community and I am not sure how should I submit this 
bug/error in 1st part of Django Tutorial.

Here's the error:
On page Writing your first Django app, part 1 | Creating a project 
 
notice 
it says *django-admin.py startproject mysite* whereas it should actually be 
*django-admin 
startproject mysite*

Note: I am not sure if the documentation here: Problems running django-admin 

 relates 
to this issue (Screenshot below):




I am on a Windows 7 64-bit machine, running Django 1.7.5 with Python 2.7.9 
(64-bit). If I run *django-admin.py startproject mysite*, I get following 
response:

Usage: django-admin.py subcommand [options] [args]


Options:
  -v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, 
the
DJANGO_SETTINGS_MODULE environment variable will be
used.
  --pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
  --traceback   Raise on exception
  --no-colorDon't colorize the command output.
  --version show program's version number and exit
  -h, --helpshow this help message and exit


Type 'django-admin.py help ' for help on a specific subcommand.


Available subcommands:


[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqldropindexes
sqlflush
sqlindexes
sqlinitialdata
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
syncdb
test
testserver
validate
Note that only Django core commands are listed as settings are not properly 
configured (error: Requested setting INSTALLED_AP
PS, but settings are not configured. You must either define the environment 
variable DJANGO_SETTINGS_MODULE or call settings.
configure() before accessing settings.).

However if I run, *django-admin startproject mysite*, the new mysite 
directory is created along with all the default files

-- 
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/78dc0cb3-6269-40ca-9c08-358e9a67d0fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: trouble logging in to post ticket for django documentation

2014-08-22 Thread Steve
Thanks Russ.  Everything's peachy.

I poked around enough before posting my message that I ought have put that 
together myself.  Sorry to have bothered you.  Cheers.

On Friday, 22 August 2014 20:33:58 UTC-4, Russell Keith-Magee wrote:
>
> Hi Steve,
>
> We recently changed the login procedures for our Trac instance, and we're 
> still shaking out some of the bugs. In this case, the forbidden page has 
> the wrong link on it. If you want to log in with your Github account, visit:
>
> https://code.djangoproject.com/github/login
>
> then go ahead an lodge your ticket.
>
> Apologies for the inconvenience.
>
> Yours,
> Russ Magee %-)
>
>
>
> On Sat, Aug 23, 2014 at 4:06 AM, Steve  
> wrote:
>
>> Total noob here.  I'm working through the (very helpful) django 
>> tutorials.  I'd like to enter a suggestion ticket.  I've created a github 
>> account and logged into it, yet I still receive the following error message 
>> from code.djangoproject.com:
>>
>> You are currently not logged in. You may want to do so 
>>  now.
>>  Error: Forbidden
>>
>> TICKET_CREATE privileges are required to perform this operation. You 
>> don't have the required permissions.
>>
>> I try to login again via the "do so" link above; I enter my new github 
>> username and password but instead of logging in I'm stuck in an infinite 
>> loop whereby I'm asked for my login credentials forever.  What gives? 
>>  Cheers.
>>  
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/b2505d7c-769e-4e4a-8bb4-4f4e988fb8b4%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/68333c36-fd6f-46fb-b13a-4549d34372de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: trouble logging in to post ticket for django documentation

2014-08-22 Thread Russell Keith-Magee
Hi Steve,

We recently changed the login procedures for our Trac instance, and we're
still shaking out some of the bugs. In this case, the forbidden page has
the wrong link on it. If you want to log in with your Github account, visit:

https://code.djangoproject.com/github/login

then go ahead an lodge your ticket.

Apologies for the inconvenience.

Yours,
Russ Magee %-)



On Sat, Aug 23, 2014 at 4:06 AM, Steve  wrote:

> Total noob here.  I'm working through the (very helpful) django tutorials.
>  I'd like to enter a suggestion ticket.  I've created a github account and
> logged into it, yet I still receive the following error message from
> code.djangoproject.com:
>
> You are currently not logged in. You may want to do so
>  now.
> Error: Forbidden
>
> TICKET_CREATE privileges are required to perform this operation. You don't
> have the required permissions.
>
> I try to login again via the "do so" link above; I enter my new github
> username and password but instead of logging in I'm stuck in an infinite
> loop whereby I'm asked for my login credentials forever.  What gives?
>  Cheers.
>
> --
> 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/b2505d7c-769e-4e4a-8bb4-4f4e988fb8b4%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/CAJxq848ggQ76NSMYffHYdE-abHgLGWVhwPqJ15j4amU9Tqc9KQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


trouble logging in to post ticket for django documentation

2014-08-22 Thread Steve
Total noob here.  I'm working through the (very helpful) django tutorials. 
 I'd like to enter a suggestion ticket.  I've created a github account and 
logged into it, yet I still receive the following error message from 
code.djangoproject.com:

You are currently not logged in. You may want to do so 
 now.
Error: Forbidden

TICKET_CREATE privileges are required to perform this operation. You don't 
have the required permissions.

I try to login again via the "do so" link above; I enter my new github 
username and password but instead of logging in I'm stuck in an infinite 
loop whereby I'm asked for my login credentials forever.  What gives? 
 Cheers.

-- 
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/b2505d7c-769e-4e4a-8bb4-4f4e988fb8b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: In the Django documentation, Where can I found URLS.PY Symbol explanations?

2014-06-19 Thread Mike Dewhirst

On 20/06/2014 8:26 AM, Uzi Lumbroso wrote:

?In the Django documentation, Where can I found URLS.PY Symbol
explanations (for example: (?P[-\w]+)).  What is
... [-\w]+) matches

I couldn’t find it in the Django documentation. Thanks for the help


It is more or less plain Python rather than Django. Google for "python 
regex" or "python regular expression"


Here's one which is easy to follow ...

http://www.diveintopython.net/regular_expressions/

Good luck

Mike



--
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto: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/5920ca19-42e9-43c0-8b1b-b2b1bb2acea3%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/5920ca19-42e9-43c0-8b1b-b2b1bb2acea3%40googlegroups.com?utm_medium=email_source=footer>.
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/53A36860.3000100%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


In the Django documentation, Where can I found URLS.PY Symbol explanations?

2014-06-19 Thread Uzi Lumbroso


?In the Django documentation, Where can I found URLS.PY Symbol  
explanations (for example: (?P[-\w]+)).  What is ... [-\w]+) 
matches

I couldn’t find it in the Django documentation. Thanks for the help

-- 
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/5920ca19-42e9-43c0-8b1b-b2b1bb2acea3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django documentation tutorial 3 questions. home page missing.

2014-05-09 Thread François Schiettecatte
Presumably because there is nothing set to handle localhost:8000/ in your 
urlpatterns  like this:

# Root view, goes to 'app.home.views.page' (r'^$', 
'app.home.views.page'), 


François

On May 8, 2014, at 11:46 PM, cheesiong lim  wrote:

> hi all,
>  i am learning django by using django 1.6 documents tutorial 1 - 6.
>  this round is my 4th try and, previous 3 try was successful and i understand 
> more on every try.
> 
>  i am in tutorial 3 now, to create views.
> 
>  according to the documents, after i created a view, i need to map it to a 
> URL.
>  so i follow the documents to add a urls.py in the polls directory.
>  and then i follow the document to add include() to mysite/urls.py
>  i am able to so called wired an index view into the polls view.
> 
>  now if i go back to localhost:8000, i get an error page,
>  so my question is
>  1) WHY?
>  2) how to get back my localhost:8080 index page co-exist with  the polls 
> index page?
> 
> thank you very much everyone for your time. i am new and sorry for so simple 
> question.
> thank you.
> 
> 
> 
> 
> 
> 
> -- 
> 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/f3f727db-3c1f-493d-a581-f19376a9a6d8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


django documentation tutorial 3 questions. home page missing.

2014-05-08 Thread cheesiong lim
hi all,
 i am learning django by using django 1.6 documents tutorial 1 - 6.
 this round is my 4th try and, previous 3 try was successful and i 
understand more on every try.

 i am in tutorial 3 now, to create views.

 according to the documents, after i created a view, i need to map it to a 
URL.
 so i follow the documents to add a urls.py in the polls directory.
 and then i follow the document to add include() to mysite/urls.py
 i am able to so called wired an index view into the polls view.

 now if i go back to localhost:8000, i get an error page,
 so my question is
* 1) WHY?*
* 2) how to get back my localhost:8080 index page co-exist with  the polls 
index page?*

thank you very much everyone for your time. i am new and sorry for so 
simple question.
thank you.





-- 
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/f3f727db-3c1f-493d-a581-f19376a9a6d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unofficial Kindle builds of the Django documentation

2014-01-17 Thread Alex Strickland

Hi Markus


I've done .mobi builds of the Django documentation so you can read it on
a Kindle:


Cool! Thanks. Will check it out.

--
Regards
Alex

--
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/52D8FB87.8010605%40mweb.co.za.
For more options, visit https://groups.google.com/groups/opt_out.


Unofficial Kindle builds of the Django documentation

2014-01-16 Thread Markus Amalthea Magnuson
Hey all,

I've done .mobi builds of the Django documentation so you can read it on a 
Kindle:

http://alimony.github.io/django-docs-kindle/

Just thought people here might be interested :)

-- 
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/44a36d4d-12c1-4dd0-bb3d-a55302628448%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django documentation code ?

2013-07-26 Thread Mike Dewhirst

On 27/07/2013 3:37am, Vinod Halaharvi wrote:

Is there a way to download just the code examples listed in the Django
documentation pages ?


That's not necessarily a good idea but it depends what you want to do..

Why do you want to do that?

It wouldn't be too difficult to write a little screen scraper using requests

http://docs.python-requests.org/en/latest/




VH

--
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.
For more options, visit https://groups.google.com/groups/opt_out.




--
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.
For more options, visit https://groups.google.com/groups/opt_out.




Django documentation code ?

2013-07-26 Thread Vinod Halaharvi
Is there a way to download just the code examples listed in the Django 
documentation pages ? 

VH

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Remove Django Documentation Items

2013-04-24 Thread Trevor Reed
Hello guys, is it possible to remove entries from the Django generated 
Documentation?


Thanks

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django Documentation

2013-04-24 Thread Trevor Reed
Hello, 
 


 I am relatively new to Django, but I love it so far. Is it possible to 
remove categories from the application documentation page, such as Tags, 
Filters, and Views.



Thank You

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Possible bug in the Django documentation

2012-05-14 Thread Joseph Mornin

Ah. I didn't notice that I was using the dev documentation. Thanks!

On 5/14/12 10:04 AM, Alasdair Nicol wrote:

Hi Joseph,

On 14/05/12 14:26, Joseph Mornin wrote:

Hi,

I noticed a possible bug in the Django documentation. The
authentication docs (athttps://docs.djangoproject.com/en/dev/topics/auth/)
include this sample code for registration/login.html:http://dpaste.com/747993/

Running this code gives me this error:

###
TemplateSyntaxError at /login

Caught NoReverseMatch while rendering: Reverse for
''django.contrib.auth.views.login'' with arguments '()' and keyword
arguments '{}' not found.
###

I was able to fix this by removing the quotes around the url parameter
on line 9 (with help from this StackOverflow question:
http://stackoverflow.com/questions/4578685/noreversematch-while-rendering-reverse-for-django-contrib-auth-views-login).

Hope this is useful.

Cheers,
J.


In earlier versions of Django, the url tag did not use quotes. Starting
in Django 1.3, this was gradually changed so that the url tag was
consistent with other tags. The change is described in the release notes
for Django 1.3 [1]

The url you link to is for the development version of Django. If you
look at the same page for Django 1.4 [2], you'll see that the template
includes the following statement.

{%  load  url  from  future  %}

If you don't include this, then the alternative is to remove the quotes,
as you found.

Hope that explains things.

Cheers,
Alasdair


https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi
https://docs.djangoproject.com/en/1.4/topics/auth/


--
Alasdair Nicol
Developer, MEMSET

mail:alasd...@memset.com
  web:http://www.memset.com/

Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, 
Surrey, GU2 7YD, UK.

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


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



Re: Possible bug in the Django documentation

2012-05-14 Thread Alasdair Nicol

Hi Joseph,

On 14/05/12 14:26, Joseph Mornin wrote:

Hi,

I noticed a possible bug in the Django documentation. The
authentication docs (at https://docs.djangoproject.com/en/dev/topics/auth/)
include this sample code for registration/login.html: http://dpaste.com/747993/

Running this code gives me this error:

###
TemplateSyntaxError at /login

Caught NoReverseMatch while rendering: Reverse for
''django.contrib.auth.views.login'' with arguments '()' and keyword
arguments '{}' not found.
###

I was able to fix this by removing the quotes around the url parameter
on line 9 (with help from this StackOverflow question:
http://stackoverflow.com/questions/4578685/noreversematch-while-rendering-reverse-for-django-contrib-auth-views-login).

Hope this is useful.

Cheers,
J.

In earlier versions of Django, the url tag did not use quotes. Starting 
in Django 1.3, this was gradually changed so that the url tag was 
consistent with other tags. The change is described in the release notes 
for Django 1.3 [1]


The url you link to is for the development version of Django. If you 
look at the same page for Django 1.4 [2], you'll see that the template 
includes the following statement.


{%  load  url  from  future  %}

If you don't include this, then the alternative is to remove the quotes, 
as you found.


Hope that explains things.

Cheers,
Alasdair


https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi
https://docs.djangoproject.com/en/1.4/topics/auth/


--
Alasdair Nicol
Developer, MEMSET

mail: alasd...@memset.com
 web: http://www.memset.com/

Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, 
Surrey, GU2 7YD, UK.

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



Possible bug in the Django documentation

2012-05-14 Thread Joseph Mornin
Hi,

I noticed a possible bug in the Django documentation. The
authentication docs (at https://docs.djangoproject.com/en/dev/topics/auth/)
include this sample code for registration/login.html: http://dpaste.com/747993/

Running this code gives me this error:

###
TemplateSyntaxError at /login

Caught NoReverseMatch while rendering: Reverse for
''django.contrib.auth.views.login'' with arguments '()' and keyword
arguments '{}' not found.
###

I was able to fix this by removing the quotes around the url parameter
on line 9 (with help from this StackOverflow question:
http://stackoverflow.com/questions/4578685/noreversematch-while-rendering-reverse-for-django-contrib-auth-views-login).

Hope this is useful.

Cheers,
J.

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



Re: Django documentation search not working

2010-10-07 Thread NoviceSortOf

Steve:

Thanks, the problem must be Firefox plugin I'm running because Opera
works just
fine. Thanks for the suggestion.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django documentation search not working

2010-10-02 Thread Steve Holden
On 10/2/2010 4:45 PM, NoviceSortOf wrote:
> I used to be able to go to the following link and
> seach django documents.
> 
> http://docs.djangoproject.com/en/dev//search/
> 
>>From there I could search anything from 'widgets' to
> 'login()' and find the related document/page discussion that time.
> 
> Now on that page search yields no results irregardless of what
> I search for .
> 
> Using the search field on
> http://docs.djangoproject.com/en/1.2/
> 
> Also does not yield any results.
> 
> Strange thing is that I can search from www.google.com
> django login() and get access to django docs but can't search
> django docs from the django website any explanation?
> 
Are you maybe running NoScript or some other script inhibiting extension
to your browser? The search feature's working just fine for me.

regards
 Steve
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django documentation search not working

2010-10-02 Thread diogobaeder
Hi there,

I cannot enter the site at all, right now; I just opened a post here
about that: 
http://groups.google.com.br/group/django-users/browse_thread/thread/18a99e355c601fc3?hl=pt-BR

Does it have anything to do with the issue stated above?

Thanks!

Diogo



On 2 out, 17:45, NoviceSortOf  wrote:
> I used to be able to go to the following link and
> seach django documents.
>
> http://docs.djangoproject.com/en/dev//search/
>
> From there I could search anything from 'widgets' to
> 'login()' and find the related document/page discussion that time.
>
> Now on that page search yields no results irregardless of what
> I search for .
>
> Using the search field onhttp://docs.djangoproject.com/en/1.2/
>
> Also does not yield any results.
>
> Strange thing is that I can search fromwww.google.com
> django login() and get access to django docs but can't search
> django docs from the django website any explanation?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django documentation search not working

2010-10-02 Thread NoviceSortOf
I used to be able to go to the following link and
seach django documents.

http://docs.djangoproject.com/en/dev//search/

>From there I could search anything from 'widgets' to
'login()' and find the related document/page discussion that time.

Now on that page search yields no results irregardless of what
I search for .

Using the search field on
http://docs.djangoproject.com/en/1.2/

Also does not yield any results.

Strange thing is that I can search from www.google.com
django login() and get access to django docs but can't search
django docs from the django website any explanation?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't build Django documentation

2010-08-18 Thread Kevin
Thanks for that info.  I downgraded to Sphinx 0.6.6 and all is well.

On Aug 14, 11:14 am, Ramiro Morales  wrote:
> On Sat, Aug 14, 2010 at 9:07 AM, DrBloodmoney  wrote:
>
> > The docs [0] mention an incompatibility with the currently released
> > Sphinx. I can't build right now either, and I'm too lazy to install
> > Sphinx from source.
>
> > [0]http://docs.djangoproject.com/en/dev/intro/whatsnext/#as-html-locally
>
> That's and outdated and misleading note. Thanks for pointing it. I' ve
> opened ticket 14111 to get rid of it.
>
> --
> Ramiro Morales  | http://rmorales.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't build Django documentation

2010-08-14 Thread Ramiro Morales
On Sat, Aug 14, 2010 at 9:07 AM, DrBloodmoney  wrote:
>
> The docs [0] mention an incompatibility with the currently released
> Sphinx. I can't build right now either, and I'm too lazy to install
> Sphinx from source.
>
> [0] http://docs.djangoproject.com/en/dev/intro/whatsnext/#as-html-locally

That's and outdated and misleading note. Thanks for pointing it. I' ve
opened ticket 14111 to get rid of it.

-- 
Ramiro Morales  |  http://rmorales.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't build Django documentation

2010-08-14 Thread bagheera

Dnia 14-08-2010 o 05:11:25 Kevin  napisał(a):


I tried to build the Django docs and got an error.

$ cd django/docs/
$ make html
sphinx-build -b djangohtml -d _build/doctrees   . _build/html
Running Sphinx v1.0.1
loading pickled environment... not yet created
building [djangohtml]: targets for 427 source files that are out of
date
updating environment: 427 added, 0 changed, 0 removed
/Users/haitran/Desktop/obnob_project/src/django_docs/_ext/
djangodocs.py:91: DeprecationWarning: xfileref_role is deprecated, use
XRefRole
  xrefs = sphinx.roles.xfileref_role('ref', linktext, linktext,
lineno, state)
reading sources... [ 73%] ref/contrib/gis/
commands
Exception occurred:
  File "/Users/src/django_docs/_ext/djangodocs.py", line 215, in
parse_django_adminopt_node
from sphinx.directives.desc import option_desc_re
ImportError: No module named desc
The full traceback has been saved in /var/folders/od/
odl44I41FT0yZPHQw8kT8E+++TM/-Tmp-/sphinx-err-RgDvku.log, if you want
to report the issue to the developers.
Please also report this if it was a user error, so that a better error
message can be provided next time.
Either send bugs to the mailing list at ,
or report them in the tracker at . Thanks!
make: *** [html] Error 1

The process fails when it tries to do an import:

from sphinx.directives.desc import option_desc_re

Why is there no module named desc?

I am using:
Python 2.6
Sphinx 1.0.1
Django 1.2.1
Mac OS X 10.5.8



I had a same problem while ago, when i needed offline docs. So i just used  
wget to mirror http://docs.djangoproject.com/en/1.2/


http://www.devarticles.com/c/a/Web-Services/Website-Mirroring-With-wget/1/

--
Linux user

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't build Django documentation

2010-08-14 Thread Ramiro Morales
On Sat, Aug 14, 2010 at 12:11 AM, Kevin  wrote:
> I tried to build the Django docs and got an error.
>
> $ cd django/docs/
> $ make html
> sphinx-build -b djangohtml -d _build/doctrees   . _build/html
> Running Sphinx v1.0.1
> [...]
> Exception occurred:
>  File "/Users/src/django_docs/_ext/djangodocs.py", line 215, in
> parse_django_adminopt_node
>    from sphinx.directives.desc import option_desc_re
> ImportError: No module named desc
> The full traceback has been saved in /var/folders/od/
> odl44I41FT0yZPHQw8kT8E+++TM/-Tmp-/sphinx-err-RgDvku.log, if you want
> to report the issue to the developers.
> Please also report this if it was a user error, so that a better error
> message can be provided next time.
> Either send bugs to the mailing list at  group/sphinx-dev/>,
> or report them in the tracker at  sphinx/issues/>. Thanks!
> make: *** [html] Error 1
>
> The process fails when it tries to do an import:
>
> from sphinx.directives.desc import option_desc_re
>
> Why is there no module named desc?
>
> I am using:
> Python 2.6
> Sphinx 1.0.1
> Django 1.2.1
> Mac OS X 10.5.8
>

That compatibility problem (Sphinx 1.0 and 1.0.1 were releases after Django 1.2)
wea fixed on Django trunk and on the 1.2.x branch so the fix will be
included with the 1.2.2 release.

Meanwhile I think you can fix you problem in two ways, either

1. Overwrite you docs/_ext/djangodocs.py with this file

   
http://code.djangoproject.com/svn/django/branches/releases/1.2.X/docs/_ext/djangodocs.py

2. or downgrade your Sphinx installation to 0.6.x (0.6.6 is the latest ATM).

...an retry building the docs.

We still have some incompatibility details when using Sphinx 1.0.x (one because
of further fixes needed on the Django docs and one that are waiting for some
fixes on Sphinx once the 1.0 dust settles, neither of them prevents you building
the docs like the problem you are experimenting now but they cripple
a bit the links between documents), see Django tickets  [1]14033 and
[2]14085.

So you might prefer to use option 2 for now.

-- 
Ramiro Morales  |  http://rmorales.net


1. http://code.djangoproject.com/ticket/14033
2. http://code.djangoproject.com/ticket/14085

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't build Django documentation

2010-08-14 Thread DrBloodmoney
On Fri, Aug 13, 2010 at 11:11 PM, Kevin  wrote:
> I tried to build the Django docs and got an error.
>
> $ cd django/docs/
> $ make html
> sphinx-build -b djangohtml -d _build/doctrees   . _build/html
> Running Sphinx v1.0.1
> loading pickled environment... not yet created
> building [djangohtml]: targets for 427 source files that are out of
> date
> updating environment: 427 added, 0 changed, 0 removed
> /Users/haitran/Desktop/obnob_project/src/django_docs/_ext/
> djangodocs.py:91: DeprecationWarning: xfileref_role is deprecated, use
> XRefRole
>  xrefs = sphinx.roles.xfileref_role('ref', linktext, linktext,
> lineno, state)
> reading sources... [ 73%] ref/contrib/gis/
> commands
> Exception occurred:
>  File "/Users/src/django_docs/_ext/djangodocs.py", line 215, in
> parse_django_adminopt_node
>    from sphinx.directives.desc import option_desc_re
> ImportError: No module named desc
> The full traceback has been saved in /var/folders/od/
> odl44I41FT0yZPHQw8kT8E+++TM/-Tmp-/sphinx-err-RgDvku.log, if you want
> to report the issue to the developers.
> Please also report this if it was a user error, so that a better error
> message can be provided next time.
> Either send bugs to the mailing list at  group/sphinx-dev/>,
> or report them in the tracker at  sphinx/issues/>. Thanks!
> make: *** [html] Error 1
>
> The process fails when it tries to do an import:
>
> from sphinx.directives.desc import option_desc_re
>
> Why is there no module named desc?
>
> I am using:
> Python 2.6
> Sphinx 1.0.1
> Django 1.2.1
> Mac OS X 10.5.8

The docs [0] mention an incompatibility with the currently released
Sphinx. I can't build right now either, and I'm too lazy to install
Sphinx from source.

[0] http://docs.djangoproject.com/en/dev/intro/whatsnext/#as-html-locally

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can't build Django documentation

2010-08-13 Thread Kevin
I tried to build the Django docs and got an error.

$ cd django/docs/
$ make html
sphinx-build -b djangohtml -d _build/doctrees   . _build/html
Running Sphinx v1.0.1
loading pickled environment... not yet created
building [djangohtml]: targets for 427 source files that are out of
date
updating environment: 427 added, 0 changed, 0 removed
/Users/haitran/Desktop/obnob_project/src/django_docs/_ext/
djangodocs.py:91: DeprecationWarning: xfileref_role is deprecated, use
XRefRole
  xrefs = sphinx.roles.xfileref_role('ref', linktext, linktext,
lineno, state)
reading sources... [ 73%] ref/contrib/gis/
commands
Exception occurred:
  File "/Users/src/django_docs/_ext/djangodocs.py", line 215, in
parse_django_adminopt_node
from sphinx.directives.desc import option_desc_re
ImportError: No module named desc
The full traceback has been saved in /var/folders/od/
odl44I41FT0yZPHQw8kT8E+++TM/-Tmp-/sphinx-err-RgDvku.log, if you want
to report the issue to the developers.
Please also report this if it was a user error, so that a better error
message can be provided next time.
Either send bugs to the mailing list at ,
or report them in the tracker at . Thanks!
make: *** [html] Error 1

The process fails when it tries to do an import:

from sphinx.directives.desc import option_desc_re

Why is there no module named desc?

I am using:
Python 2.6
Sphinx 1.0.1
Django 1.2.1
Mac OS X 10.5.8

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django documentation error? (minor, but misleading)

2009-12-09 Thread chefsmart
On the page http://www.djangoproject.com/documentation/models/many_to_many/
under Sample API Usage

where it says: -

"
# Add a Publication directly via publications.add by using keyword
arguments.
>>> new_publication = a2.publications.create(title='Highlights for Children')
"

I think it should say: -

"
# Add a Publication directly via publications.create by using keyword
arguments.
>>> new_publication = a2.publications.create(title='Highlights for Children')
"

The distinction between "add" and "create" should be emphasized,
especially for people new to Django.

Also where it says: -

"
# Adding a second time is OK
>>> a2.publications.add(p3)
"

It should be made clear what "OK" means here. Does it mean it has no
effect, or does it mean that another record is created? Right now to
find out the meaning of "OK" people have to go into the Django shell.

Regards.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django documentation site is SLOW

2009-08-09 Thread Denis Cheremisov

I thinkg it's firefox issue - with google chromium, midori or opera
it's felt much faster.

On Aug 7, 3:46 pm, Jo  wrote:
> Surely can't only be me that finds the main Django site painfully
> slow? There is some javascript in there or something that just kills
> my browser.
>
> I'm using Firefox on Linux, on 1.5gig P4, OK not state of the art but
> it's fine for pretty much any other website, but when I try to look
> something up on the Django website, firefox jumps to 80% CPU and takes
> 10s of seconds to render each page, and even when the page is rendered
> the browser is so sluggish as to be almost unusable.
>
> Django might speed up development, but what it gives it takes away in
> time sitting waiting for the damn docs to load!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-08 Thread Torsten Bronger

Hallöchen!

Torsten Bronger writes:

> [...]
>
> While loading the pages is sufficiently fast for me, scrolling has
> always been slightly annoying for me, with various FFs on various
> computers.  [...]
>
> Funny enough, scrolling with the scroll bar is rather smooth,
> while scrolling with the mouse wheel or cursor keys is very jerky.

I found the reason (well, not the root cause, but): If the mouse is
over the text while scrolling, it's jerky.  Of course, it isn't if I
use the scroll bar, which explains my observations.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-08 Thread Lakshman Prasad
Indeed for most of the people in this group Django documentation is very
often consulted resource.
It makes a lot of sense to have those locally. If you have a svn co,
documentation is within the checkout, so you need to browse to
file:///home/name/django-trunk/docs/_build/html/index.html and you have it
locally all the time, with all the latest updates. Just bookmark the
location.

After each svn update run a command `make html` from the docs folder. (you
may first need to easy_install sphinx)

Hope this helps.

On Sat, Aug 8, 2009 at 1:24 PM, Torsten Bronger <
bron...@physik.rwth-aachen.de> wrote:

>
> Hallöchen!
>
> Malcolm Tredinnick writes:
>
> > On Sat, 2009-08-08 at 00:14 -0700, Thierry wrote:
> >
> >> Just wanted to add my own testimony: I too, noticed serious
> >> performance issues with Firefox when consulting Django
> >> documentation.
> >
> > "Performance issues" could many a myriad of things. Is it slow to
> > render, or slow to load the data? Or slow to update as you scroll
> > through the page?
>
> While loading the pages is sufficiently fast for me, scrolling has
> always been slightly annoying for me, with various FFs on various
> computers.  I experience this only on Django's documentation site,
> although it may well be on other sites which are less important to
> me, too.
>
> Funny enough, scrolling with the scroll bar is rather smooth, while
> scrolling with the mouse wheel or cursor keys is very jerky.  I'm
> pretty sure that it has to do with the CSS for the greenish code
> snippets.  The kind of flickering suggests that the definition of
> the upper edge of the inserts (margin/padding/broder/whatever) may
> contain some sort of CSS hack which is too complicated for Firefox.
> But this is just a guess.
>
> Additionally, in very rare cases, artifacts remain on the canvas
> because flaws in FF's rendering engine are triggered by Django's
> CSS.
>
> Tschö,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
>  or http://bronger-jmp.appspot.com
>
>
> >
>


-- 
Regards,
Lakshman
becomingguru.com
lakshmanprasad.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-08 Thread Torsten Bronger

Hallöchen!

Malcolm Tredinnick writes:

> On Sat, 2009-08-08 at 00:14 -0700, Thierry wrote:
>
>> Just wanted to add my own testimony: I too, noticed serious
>> performance issues with Firefox when consulting Django
>> documentation.
>
> "Performance issues" could many a myriad of things. Is it slow to
> render, or slow to load the data? Or slow to update as you scroll
> through the page?

While loading the pages is sufficiently fast for me, scrolling has
always been slightly annoying for me, with various FFs on various
computers.  I experience this only on Django's documentation site,
although it may well be on other sites which are less important to
me, too.

Funny enough, scrolling with the scroll bar is rather smooth, while
scrolling with the mouse wheel or cursor keys is very jerky.  I'm
pretty sure that it has to do with the CSS for the greenish code
snippets.  The kind of flickering suggests that the definition of
the upper edge of the inserts (margin/padding/broder/whatever) may
contain some sort of CSS hack which is too complicated for Firefox.
But this is just a guess.

Additionally, in very rare cases, artifacts remain on the canvas
because flaws in FF's rendering engine are triggered by Django's
CSS.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-08 Thread Malcolm Tredinnick

On Sat, 2009-08-08 at 00:14 -0700, Thierry wrote:
> Hi,
> 
> Just wanted to add my own testimony: I too, noticed serious
> performance issues with Firefox when consulting Django documentation.

"Performance issues" could many a myriad of things. Is it slow to
render, or slow to load the data? Or slow to update as you scroll
through the page? Can you give an example of a page that behaves poorly
in your case and describe how it behaves poorly? Does it behave in the
same fashion when you're viewing a local copy of the docs (served via a
local webserver versus just loaded as files is a difference to test,
too), or just when you're viewing them on djangoproject.com?

Django's docs pages are generally very lightweight HTML and total
content is fairly well set up for taking advantage of caching. There are
a few CSS rules that could be written differently to give greater
performance, but none of them are particularly tragic, given the lack of
reflows that go on in the page (they are static pages, by and large).
We're certainly better in this respect than a vast majority of websites
out there.

If we have a situation that is a genuine example of Firefox regression,
it would be good to know so it can be reported to the Firefox team or
fixed on our side if it's a legitimate problem. Right now, the problem
reports from this thread are a little light on those things we like to
call "specific details".

For the record, I'm using Firefox 3.5.2 on Fedora 11 and don't notice
any problems reading the docs (although I don't have Adblock installed).

Regards,
Malcolm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-08 Thread Thierry

Hi,

Just wanted to add my own testimony: I too, noticed serious
performance issues with Firefox when consulting Django documentation.
So far it is the only website where I experience this.
I am home, using Firefox 3.5.2 on Ubuntu 9.04 (officially installed
package 'firefox-3.5'), and have Adblock too.

As far as I remember, I did not notice any performance hog when
browsing Django documentation from work (Windows XP, Firefox 3.5.2,
Adblock activated too).
Just tried at home with Epiphany browser, and still no lack of
responsiveness from Django website.

So I guess the culprit would be the current Firefox 3.5.x package from
Ubuntu's universe repos?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Karen Tracey
On Fri, Aug 7, 2009 at 10:06 AM, Jo  wrote:

>
> Ok, after a bit of tinkering I think I might have found the culprit.
>
> Seems fine in Opera, and much better in Firefox when I disable Adblock
> Plus (the only add-on I've got installed!)
>
> Still a little sluggish in Firefox, but they are big pages on quite an
> old machine. Goes from unusable to almost normal with ABP disabled.
>

Glad you've found something that makes it better, but it still sounds odd to
me.  I use Firefox 3.5.2 + AdBlock Plus 1.1 on my Ubuntu machine (P4 with
just 1G) and don't notice any particular sluggishness with the Django site.
Firefox does seem to go out to lunch periodically and become unresponsive
for stretches of time, but from some research I'm pretty sure that's due to
updating live bookmarks, and it's much improved in 3.5 compared to 3.0
(though I wouldn't call it fixed).

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Jo

Ok, after a bit of tinkering I think I might have found the culprit.

Seems fine in Opera, and much better in Firefox when I disable Adblock
Plus (the only add-on I've got installed!)

Still a little sluggish in Firefox, but they are big pages on quite an
old machine. Goes from unusable to almost normal with ABP disabled.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Russell Keith-Magee

On Fri, Aug 7, 2009 at 8:06 PM, Léon Dignòn wrote:
>
> I have an Intel C2D E2200 with 4 GB RAM. The Django docs are killing
> my browser, it feels like FireSLUG instead of Firefox 3.5 .

I don't know what to say. Your experience in no way matches my own. I
use Safari and Firefox, and I certainly don't see any CPU load spike
loading the docs. The only significant delays I see are due to
download time, which are mostly caused by sitting on the tail end of a
fairly ordinary net connection in Australia (when you're a long way
from everything, _every_ page takes a while to download)

I can't even think what could be causing this. If you look at the
source code, we're not doing anything particularly intensive with
Javascript - we are using a Javascript widget to implement Google's
search, but other than that, it's fairly simple HTML all the way.

If you have any concrete suggestions, we're happy to entertain them,
but unless you can provide some concrete diagnosis as to the cause of
the problem, there isn't much we can do. We can't fix a problem that
we can't reproduce.

My only diagnosis advice would be that you disable any Firefox plugins
you may have installed. I have seen more than one page rendering
performance problem solved by disabling a badly behaved Firefox
plugin.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Sam Walters

Hi
Its probably not the browser. I am using firefox 3.5 on an eee pc and
the documentation is fine. This is with Javascript disabled using
noscript however i just turned it on again and no noticable difference
in top readings

*You should look at the install addons of firefox, eg: some plugin
which is slowing it.
*save the page and view it offline see if there is still an issue.
*CSS+cheap video card. This is unusual however some sites really run
slow on very old video cards. Try removing the css from a docs
page+save it runoffline.

I just cant see it being firefox unless its not configured properly.
Especially considering eee pc atom cpu is puny compared too even a p4.
:)



On Fri, Aug 7, 2009 at 10:09 PM, Mirat Bayrak wrote:
> without javascript ?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Léon Dignòn

Without it's better, but still now good enough for three colors and a
little bit of text.

On Aug 7, 2:09 pm, Mirat Bayrak  wrote:
> without javascript ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Mirat Bayrak
without javascript ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Léon Dignòn

I have an Intel C2D E2200 with 4 GB RAM. The Django docs are killing
my browser, it feels like FireSLUG instead of Firefox 3.5 .

Hate it!


On Aug 7, 1:46 pm, Jo  wrote:
> Surely can't only be me that finds the main Django site painfully
> slow? There is some javascript in there or something that just kills
> my browser.
>
> I'm using Firefox on Linux, on 1.5gig P4, OK not state of the art but
> it's fine for pretty much any other website, but when I try to look
> something up on the Django website, firefox jumps to 80% CPU and takes
> 10s of seconds to render each page, and even when the page is rendered
> the browser is so sluggish as to be almost unusable.
>
> Django might speed up development, but what it gives it takes away in
> time sitting waiting for the damn docs to load!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django documentation site is SLOW

2009-08-07 Thread Mirat Bayrak
i am not expert but i thought that it can be about javascripts, can you
disable javascript support and retry it? i think you have to try opera too

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django documentation site is SLOW

2009-08-07 Thread Jo

Surely can't only be me that finds the main Django site painfully
slow? There is some javascript in there or something that just kills
my browser.

I'm using Firefox on Linux, on 1.5gig P4, OK not state of the art but
it's fine for pretty much any other website, but when I try to look
something up on the Django website, firefox jumps to 80% CPU and takes
10s of seconds to render each page, and even when the page is rendered
the browser is so sluggish as to be almost unusable.

Django might speed up development, but what it gives it takes away in
time sitting waiting for the damn docs to load!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django documentation

2008-11-25 Thread Brian Neal

On Nov 25, 8:44 am, ReneMarxis <[EMAIL PROTECTED]> wrote:
> Hello Brian
>
> i allready saw those hints on the djangoproject/djangobook homepage
> and that was the reason i was writing this post.
> Imagine i am new to django, i read "i have to add those lines to my
> model and do some stuff on the setting.py file and run syncdb" then
> everything is ok and i can use get_profile to load the profile .
> I did that but running get_profile raises exceptions. I took quite a
> bit to realize that the profile does not get generated automaticly
> (checked in db table) but you have to create it by yourself.
> I mean its just one sentense more but it would save many searching on
> the web.
>

Well, if you worked through the tutorial you should know that you need
to run syncdb after creating a new model. Your user profile is a model
after all and it needs to reside in your database for get_profile to
work. To be honest, it seemed to me your post was a thinly disguised
jab at the docs. We all feel the way you do at first, that everything
is hard to find. But if you keep reading the docs and studying other
people's source code (check out all the django apps on
code.google.com), you'll get the hang of this.

I realize we all learn differently and at our own pace. I think that
the django docs are some of the most well written and comprehensive
docs I have seen for an open source web framework. Seriously. Have you
ever looked at another frameworks docs? If you find the docs lacking
on some point, write a Trac ticket. The developers are very responsive
to documentation requests in my one single experience. They understand
the value of good docs.

I also encourage you to get on the IRC channel. You can get fast
pointers from experts that way if you are stuck.

And finally, don't forget the actual django source code. Learning how
to navigate it and find things in it is very useful. If you are
confused about the docs, take a peek at the code. You will also learn
something about python that way.

Enjoy your experience with django!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django documentation

2008-11-25 Thread ReneMarxis

Hello Brian

i allready saw those hints on the djangoproject/djangobook homepage
and that was the reason i was writing this post.
Imagine i am new to django, i read "i have to add those lines to my
model and do some stuff on the setting.py file and run syncdb" then
everything is ok and i can use get_profile to load the profile .
I did that but running get_profile raises exceptions. I took quite a
bit to realize that the profile does not get generated automaticly
(checked in db table) but you have to create it by yourself.
I mean its just one sentense more but it would save many searching on
the web.

Also take a look on the groups:

"
Groups

Groups are a generic way of categorizing users so you can apply
permissions, or some other label, to those users. A user can belong to
any number of groups.

A user in a group automatically has the permissions granted to that
group. For example, if the group Site editors has the permission
can_edit_home_page, any user in that group will have that permission.

Beyond permissions, groups are a convenient way to categorize users to
give them some label, or extended functionality. For example, you
could create a group 'Special users', and you could write code that
could, say, give them access to a members-only portion of your site,
or send them members-only e-mail messages.
"

Now try to use this infomation. The documentation should point out,
that i have to create the groups with the Admin, that i have to add
the users in the Admin to those groups. It should also tell me if/how
i can add/remove users to group by code? Or creating the groups by
running syncdb (probably i have to use some dumpload)
What i want to say is that the provided infomation is not realy
usefull for someone begining django. I have to read the docs and then
start searching on the web to figure out how to use the functionality.
Thats what seems insufficient to me. And this are only 2 aspects i
wrote down as a example.

Now i just ordered 2 Books on Django and one on Python :) Hope they
will cover functions more complete.

PS: http://djangoapi.quamquam.org/trunk/

_thanks


On 25 Nov., 01:38, Brian Neal <[EMAIL PROTECTED]> wrote:
> On Nov 24, 5:18 pm, ReneMarxis <[EMAIL PROTECTED]> wrote:
>
> > hi
>
> > as mentioned earlyer today i am very new to django and againe have
> > some question, this time reguarding the documentation.
>
> > I started django by duing the tutorial, and now i started building my
> > own little project from ground up :) but i am lacking of information.
> > I am missing some documentation, some good organised api.
>
> > E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos
> > on the user. The documentation fromhttp://docs.djangoproject.comsays
> > "define that in settings.py and in your model and use it via
> > get_profile" But no one tells you that you have to create it by
> > yourself and save it also. Ok this is something you can try out but
> > the information would be placed good on the doc side.
>
> http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-...http://www.djangobook.com/en/1.0/chapter12/#cn222
>
>
>
> > Can anyone give me some link to one good documentation or do there
> > exist good books which cover issue's completly so you don't have to
> > search most time while learning?
>
> Searching is part of the process of learning.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django documentation

2008-11-24 Thread Steve Phillips

I too was in your position. I am fairly new to Django and was getting
very frustrated with the docs. They tell me to just do something and
left it at that. I then went to the django docs on the djangoproject
website and discovered that everything I needed was there. I was just
searching the wrong places. Give the IRC chat logs a look. Search
through them. It's almost a guarantee that what you are doing has
already been done and someone already asked for help on it. I
practically never ask for help anymore unless I am truly stuck.

Steve

On 11/24/08, ReneMarxis <[EMAIL PROTECTED]> wrote:
>
> hi
>
> as mentioned earlyer today i am very new to django and againe have
> some question, this time reguarding the documentation.
>
> I started django by duing the tutorial, and now i started building my
> own little project from ground up :) but i am lacking of information.
> I am missing some documentation, some good organised api.
>
> E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos
> on the user. The documentation from http://docs.djangoproject.com says
> "define that in settings.py and in your model and use it via
> get_profile" But no one tells you that you have to create it by
> yourself and save it also. Ok this is something you can try out but
> the information would be placed good on the doc side.
>
> Also i'd like to implement groups in my app. The only infomation on
> the site is, that you can use groups and all users of one group have
> the permissions of the group. Thats all. There is no description on
> how/where to specify groups, how to create then, how to add users to
> one group ... I'l have to find everything by myself on google..
>
> Can anyone give me some link to one good documentation or do there
> exist good books which cover issue's completly so you don't have to
> search most time while learning?
>
> _tia
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django documentation

2008-11-24 Thread Brian Neal

On Nov 24, 5:18 pm, ReneMarxis <[EMAIL PROTECTED]> wrote:
> hi
>
> as mentioned earlyer today i am very new to django and againe have
> some question, this time reguarding the documentation.
>
> I started django by duing the tutorial, and now i started building my
> own little project from ground up :) but i am lacking of information.
> I am missing some documentation, some good organised api.
>
> E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos
> on the user. The documentation fromhttp://docs.djangoproject.comsays
> "define that in settings.py and in your model and use it via
> get_profile" But no one tells you that you have to create it by
> yourself and save it also. Ok this is something you can try out but
> the information would be placed good on the doc side.

http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
http://www.djangobook.com/en/1.0/chapter12/#cn222

>
> Can anyone give me some link to one good documentation or do there
> exist good books which cover issue's completly so you don't have to
> search most time while learning?

Searching is part of the process of learning.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django documentation

2008-11-24 Thread ReneMarxis

hi

as mentioned earlyer today i am very new to django and againe have
some question, this time reguarding the documentation.

I started django by duing the tutorial, and now i started building my
own little project from ground up :) but i am lacking of information.
I am missing some documentation, some good organised api.

E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos
on the user. The documentation from http://docs.djangoproject.com says
"define that in settings.py and in your model and use it via
get_profile" But no one tells you that you have to create it by
yourself and save it also. Ok this is something you can try out but
the information would be placed good on the doc side.

Also i'd like to implement groups in my app. The only infomation on
the site is, that you can use groups and all users of one group have
the permissions of the group. Thats all. There is no description on
how/where to specify groups, how to create then, how to add users to
one group ... I'l have to find everything by myself on google..

Can anyone give me some link to one good documentation or do there
exist good books which cover issue's completly so you don't have to
search most time while learning?

_tia


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >