python - Django override template static file location -


If I override templates for an installed app, then I Html file to / templates / appname / / code>. I'm wondering where is the appropriate place to store static files for those override templates?

Will I put them in / common_static / appname ? Or is there a better place or way to override better templates at once?

Ex application is given the notification name:

  A "???" ??? A generalist One ???? One ???? Line Notifications "One" CSS One ???? One ???? One ???? Line Styles.css A "One" ???? Line Line Js one ???? One ???? Line Line anim.js a ???? One ???? Line Templates one ???? One ???? One ???? Line Base.htmlA "A" ??? Line Notifications "A" file1.html A "A" ??? Line There are several ways to store templates and statics in Django: file2.html      

The following are two architectures that can be used:

A which you have described above:

/ template - Store all templates of the project with the folder ap_name to store application specific templates

/ static - Application specific templates Store all statics of the project with the folder ap_name to store

  • It is fully in use that you will know where All of the are your project's templates and static files.

  • This is also easy to manage and the low potential name contradictory.

    B. Store templates and statics in specific applications:

    Template - Store Only Project Level Samples eg Base.html, 404.html etc

    APP_NAME & gt; / Templates - Store all templates related to that specific app.

    Still - Store only project level statuses Favicon.ico etc.

    app_name / static - Store all the statics related to that specific app.

    • If you want Create a standalone app , which can be used independently < Li>

      But in this case there are more possibilities of name conflicts , so you have to follow some naming conventions like the prefix 'APP_NAM_' some other before template names.

      (& Lt ; App_name & gt; / templates) STATICFILES_DIRS = (& lt; app_name & gt; / static)

      And you should run ./bin/answer.py collectstatic To work in the production mode for your situation (i.e. DEBUG = False)

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -