Mysite. url. py
Urlpatterns = patterns ('mysite. Video. view ',
# (R' ^ static /(? P <path>. *) $ ', 'django. Views. Static. serv ',
# {'Document _ root': settings. media_root }),
# Example:
(R' ^ $ ', 'index '),
# (R '^ mysite/', include ('mysite. Foo. urls ')),
URL (r '^ Video/', include ('mysite. Video. urls ')),
# Uncomment the admin/DOC line below to enable admin documentation:
# (R '^ admin/doc/', include ('django. contrib. admindocs. urls ')),
# Uncomment the next line to enable the admin:
(R' ^ admin/', include (Admin. Site. URLs )),
)
Mysite. Video. url. py
Urlpatterns = patterns ('',
(R' ^ static /(? P <path>. *) $ ', 'django. Views. Static. serv ',
{'Document _ root': settings. media_root }),
# (R' ^ JS /(? P <path>. *) $ ', 'django. Views. Static. serv ',
# {'Document _ root': "/var/www/mysite/static/JS "}),
# (R' ^ image /(? P <path>. *) $ ', 'django. Views. Static. serv ',
# {'Document _ root': "/var/www/mysite/static/image "}),
URL (R' ^ $ ', index, name = "Index "),
URL (R' ^ login/', login, name = "login "),
URL (R' ^ register ', register, name = "register "),
URL (r '^ logout', logout, name = "logout "),
URL (R' ^ setting/', setting, name = "setting "),
URL (R' ^ setserver/', setserver, name = "setserver "),
URL (R' ^ setcamera/', setcamera, name = "setcamera "),
URL (R' ^ history/', history, name = "History "),
URL (R' ^ live/', live, name = "live "),
URL (R' ^ replay/', replay, name = "replay "),
URL (R' ^ config/', config, name = "Config "),
)
When httpresponseredirect ("live") or hyperlink is in the view, the generated URL is http: // localhost/mysite/Video/live/and the page is not displayed completely
When httpresponseredirect ("/Video/live") or the hyperlink is prefixed with/video, the generated URL is http: // localhost/Video/live/and the page is fully displayed.
Why?