Django cross-site reverse URLs

前端 未结 4 503
天命终不由人
天命终不由人 2021-02-01 10:41

Probably simple question and I\'m just missing something, but I\'m stuck out of ideas.

I have Django project serving several sites with distinct sessions.py

4条回答
  •  悲&欢浪女
    2021-02-01 11:21

    I would suggest making two changes. (1) Move templates to a common directory (rather than per-application) if you already haven't. (2) Investigate the newly added URL namespaces feature.

    The first change will allow you to have a common base template and selectively override it for various apps/sites. The second might serve to make your URLs "drier".

提交回复
热议问题