有人可以帮助/指向正确的方向吗:
已经在 VPS 上部署了我的应用程序,并且可以移动到我的应用程序的各个页面,例如 myIP/django-bookmarks/login 或 myIP/django-bookmarks/register .....但是,当我单击应用程序本身中的选项卡时(例如注册选项卡),它将我带到 myIP/register(没有“django-bookmarks”),然后说“在此服务器上找不到 URL”。
我该如何解决这个问题?注意:我在部署方面是新手,并且在过去一周出现了一些错误、教程阅读和一些挫折之后已经到了这一点。
我的虚拟主机:
VirtualHost *:80>
ServerAdmin admin@example.com
ServerName django-bookmarks
DocumentRoot /var/www/django-bookmarks
# mod_wsgi settings
# WSGIDaemonProcess django-bookmarks python-path= /var/www/MyProject/django-$
WSGIProcessGroup django-bookmarks
WSGIScriptAlias /django-bookmarks /var/www/django-bookmarks/wsgi.py
# Static file alias so static files can be referenced by /static/
Alias /site_media/ /var/www/django-bookmarks/site_media
Alias /robots.txt /var/www/django-bookmarks/robots.txt
Alias /favicon.ico /var/www/django-bookmarks/favicon.ico
AliasMatch ^/([^/]*\.css) /var/www/django-bookmarks/django_bookmarks/site_m$ # Static files permissions
# Used for serving static files.
<Directory /var/www/django-bookmarks/site_media>
Order deny,allow
Allow from all
</Directory>
# Project wsgi permissions
# Used for serving django pages.
<Directory /var/www/django-bookmarks/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files> </Directory>
# Project wsgi permissions
# Used for serving django pages.
<Directory /var/www/django-bookmarks/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
wsgi.py
import os,sys
#comments
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_bookmarks.settings")
sys.path.append('/var/www/django-bookmarks')
sys.path.append('/var/www/django-bookmarks/django_bookmarks')
#comments
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
我很确定我在某个地方犯了错误,我很难弄清楚在哪里。任何帮助,将不胜感激。谢谢
编辑:base.html 临时
{% block external %}{% endblock %}
</head>
<body id="home">
<div id="wrapper">
<header>
<img src="/site_media/commune.png" height="200" width="400" /><div styl$
<div class="container">
<nav>
<a href="/">home</a>
<a href="/popular/">popular</a>
{% if user.is_authenticated %}
<a href="/save/">submit</a>
<a href="/search/">search</a>
<a href="/tag/">tags</a>
<a href="/user/{{ user.username }}/">{{ user.username }}</a><a href="/logout">logout</a>
{% else %}
<a href="/login/">login</a>
<a href="/register/">register</a>
<a href="/reports/">reports</a>
<a href="/FAQ/">FAQ's</a>
{% endif %}