Django - Website Home Page

前端 未结 3 1579
甜味超标
甜味超标 2021-02-07 03:53

I\'ve been having a look at Django and, from what I\'ve seen, it\'s pretty darn fantastic. I\'m a little confused, however, how I go about implementing a \"home page\" for my we

3条回答
  •  执笔经年
    2021-02-07 04:24

    There's no real rule for this, But one thing I like to do is actually arrange for the index access to redirect to another spot. If you prefer, though, you can just give the index page a plain view.

    That said, It's probably a good idea to keep all your code in an actual app, so that you can refactor it more easily, and so that it appears on the python path as a normal module. Putting views in the project rather than an app seems to cause more headaches than it solves.

提交回复
热议问题