When Django matches URLs, it matches them from top to bottom in the URL list '' can match anything''能匹配任何东西 所以admin就无法访问了 在使用''So the admin cannot access
When using '' When matching a wide range of URL regular expressions, it is recommended to put it at the end of the URL list🎜
In addition to the matching problem mentioned above There is also a misunderstanding in the way you write the URL Like your matchingindex的时候最好使用r'^$' Generally, the more complex the URL, the higher it is placed
When Django matches URLs, it matches them from top to bottom in the URL list
When using''
can match anything''
能匹配任何东西所以admin就无法访问了
在使用
''
So the admin cannot access''
When matching a wide range of URL regular expressions, it is recommended to put it at the end of the URL list🎜In addition to the matching problem mentioned above
There is also a misunderstanding in the way you write the URL
Like your matching
index
的时候最好使用r'^$'
Generally, the more complex the URL, the higher it is placed