Re: module 'django.db.models' has no attribute 'Foreignkey'

2018-11-20 Thread Avitab Ayan Sarmah
being used on the Django official tutorial, https://docs.djangoproject.com/en/dev/intro/tutorial02/#creating-models Il 20 nov 2018, 18:32 +0100, Avitab Ayan Sarmah , ha scritto: Hi matteo, Now it is showing as: File "C:\Users\AVITABAYAN\Desktop\django_lectures\first_project\first_app\mode

Re: module 'django.db.models' has no attribute 'Foreignkey'

2018-11-20 Thread Avitab Ayan Sarmah
Tuesday, November 20, 2018 at 10:29:26 PM UTC+5:30, matteo gassend wrote: > > the k in ForeignKey is Capitalized > Il 20 nov 2018, 17:57 +0100, Avitab Ayan Sarmah >, ha scritto: > > Hi everyone, > > I have written a code in models.py inside my project folder. I have > c

module 'django.db.models' has no attribute 'Foreignkey'

2018-11-20 Thread Avitab Ayan Sarmah
Hi everyone, I have written a code in models.py inside my project folder. I have completed my code and whenever i execute "python manage.py makemigrations first_app", i get an error. The error is mentioned as "AttributeError: module 'django.db.models' has no attribute 'Foreignkey'". My code an

Re: what does the below mentioned error means and how do i resolve this error.something is wrong with my admin.py file.Please comment:

2018-06-08 Thread Avitab Ayan Sarmah
; > On Thursday, June 7, 2018 at 11:08:15 AM UTC-4, Avitab Ayan Sarmah wrote: >> >> In windows powershell: >> >> ERRORS: >> : (admin.E108) The value of >> 'list_display[0]' refers to 'question_text', which is not a callable, an >> att

what does the below mentioned error means and how do i resolve this error.something is wrong with my admin.py file.Please comment:

2018-06-07 Thread Avitab Ayan Sarmah
In windows powershell: ERRORS: : (admin.E108) The value of 'list_display[0]' refers to 'question_text', which is not a callable, an attribute of 'QuestionAdmin', or an attribute or method on 'polls.Question'. : (admin.E108) The value of 'list_display[1]' refers to 'pub_date', which is not a cal

my image is not showing in my website.Screenshot is attached below:

2018-06-06 Thread Avitab Ayan Sarmah
index.html: {% load static %} {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} results.html: {{ question.question_text }} {% for choice in question.choice_set.

is this my correct results.html and detail.html code?i am only a beginer, please check

2018-06-06 Thread Avitab Ayan Sarmah
results.html: {{ question.question_text }} {% for choice in question.choice_set.all %} {{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }} {% endfor %} vote again? detail.html: {{ question.question_text }} {% if error_message %}{{ error_message }}{% endif %}

Re: Please give the steps to follow this:

2018-06-06 Thread Avitab Ayan Sarmah
you study Django templates documentation and > the accompanying examples. > > > Eric > ---------- > *From:* django...@googlegroups.com < > django...@googlegroups.com > on behalf of Avitab Ayan Sarmah > > > *Sent:* Wednesday, June 6, 2018 6:42:51 PM >

Please give the steps to follow this:

2018-06-06 Thread Avitab Ayan Sarmah
1. In your templates, use the static template tag to build the URL for the given relative path using the configured STATICFILES_STORAGE

Re: Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Avitab Ayan Sarmah
checking.. On Wednesday, June 6, 2018 at 8:38:01 PM UTC+5:30, Sadialiou Diallo wrote: > > that means your image isn't in the good directory > > go to this link.you will see there all details for static files > > https://docs.djangoproject.com/en/2.0/howto/static-files/ > > you most configure your

Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Avitab Ayan Sarmah
what is this means? and hw do i resolve this error? Please comment.And also my image is not open in my webpage when i have added an image with black background with .gif suffix.How do i resolve it? -- You received this message because you are subscribed to the Google Groups "Django users" grou

This site can’t be reached 127.0.0.1 refused to connect.

2018-06-05 Thread Avitab Ayan Sarmah
While going through the turolal 7 of the django project, couldn't connect to the url.Please comment why my local host refused to connect -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fr

Re: Page not found (404).Please check i am unable to run server.It is showing error

2018-05-25 Thread Avitab Ayan Sarmah
It should prompt a page for Question and last published On Fri 25 May, 2018, 11:08 PM Daniel Hepper, wrote: > What would you expect the server to display for that URL? > > — Daniel > > Am 25.05.2018 um 19:18 schrieb Avitab Ayan Sarmah : > > In my windoes powershell: >

Page not found (404).Please check i am unable to run server.It is showing error

2018-05-25 Thread Avitab Ayan Sarmah
In my windoes powershell: PS C:\Users\AVITABAYAN\mysite> python manage.py runserver Performing system checks... System check identified no issues (0 silenced). May 25, 2018 - 22:42:50 Django version 2.0.1, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-23 Thread Avitab Ayan Sarmah
t;> path('admin/', admin.site.urls) >> ] >> >> In this chuck of code, you should write like this, >> >> urlpatterns = [ >> path('polls/', include('polls.urls')), >> path('admin/', admin.site.urls), >> ] >

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-22 Thread Avitab Ayan Sarmah
ex: /polls/5/vote/ path('/vote/', views.vote, name='vote'), ] On Friday, May 18, 2018 at 10:42:17 PM UTC+5:30, James Farris wrote: > > What does your urls.py look like? > > According to the error it doesn’t appear that polls/ is defined in your > urls.py file

Re: def get_queryset(self): ^ IndentationError: unindent does not match any outer indentation level

2018-05-18 Thread Avitab Ayan Sarmah
Thank you james i found the error and now another error i found please help me on this.You will see this as another topic On Friday, May 18, 2018 at 10:22:13 PM UTC+5:30, Avitab Ayan Sarmah wrote: > > Hi james,Please check my code clearly because i didn;t found any > indentation

getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-18 Thread Avitab Ayan Sarmah
Page not found (404) Request Method: GET Request URL: http://localhost:8000/polls/ Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 1. [name='index'] 2. / [name='detail'] 3. /results/ [name='results'] 4. /vote/ [name='vote'] 5. admin/ The

Re: def get_queryset(self): ^ IndentationError: unindent does not match any outer indentation level

2018-05-18 Thread Avitab Ayan Sarmah
es or a > tab in. For example a def should be 4 spaces in from its class, a variable > should be 4 spaces in from its def. > > IndentationError: unindent does not match any outer indentation level > > On Fri, May 18, 2018 at 9:08 AM Avitab Ayan Sarmah > wrote: > >>

def get_queryset(self): ^ IndentationError: unindent does not match any outer indentation level

2018-05-18 Thread Avitab Ayan Sarmah
While going through the django project i committed an error while executing "python manage.py runserver" inside my project directory.It is showing error is in line 24 of views.py.Please comment what exact the error is and how do i overcome this error.The exceptions and views.py is mentioned belo

Re: Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS.

2018-05-15 Thread Avitab Ayan Sarmah
change to the correct server name. > > Regards, > > Andréas > > 2018-05-13 9:02 GMT+02:00 Avitab Ayan Sarmah >: > >> Hi all, >> while going through the dajngo tutorial i stuck while executing a >> code i.e., mentioned below. It is shoeing &quo

Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS.

2018-05-13 Thread Avitab Ayan Sarmah
Hi all, while going through the dajngo tutorial i stuck while executing a code i.e., mentioned below. It is shoeing "Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS.". the code is written in python manage.py shell.i.e., PS C:\Users\AVITABAYAN\m

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
;> >> P.S.: I really admire your persistence! I promise that all these error >> messages will make sense at some point, if you stick with it. >> >> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah > >: >> >> Exceptions: >> >> Type "help

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
ith it. > > Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah >: > > Exceptions: > > Type "help", "copyright", "credits" or "license" for more information. > >>> import datetime > >>> from django.utils import ti

Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
ill make sense at some point, if you stick with it. > > Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah >: > > Exceptions: > > Type "help", "copyright", "credits" or "license" for more information. > >>> import datetime

While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to resolve

2018-05-11 Thread Avitab Ayan Sarmah
Exceptions: Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> from django.utils import timezone >>> from polls.models import Question Traceback (most recent call last): File "", line 1, in File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7,

While going through the django tutorial i found error while scripting automated testing.The code and exeptions are mentioned below. Please find what is the error .

2018-05-09 Thread Avitab Ayan Sarmah
shell : >>> import datetime>>> from django.utils import timezone>>> from polls.models >>> import Question>>> # create a Question instance with pub_date 30 days in >>> the future>>> future_question = Question(pub_date=

Re: While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is menti

2018-05-08 Thread Avitab Ayan Sarmah
the last two days and every issue you have > had has been a typo. People on this board are happy to help with django > issues, but you should be really using an IDE that will catch at least some > of these typos. PyCharm is a good one > > On Tuesday, May 8, 2018 at 12:52:15 PM U

Re: While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is menti

2018-05-08 Thread Avitab Ayan Sarmah
please mention where exactly i am missing >? On Tuesday, May 8, 2018 at 10:18:43 PM UTC+5:30, C. Kirby wrote: > > You are missing a closing '>' in your detail url > > On Tuesday, May 8, 2018 at 12:42:20 PM UTC-4, Avitab Ayan Sarmah wrote: >> >> polls/url

Re: While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is menti

2018-05-08 Thread Avitab Ayan Sarmah
Please mention where exactly I missed > On Tue 8 May, 2018, 10:19 PM C. Kirby, wrote: > You are missing a closing '>' in your detail url > > On Tuesday, May 8, 2018 at 12:42:20 PM UTC-4, Avitab Ayan Sarmah wrote: >> >> polls/urls.py: >> >> from

Re: While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is menti

2018-05-08 Thread Avitab Ayan Sarmah
ried: ['\\ > You are looking for a URL named "details" which accepts 1 number and > Django does not know it. > > On Tue, May 8, 2018 at 1:34 PM, Avitab Ayan Sarmah > wrote: > >> Exceptions: >> >> PS C:\Users\AVITABAYAN\mysite> python man

Re: While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is menti

2018-05-08 Thread Avitab Ayan Sarmah
or a URL named "details" which accepts 1 number and > Django does not know it. > > On Tue, May 8, 2018 at 1:34 PM, Avitab Ayan Sarmah > wrote: > >> Exceptions: >> >> PS C:\Users\AVITABAYAN\mysite> python manage.py runserver >> Performing syste

While going through Django tutorial i commited an error because of which i am not able to execute python manage.py runserver. The exceptions and codes are mentioned below: In exception it is mentioned

2018-05-08 Thread Avitab Ayan Sarmah
Exceptions: PS C:\Users\AVITABAYAN\mysite> python manage.py runserver Performing system checks... System check identified no issues (0 silenced). May 08, 2018 - 22:00:28 Django version 2.0.1, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server wi

can you check what is wrong with def vote(request, question_id), i am not able to run server. The exceptions and my views.py code are wrriten below:

2018-05-08 Thread Avitab Ayan Sarmah
Views.py: from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from . models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_obje

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-08 Thread Avitab Ayan Sarmah
Sure On Tue 8 May, 2018, 12:08 AM Jani Tiainen, wrote: > Also next time please post exceptions as a text. Images are really hard to > read specially on mobile device. > > ma 7. toukokuuta 2018 klo 20.34 Avitab Ayan Sarmah > kirjoitti: > >> i got the error thank you.

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Avitab Ayan Sarmah
i got the error thank you. It was a simple error i forgot to put "<" before vote On Monday, May 7, 2018 at 10:55:51 PM UTC+5:30, Avitab Ayan Sarmah wrote: > > polls/urls.py: > > from django.urls import path > > from . import views > > app_name = 'polls

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Avitab Ayan Sarmah
esults/', views.results, name='results'), #ex: /polls/5/vote/ path('int:question_id>/vote/', views.vote, name='vote'), ] On Monday, May 7, 2018 at 10:54:16 PM UTC+5:30, Dylan Reinhold wrote: > > Share your polls/url.py it's saying it cant find

While going through django tutorial i found some errors when i tried to execute the python manage.py runserver.The error is attached below:

2018-05-06 Thread Avitab Ayan Sarmah
index.html: {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} admin.py: from django.contrib import admin from . models import Question admin.site.register(Question)

Re: Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" th

2018-05-03 Thread Avitab Ayan Sarmah
del is right that your views.py wasn't great either. > > On 03/05/18 17:36, Avitab Ayan Sarmah wrote: > >> thank you Fidel, and i will take care of it >> >> On Thu, May 3, 2018 at 9:57 PM, Fidel Leon > fi...@flm.cat>> wrote: >> >> Sure: >> &

Re: Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" th

2018-05-03 Thread Avitab Ayan Sarmah
; As a matter of advice, please use a fixed-width font when pasting code, > because Python is indented with spaces and using any other type of font > makes reading your mail difficult :) > > El jue., 3 may. 2018 a las 18:08, Avitab Ayan Sarmah (< > avitabay...@gmail.com>) escribió

Re: Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" th

2018-05-03 Thread Avitab Ayan Sarmah
hello Fidel Leon can you please rewrite the whole views.py code so that i can understand what is the exact code is On Thu, May 3, 2018 at 9:19 PM, Fidel Leon wrote: > > > El jue., 3 may. 2018 a las 17:38, Avitab Ayan Sarmah (< > avitabay...@gmail.com>) escribió: >

Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" the si

2018-05-03 Thread Avitab Ayan Sarmah
*mysite/urls.py:* from django.contrib import admin from django.urls import include, path urlpatterns = [ path('', include('polls.urls')), path('admin/', admin.site.urls), ] *polls/templates/polls/index.html*: {% if latest_question_list %} {% for question in latest_question_list %} {{ q

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, 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, A

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):

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
eck 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.CharF

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 = mo

I know this question has been asked before, but I haven't found an answer that solves my situation. I'm looking at the Django tutorial, and I've set up the first URLs exactly as the tutorial has it,

2018-04-22 Thread Avitab Ayan Sarmah
polls/views.py from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index.") polls/urls.py from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'),] mysite/urls.py from django.con