django app is working while not included in settings.py

Multi tool use
Multi tool use












0















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










share|improve this question



























    0















    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










    share|improve this question

























      0












      0








      0


      1






      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 30 '18 at 0:44









      user1002065user1002065

      1161215




      1161215
























          2 Answers
          2






          active

          oldest

          votes


















          4














          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.






          share|improve this answer
























          • Also for admin autodiscovery and template tag registration.

            – Daniel Roseman
            Dec 30 '18 at 6:33



















          1














          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.






          share|improve this answer
























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          4














          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.






          share|improve this answer
























          • Also for admin autodiscovery and template tag registration.

            – Daniel Roseman
            Dec 30 '18 at 6:33
















          4














          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.






          share|improve this answer
























          • Also for admin autodiscovery and template tag registration.

            – Daniel Roseman
            Dec 30 '18 at 6:33














          4












          4








          4







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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













          1














          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.






          share|improve this answer
























          • 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
















          1














          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.






          share|improve this answer
























          • 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














          1












          1








          1







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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
          S yOF9QOyd9Kf SNKN8cpX,eR5,8YidJhZ5JPbkfh

          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas