Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x Django 3.1 | Python 3.6.12:定制模板标记不会突然出现?_Python 3.x_Django Templates_Pycharm_I386_Django 3.1 - Fatal编程技术网

Python 3.x Django 3.1 | Python 3.6.12:定制模板标记不会突然出现?

Python 3.x Django 3.1 | Python 3.6.12:定制模板标记不会突然出现?,python-3.x,django-templates,pycharm,i386,django-3.1,Python 3.x,Django Templates,Pycharm,I386,Django 3.1,我一直在关注一个关于Django的教程,但我被卡住了,所以我搜索了一个又一个教程,最终我重新安装了Linux系统x6(由于~/.bashrc中的Python更改和类似内容) 我是新来的,我是Python和Django(初学者级别)的新手。仍在学习,但我有经验(8年)在各种公司工作,如NCR。。。还有一些是作为自由职业者,在那里我学到了很多系统管理/后端方面的知识 关键是:在另一个教程中突然出现了(同时我相信PYCHARM有了更新)我无法提取创建的标签 因此,在my base.html中,page

我一直在关注一个关于Django的教程,但我被卡住了,所以我搜索了一个又一个教程,最终我重新安装了Linux系统x6(由于~/.bashrc中的Python更改和类似内容)

我是新来的,我是Python和Django(初学者级别)的新手。仍在学习,但我有经验(8年)在各种公司工作,如NCR。。。还有一些是作为自由职业者,在那里我学到了很多系统管理/后端方面的知识

关键是:在另一个教程中突然出现了(同时我相信PYCHARM有了更新)我无法提取创建的标签

因此,在my base.html中,pages.app中的所有my.html页面都在templates文件夹中,所有设置都在settings中

但是,我的{{tags}}没有出现

这里有一些信息,。。。 我也有同样的问题

在模型中:

from django.http import HttpResponse
from django.shortcuts import render
from .models import *
from django import templatetags
from django import template

# Create your views here.


def home_view(request):
    return render(request, "home.html", {})


def contact_view(request):
    return render(request, "contact.html", {})


def about_view(request):

    my_context:{
        "my_text": "This is about us",
        "my_number" : 123
    }
    return render(request, 'about.html', my_context)


def social_view(request):
    return render(request, "social.html", {})
我在源文件夹中添加了“模板目录”中的所有设置

请帮助我,我不能继续学习教程了,我想在初学者水平上学习DJANGO,就像在PYTHON上一样 所以我可以继续前进,我厌倦了制作新应用程序、项目、更改Python解释器,然后进入(x6)环境重新安装Ubuntu

因此,现在,这是由于练习和学习Python和Django而没有重新安装相同操作系统的最长时间…:(


请,有什么想法吗?

您在设置
my_context
时使用冒号而不是等号,所以它永远不会被设置!我已经设置好了,现在仍然显示{{my_text},{{{my number}仅此,这是来自视图:from django.http import HttpResponse from django.shortcuts import render from pages.models导入视图和关于_视图的相关定义(请求、我的_上下文、*args、**kwargs):我的_上下文={“我的_文本”:“这是关于我们的”、“我的编号”:123}如果您对代码进行了更改,请更新问题-注释中的内联代码很难阅读。一切都是一样的!如果您能回答我的问题,请在这里发布navbar.html和about.html如何接受包括base.html在内的标记(标准教程,现在我正在学习对我有用的教程,我会让你知道,因为我无法更新问题,出于某种原因(?)听起来你的教程真的让人困惑。我可以推荐学习Django女孩教程(有多种语言版本)。英文版如下:
from django.http import HttpResponse
from django.shortcuts import render
from .models import *
from django import templatetags
from django import template

# Create your views here.


def home_view(request):
    return render(request, "home.html", {})


def contact_view(request):
    return render(request, "contact.html", {})


def about_view(request):

    my_context:{
        "my_text": "This is about us",
        "my_number" : 123
    }
    return render(request, 'about.html', my_context)


def social_view(request):
    return render(request, "social.html", {})