django directory structure the “django way”? (/root/project/app or /root/project & root/app)?
I have a pretty simple question here:
I'm starting out with Django but i'm needing to know which one of the following is more proper (the django way):
- Having the app under the django_project like this:
/root/project/app
- Or Having the Django_project and the django_app under the same
/root/
directory in parallel?
Thaks all!
django
add a comment |
I have a pretty simple question here:
I'm starting out with Django but i'm needing to know which one of the following is more proper (the django way):
- Having the app under the django_project like this:
/root/project/app
- Or Having the Django_project and the django_app under the same
/root/
directory in parallel?
Thaks all!
django
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56
add a comment |
I have a pretty simple question here:
I'm starting out with Django but i'm needing to know which one of the following is more proper (the django way):
- Having the app under the django_project like this:
/root/project/app
- Or Having the Django_project and the django_app under the same
/root/
directory in parallel?
Thaks all!
django
I have a pretty simple question here:
I'm starting out with Django but i'm needing to know which one of the following is more proper (the django way):
- Having the app under the django_project like this:
/root/project/app
- Or Having the Django_project and the django_app under the same
/root/
directory in parallel?
Thaks all!
django
django
asked Nov 21 '18 at 22:25
aphexlogaphexlog
70114
70114
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56
add a comment |
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56
add a comment |
1 Answer
1
active
oldest
votes
There are several thoughts of how to do this best, and only you and your team can find out what works best for you. The Django tutorial recommends keeping apps in parallel to the configuration directory. My team has settled on a few things over time:
From the project root:
.gitignore
manage.py
README.md
+---config
+---urls.py
+---wsgi.py
+---settings.py
+---requirements
+---templates
+---static
+---app1
+---models.py, etc
+---app2
Some prefer another directory layer above the project level, but that has felt like overkill to our projects. We have settled as a team on naming each project's configuration subdirectory config
, rather than the project name repeated. This is just personal preference, but has worked for us. Good luck!
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I rundjango-admin startproject myproject
, the first thing I do it rename the subdirectorymyproject
to beconfig
, and editconfig/settings.py
to replace instances ofmyproject
withconfig
, such asmyproject.urls
becomingconfig.urls
. That way, all of our projects have their configurations in the same subdirectory.
– FlipperPA
Nov 22 '18 at 13:26
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421300%2fdjango-directory-structure-the-django-way-root-project-app-or-root-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are several thoughts of how to do this best, and only you and your team can find out what works best for you. The Django tutorial recommends keeping apps in parallel to the configuration directory. My team has settled on a few things over time:
From the project root:
.gitignore
manage.py
README.md
+---config
+---urls.py
+---wsgi.py
+---settings.py
+---requirements
+---templates
+---static
+---app1
+---models.py, etc
+---app2
Some prefer another directory layer above the project level, but that has felt like overkill to our projects. We have settled as a team on naming each project's configuration subdirectory config
, rather than the project name repeated. This is just personal preference, but has worked for us. Good luck!
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I rundjango-admin startproject myproject
, the first thing I do it rename the subdirectorymyproject
to beconfig
, and editconfig/settings.py
to replace instances ofmyproject
withconfig
, such asmyproject.urls
becomingconfig.urls
. That way, all of our projects have their configurations in the same subdirectory.
– FlipperPA
Nov 22 '18 at 13:26
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
add a comment |
There are several thoughts of how to do this best, and only you and your team can find out what works best for you. The Django tutorial recommends keeping apps in parallel to the configuration directory. My team has settled on a few things over time:
From the project root:
.gitignore
manage.py
README.md
+---config
+---urls.py
+---wsgi.py
+---settings.py
+---requirements
+---templates
+---static
+---app1
+---models.py, etc
+---app2
Some prefer another directory layer above the project level, but that has felt like overkill to our projects. We have settled as a team on naming each project's configuration subdirectory config
, rather than the project name repeated. This is just personal preference, but has worked for us. Good luck!
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I rundjango-admin startproject myproject
, the first thing I do it rename the subdirectorymyproject
to beconfig
, and editconfig/settings.py
to replace instances ofmyproject
withconfig
, such asmyproject.urls
becomingconfig.urls
. That way, all of our projects have their configurations in the same subdirectory.
– FlipperPA
Nov 22 '18 at 13:26
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
add a comment |
There are several thoughts of how to do this best, and only you and your team can find out what works best for you. The Django tutorial recommends keeping apps in parallel to the configuration directory. My team has settled on a few things over time:
From the project root:
.gitignore
manage.py
README.md
+---config
+---urls.py
+---wsgi.py
+---settings.py
+---requirements
+---templates
+---static
+---app1
+---models.py, etc
+---app2
Some prefer another directory layer above the project level, but that has felt like overkill to our projects. We have settled as a team on naming each project's configuration subdirectory config
, rather than the project name repeated. This is just personal preference, but has worked for us. Good luck!
There are several thoughts of how to do this best, and only you and your team can find out what works best for you. The Django tutorial recommends keeping apps in parallel to the configuration directory. My team has settled on a few things over time:
From the project root:
.gitignore
manage.py
README.md
+---config
+---urls.py
+---wsgi.py
+---settings.py
+---requirements
+---templates
+---static
+---app1
+---models.py, etc
+---app2
Some prefer another directory layer above the project level, but that has felt like overkill to our projects. We have settled as a team on naming each project's configuration subdirectory config
, rather than the project name repeated. This is just personal preference, but has worked for us. Good luck!
answered Nov 22 '18 at 3:51
FlipperPAFlipperPA
6,96322043
6,96322043
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I rundjango-admin startproject myproject
, the first thing I do it rename the subdirectorymyproject
to beconfig
, and editconfig/settings.py
to replace instances ofmyproject
withconfig
, such asmyproject.urls
becomingconfig.urls
. That way, all of our projects have their configurations in the same subdirectory.
– FlipperPA
Nov 22 '18 at 13:26
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
add a comment |
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I rundjango-admin startproject myproject
, the first thing I do it rename the subdirectorymyproject
to beconfig
, and editconfig/settings.py
to replace instances ofmyproject
withconfig
, such asmyproject.urls
becomingconfig.urls
. That way, all of our projects have their configurations in the same subdirectory.
– FlipperPA
Nov 22 '18 at 13:26
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
Did you make your project name “config”?
– aphexlog
Nov 22 '18 at 4:14
I didn't; if I run
django-admin startproject myproject
, the first thing I do it rename the subdirectory myproject
to be config
, and edit config/settings.py
to replace instances of myproject
with config
, such as myproject.urls
becoming config.urls
. That way, all of our projects have their configurations in the same subdirectory.– FlipperPA
Nov 22 '18 at 13:26
I didn't; if I run
django-admin startproject myproject
, the first thing I do it rename the subdirectory myproject
to be config
, and edit config/settings.py
to replace instances of myproject
with config
, such as myproject.urls
becoming config.urls
. That way, all of our projects have their configurations in the same subdirectory.– FlipperPA
Nov 22 '18 at 13:26
1
1
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Wouldn’t doing ‘Django-admin startproject config .’ have the same effect?
– aphexlog
Nov 22 '18 at 15:31
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
Six of one, half-dozen of another: there are some comments in the boilerplate that also insert the project name. But yes, probably easier that way, as they are just comments. Good idea!
– FlipperPA
Nov 23 '18 at 2:43
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421300%2fdjango-directory-structure-the-django-way-root-project-app-or-root-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
A project may consist of many apps. I suggest you to read a Django tutorial first and follow the best practice recommended in that tutorial.
– Selcuk
Nov 21 '18 at 23:24
Having the app under the django_project like this: /root/project/app
– t-prisar
Nov 22 '18 at 3:56