S
S
StopDesign2014-08-16 14:34:18
PHP
StopDesign, 2014-08-16 14:34:18

Why does django startproject create such a strange project structure?

A Django project consists of one or more applications. Startproject creates a project so that the settings (settings.py) are inside one of the applications. Moreover, no solution is proposed for separating settings into dev and production.
As far as I remember, in the first versions of Django, settings were taken out of applications and lay next to manage.py. Why were they added to the application directory?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
SharuPoNemnogu, 2016-06-17
@and_smi

1. in db.conn.php
<?
<?php

is a typo or is it true?
2. remove the closing ?> in all files, if there is at least some character after them, you will get this error

T
tolanych, 2016-06-17
@tolanych

Try the following:
- turn off the display of errors on the page. At the very beginning of the script, specify ini_set('display_errors', '0'), or configure the PHP configuration on the server, or configure it in .htaccess
- Check the file encoding. Must be the same for all files. If UTF-8, then convert to UTF-8 without BOM
for normal operation and debugging, write error output to a log file and analyze it

A
Andrey K, 2014-08-16
@mututunus

So it's been a long time since Django 1.4

V
Vladimir, 2014-08-16
Ulupov

https://docs.djangoproject.com/en/dev/releases/1.4...

M
Maxim Vasiliev, 2014-09-09
@qmax

To separate into dev and production, you can do
projectdir/projectdir/settings/__init__.py
projectdir/projectdir/settings/dev.py
projectdir/projectdir/settings/prod.py
projectdir/projectdir/settings/common.py
And patch manage.py accordingly and wsgi.py or even frontend settings.
But in 1.7, a new config system for individual applications, it's not a fact that it will work with this approach.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question