Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8406517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:07:52+00:00 2026-06-09T23:07:52+00:00

In php files, this task may be a simple include of another file but

  • 0

In php files, this task may be a simple include of another file but I wondered if it was similar practice in Django? like described here: https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#include

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:07:54+00:00Added an answer on June 9, 2026 at 11:07 pm

    Short answer: No, Python doesn’t perform that way.

    Here’s a long one:

    A little bit about difference between PHP and Python web development

    First of all, include and require are parts of PHP language itself. It means that before processing source code PHP interpreter includes source code from files given as arguments to those functions and then makes interpreting. That’s the inheritance of the main purpose of PHP design (HTML, or, generally, text preprocessing).

    Web development in Python is a bit different. Language itself was designed as general purpose programming language, so it doesn’t assume text-processing by default. Code is just executed. That’s why web development is usually done using frameworks (or wsgi modules if you prefer doing everything from scratch.

    All that above means that all text manipulations (all output you generate, you generally do manually by creating result text string (or strings list when used with buffering) and giving the output result yourself.

    Template languages

    That’s kinda messy point from which template languages were born, becoming essential part of every (or almost every) web application written in Python (you can assume something simalar to Smarty in PHP world). There are a lot of them: jinja, jinja2, mako, chameleon … and many others. All of them are different but serve the same purpose (easyfying text generation via providing templates with placeholders for data of basic representation logic).

    And here comes the main feature of Python web frameworks: application logic and representation are strictly splitted.

    Here we came to the substance of your question:

    As all of those template libraries providing text templating facilities are different, there’s no common way to make PHP-like includes that we can say they are general for Python. Each of those tools provide different ways and philosophy of handling, in particular, includes, mainly divided into two mainstream ways:

    • macros- and slots-based (Chameleon)
    • template inheritance-based (Jinja2, Django template language)

    All you need is to take one that best fits your needs (whether you like/unlike their syntax, some of them are faster, some are more readable, and so on..) and work with it combining with other tools that provide logic for your application.

    Getting closer: About Django

    It’s common to use include template tag when you want to include some re-used part of application (e.g. pagination widget), for which you’ve adapted your view context.

    But when you have common header for all pages, or another common part, it’s better to use inheritance, that’s achieved in two steps:

    • Basic template is created (containing general header and footer)
    • Specific templates are created via template inheritance feature, in particular, extends template tag in Django
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is where the PHP files are: ts1.WEBSITENAMEHERE.biz/cp/ The .htaccess file is also in
I have a site with this simple structure: \public_html {files}.php \files \es For the
I have a files structure like this: Class (folder): - User.php - Rule.php Scripts
so I have this problem I have 3 files like 2.php <?php $variable =
So I have this project in PHP where I have some include files next
I have a directory with files that look like this: 001_something.php 002_something_else.php 004_xyz.php 005_do_good_to_others.php
This may not be possible, but I'd like to ask anyway and see if
Assume that I have 2 .php files : index.php and ajax.php This is index.php:
How can I rsync mirror only *.php files? This gives me a bunch of
In php this is how you would check if a file is selected: $_FILES['item']['size']>0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.