Anonymous
Are the templates written in html files or python files
Anonymous
Pls guys i need ur help
Anonymous
I've tried all the solutions but its still not working
Guillermo
Anonymous
It gives me the template does not exist error
Anonymous
Oh OK
Anonymous
from django.shortcuts import render
#from .models import Question
def index(request):
return render (request, 'index.html')
# latest_question_list = Question.objects.order_by('-pub_date')[:5]
# context = {
# 'latest_question_list': latest_question_list,
# }
# return render(request, 'polls/index.html', context)
#def detail(request, question_id)
# question = get_object_or_404(Question, pk=question_id)
# return render(request, 'polls/detail.html', {'question': question})
#def results(request, question_id):
# response = "You.re looking at the results of question %s."
# return HttpResponse(response % question_id) def vote(request, question_id):
# return HttpResponse("You,re voting on question %s." % question_id)
Guillermo
So, do you have one of this routes on your project: templates/polls/index.html or polls/templates/polls/index.html?
Anonymous
Yes why did u ask tho
Guillermo
Which one?
Anonymous
Like where sorry I don't understand
Anonymous
Is it I'm y settings.py
Anonymous
My**
Guillermo
In which one of the routes do you have your templates? On a templates directory at the same level of the manage.py or inside you app? If its the first you may need to adjust your settings before django find the templates
Anonymous
Oh OK, so how can I adjust my settings
Anonymous
And I'm using the latest version tho
Guillermo
Locate the TEMPLATES variable un the settings and add this below backend
Guillermo
'DIRS': [ os.path.join(BASE_DIR, 'templates'),]
Anonymous
Ive tried it, it still gave the same erro
Guillermo
In the error Django should tell you all the dirs where it searched for the template. Show me that if you can
Anonymous
Shit my laptop battery is down tho
Anonymous
Like I've gone on the internet, I've checked stack overflow and the rest and ive tried their solutions but it still gives me the same error. I'm just confused
Anonymous
But the file where I write the template is it a python file or HTML file
Guillermo
Dont know what else to say. Maybe double check for typos
Guillermo
Its mostly html
Anonymous
Anonymous
Its mostly html
That means it won't end with py. Like index.html.py
Anonymous
It'll just be index.html
Guillermo
Yes
Guillermo
Only .html
Anonymous
Ok thanks tho. I will check for typos maybe the error is from me
Guillermo
Anonymous
Oh OK I will
Anonymous
Oh OK I will
Plz edit ur return ,
return render(request, 'polls/index.html')
diproger
Hello everybody
No One
Hloo9
diproger
if i install pyhton2.7, should i install pip too?
Ronald
diproger
Stay away from 2.7 it expired
i am adding some features to deployed django project, this is required to use 2.7 . I need to build it locally on my windows 10, but i am facing a lot of problems
Neo
can anybody tell me how to get text from
{{ form.fieldname.label_tag }}
Neo
currently i am getting:
<lable for ="Field name:" class="form-control" required id="id_field_name" />First name:</label>
Neo
I only want to get the text "First name"
Neo
any refererance will be helpfull
inchidi
inchidi
diproger
Neo
inchidi
this
this code {{ form.fieldname.label_tag }}
rendered to this <lable for ="Field name:" class="form-control" required id="id_field_name" />First name:</label> ?
Neo
yes
inchidi
oh yeah you are correct
inchidi
yes
how about {{ form.fieldname.label }} ?
inchidi
inchidi
Neo
Вадим
Hi, guys. I use foreign key for two models. When I delete first model, second model delete too. Can I stop the delete second model?
inchidi
Anonymous
Are there any developer group who work on django?
Anonymous
inchidi
diproger
inchidi
diproger
diproger
inchidi
exactly
then follow this tutorial, if you already running python manage.py runserver then you already running it
diproger
inchidi
Вадим
Thanks
Михаил
Hey guys, suggest please a solution to integrate receiving telegram group messages into django project? There two kinds of API which one to choose? One of them asking to enter mobile phone code on launch, how do I integrate this into django admin?
Luke
How do I fix a template does not exist error?
Luke
The template is located in the folder
Ronald