django app is working while not included in settings.py

Multi tool use
I am reading the tutorials for django on their site.
In the first tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial01/ they are creating an app called polls and a view inside, and when running the server the view is displayed.
However, in the second tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial02/ it is mentioned that the app should be added in the installed apps section of the settings.py
To include the app in our project, we need to add a reference to its
configuration class in the INSTALLED_APPS setting. The PollsConfig
class is in the polls/apps.py file, so its dotted path is
'polls.apps.PollsConfig'. Edit the mysite/settings.py file and add
that dotted path to the INSTALLED_APPS setting.
I am not sure how it worked in the first tutorial without including the app. Isn't it mandatory to include the app? or is it mandatory only in specific use cases?
Thank you
django
add a comment |
I am reading the tutorials for django on their site.
In the first tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial01/ they are creating an app called polls and a view inside, and when running the server the view is displayed.
However, in the second tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial02/ it is mentioned that the app should be added in the installed apps section of the settings.py
To include the app in our project, we need to add a reference to its
configuration class in the INSTALLED_APPS setting. The PollsConfig
class is in the polls/apps.py file, so its dotted path is
'polls.apps.PollsConfig'. Edit the mysite/settings.py file and add
that dotted path to the INSTALLED_APPS setting.
I am not sure how it worked in the first tutorial without including the app. Isn't it mandatory to include the app? or is it mandatory only in specific use cases?
Thank you
django
add a comment |
I am reading the tutorials for django on their site.
In the first tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial01/ they are creating an app called polls and a view inside, and when running the server the view is displayed.
However, in the second tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial02/ it is mentioned that the app should be added in the installed apps section of the settings.py
To include the app in our project, we need to add a reference to its
configuration class in the INSTALLED_APPS setting. The PollsConfig
class is in the polls/apps.py file, so its dotted path is
'polls.apps.PollsConfig'. Edit the mysite/settings.py file and add
that dotted path to the INSTALLED_APPS setting.
I am not sure how it worked in the first tutorial without including the app. Isn't it mandatory to include the app? or is it mandatory only in specific use cases?
Thank you
django
I am reading the tutorials for django on their site.
In the first tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial01/ they are creating an app called polls and a view inside, and when running the server the view is displayed.
However, in the second tutorial https://docs.djangoproject.com/en/2.1/intro/tutorial02/ it is mentioned that the app should be added in the installed apps section of the settings.py
To include the app in our project, we need to add a reference to its
configuration class in the INSTALLED_APPS setting. The PollsConfig
class is in the polls/apps.py file, so its dotted path is
'polls.apps.PollsConfig'. Edit the mysite/settings.py file and add
that dotted path to the INSTALLED_APPS setting.
I am not sure how it worked in the first tutorial without including the app. Isn't it mandatory to include the app? or is it mandatory only in specific use cases?
Thank you
django
django
asked Dec 30 '18 at 0:44
user1002065user1002065
1161215
1161215
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
If you just need to show some static view of an app, defining the url is enough(which may be done in the main urls itself). However, if your app has some models and you need to include it in migrate command (and to get its tables created), you need to include it in the installed_apps.
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
add a comment |
Yes, it's mandatory to include each app you want to use in your project to INSTALLED_APPS. It helps django build paths to it's (app's) models, views, middlewares etc. It depends not only to apps written by yourself but also for third-party apps which extends django's functionality, for example django rest framework, modeltranslation and so on.
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
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%2f53974463%2fdjango-app-is-working-while-not-included-in-settings-py%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you just need to show some static view of an app, defining the url is enough(which may be done in the main urls itself). However, if your app has some models and you need to include it in migrate command (and to get its tables created), you need to include it in the installed_apps.
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
add a comment |
If you just need to show some static view of an app, defining the url is enough(which may be done in the main urls itself). However, if your app has some models and you need to include it in migrate command (and to get its tables created), you need to include it in the installed_apps.
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
add a comment |
If you just need to show some static view of an app, defining the url is enough(which may be done in the main urls itself). However, if your app has some models and you need to include it in migrate command (and to get its tables created), you need to include it in the installed_apps.
If you just need to show some static view of an app, defining the url is enough(which may be done in the main urls itself). However, if your app has some models and you need to include it in migrate command (and to get its tables created), you need to include it in the installed_apps.
answered Dec 30 '18 at 1:18
art06art06
731414
731414
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
add a comment |
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
Also for admin autodiscovery and template tag registration.
– Daniel Roseman
Dec 30 '18 at 6:33
add a comment |
Yes, it's mandatory to include each app you want to use in your project to INSTALLED_APPS. It helps django build paths to it's (app's) models, views, middlewares etc. It depends not only to apps written by yourself but also for third-party apps which extends django's functionality, for example django rest framework, modeltranslation and so on.
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
add a comment |
Yes, it's mandatory to include each app you want to use in your project to INSTALLED_APPS. It helps django build paths to it's (app's) models, views, middlewares etc. It depends not only to apps written by yourself but also for third-party apps which extends django's functionality, for example django rest framework, modeltranslation and so on.
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
add a comment |
Yes, it's mandatory to include each app you want to use in your project to INSTALLED_APPS. It helps django build paths to it's (app's) models, views, middlewares etc. It depends not only to apps written by yourself but also for third-party apps which extends django's functionality, for example django rest framework, modeltranslation and so on.
Yes, it's mandatory to include each app you want to use in your project to INSTALLED_APPS. It helps django build paths to it's (app's) models, views, middlewares etc. It depends not only to apps written by yourself but also for third-party apps which extends django's functionality, for example django rest framework, modeltranslation and so on.
answered Dec 30 '18 at 0:50


AndellysAndellys
33416
33416
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
add a comment |
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Thank you, however in this case how come it works in the first tutorial without including the app?
– user1002065
Dec 30 '18 at 1:07
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
Well, perhaps I described this not quite correctly. You can use some parts of your app such as views, utils and so on but django will not make model's migrations and some other stuff with unplagged app.
– Andellys
Dec 30 '18 at 1:14
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%2f53974463%2fdjango-app-is-working-while-not-included-in-settings-py%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
98dT,VE4krfGA3m9KYC8d6hRKEoIvx0d1T,UQz