Linux Format

What do each of these files do?

-

There are four files that are generated when you run startproje­ct , they are manage.py, settings.py, urls.py and wsgi.py. The manage.py file is a replacemen­t for the django-admin command we used earlier, it’s your main entry point into your applicatio­n and it’s what we use to run any management commands related to our project, for example creating an admin user. It’s very rare that you’ll need to edit this file.

The settings.py file contains all of the settings needed for our project, such as the name of the project, the URL it will live under and so forth. We won’t be editing it as part of this process, but it’s worth having a look through just to see what’s in there anyway.

The file urls.py is the base routing file for all requests which come into Django. It handles mapping the various URLs to their counterpar­t views. We’ll be editing this later on. The wsgi.py file is used when you deploy your project to a server. It enables a WSGI HTTP server such as Gunicorn to mount your applicatio­n and pass HTTP requests through.

Newspapers in English

Newspapers from Australia