-1
我完全失去了爲什麼我的網頁沒有鏈接。他們似乎沒有引用正確的文件路徑...我試圖鏈接以下3頁。Django/Python新手,完全失去了爲什麼我的網頁沒有鏈接
- 的主頁
- 在主頁上與「registerprofessional.html」所以,當我點擊「藝術家」右上角的「藝術家」圖標,它帶我到註冊頁面
- 的在主頁上與「registeruser.html」所以,當我點擊「客戶」右上角「客戶」圖標,就帶我去註冊頁面
我已經添加下面我的代碼:
- home.html做爲
- registerprofessional.html
- registeruser.html 附作爲圖像
- 文件結構
- registerprofessional誤差上添加作爲圖像
- 寄存器用戶錯誤我得到當點擊鏈接時,我得到點擊作爲圖像添加的鏈接
- urls.py 請讓我知道如果我需要添加任何其他東西。
見代碼:
1)home.html做爲
<!doctype html>
<html>
<head>
<title>ArtistsDecoded</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/static/web/css/vendor/bootstrap.min.css">
<link rel="stylesheet" href="/static/web/css/home.css">
<!-- background image changer
<script type="text/javascript">
$(window).load(function() {
var i =0;
var images = ['images/homepage/Arianna.jpg','images/homepage/vintagecam.jpg','images/homepage/10505026_413590265448462_3108080538408848321_o.jpg'];
var image = $('#slideit');
//Initial Background image setup
image.css('background-image', 'url(images/homepage/Arianna.jpg)');
//Change image at regular intervals
setInterval(function(){
image.fadeOut(1000, function() {
image.css('background-image', 'url(' + images [i++] +')');
image.fadeIn(1000);
});
if(i == images.length)
i = 0;
}, 5000);
});
</script>
-->
</head>
<body style="background-image:url(/static/web/img/homepage/arianna.jpg)">
<!-- background image changer not working <div id="slideit" style="width:700px;height:391px;"></div>
-->
<div class="container">
<!--row 1-->
<header class="row">
<div class="col-xs-3">
<div id="title">
<p><a href="home.html"><i>ArtistsDecoded</i></a></p>
</div>
</div>
<div class="col-xs-5"></div>
<div id="loginbar">
<div class="col-xs-1">
<div id="createprofile">
<p><a href="registerprofessional.html">Artists</a></p>
</div>
</div>
<div class="col-xs-1">
<div id="signup">
<p><a href="registeruser.html">Customers</a></p>
</div>
</div>
<div class="col-xs-1">
<div id="help">
<p><a href="homepagebootstrap.html">Help</a></p>
</div>
</div>
<div class="col-xs-1">
<div id="login">
<p><a href="login.html">Log In</a></p>
</div>
</div>
</div>
</header><!--top bar-->
<!--row 2-->
<div class="row">
<div class="col-md-12 center-block">
<div class="welcome_text_div center-block">
<br></br><br></br><br></br><br></br><br></br><br></br><br></br>
<div class="how_it_works_box text-center">
<a href="#" id="how_it_works">
How It Works
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 center-block">
<div class="searchbardiv text-center">
<form action="">
<br></br><br></br><br></br><br></br>
<select class="selectprofession">
<option>What Are You Looking For?</option>
<option>Hair Stylist</option>
<option>Henna Artist</option>
<option>Make-up Artist</option>
<option>Photographer</option>
<option>Videographer</option>
</select>
<input id="locationbox" type="text" placeholder="Where?"/>
<input class="datebox" type="date" name="Date From?"/>
<input class="datebox" type="date" name="Date To?"/>
<input id="search" type="submit" value="Search" />
</form>
</div>
</div>
</div>
</div><!--container-->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/static/web/js/bootstrap.min.js"></script>
</body>
</html>
2)registerprofessional.html
<!doctype html>
<html>
<head>
<title>ArtistsDecoded</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--bootstrap-->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/registertemp.css">
</head>
<body>
<div class="row">
<div class="col-xs-12">
<div class="title"><i>ArtistsDecoded</i></div>
</div>
</div>
<hr>
<div class="container">
<br></br>
<div class="row">
<div class="col-xs-12">
<div class="form">
<h4><img class="registerimage" src="Images/Registertemp/registertemp.jpg" alt="register" height="35px"></img><strong>Register Your Serices</strong></h4>
<p>Be the first to know when we launch this site!<p>
<form role="form">
<div class="form-group">
<Select name="Profession" multiple>
<option>Select Profession*</option>
<option value="make-up artist">Make-up Artist</option>
<option value="mehndi artist">Mehndi Artist</option>
<option value="hair stylist">Hair Stylist</option>
<option value="photographer">Photographer</option>
<option value="dhol group">Dhol Group</option>
</Select>
</div>
<div class="form-group">
<label class="sr-only" for="firstname">First name:</label>
<input type="name" class="form-control" id="fname" placeholder="First name">
</div>
<div class="form-group">
<label class="sr-only" for="surname">Surname:</label>
<input type="name" class="form-control" id="sname" placeholder="Surname">
</div>
<div class="form-group">
<label class="sr-only" for="email">Email address:</label>
<input type="email" class="form-control" id="email" placeholder="Email">
</div>
<div class="form-group">
<label class="sr-only" for="number">Phone number:</label>
<input type="text" class="form-control" id="phone" placeholder="Phone number">
</div>
<div class="form-group">
<label class="sr-only" for="instagramid">Instagram ID:</label>
<input type="text" class="form-control" id="instagram" placeholder="Instagram ID">
</div>
<div class="form-group">
<label class="sr-only" for="facebookid">Facebook ID:</label>
<input type="text" class="form-control" id="facebook" placeholder="Facebook ID">
</div>
<div class="form-group">
<label class="sr-only" for="twitterid">Twitter ID:</label>
<input type="text" class="form-control" id="twitter" placeholder="Twitter ID">
</div>
<p class="selectinstructions">*Hold down the Ctrl (windows)/Command (Mac) button to select multiple options.</p>
<div class="checkbox">
<label><input type="checkbox">I have read & agree with the <a href="termsandconditions.html">terms and conditions</a></label>
</div>
<button type="submit" class="btn btn-primary btn-md" rel="contact_form1" id="contact_form1_button">Submit</button>
</form>
</div><!--form-->
</div><!--col-->
</div><!--row-->
</div><!--container-->
<script src="jquery/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
3)registeruser.html
<!doctype html>
<html>
<head>
<title>ArtistsDecoded</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--bootstrap-->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/registertemp.css">
</head>
<body>
<div class="row">
<div class="col-xs-12">
<div class="title"><i>ArtistsDecoded</i></div>
</div>
</div>
<hr>
<div class="container">
<br></br>
<div class="row">
<div class="col-xs-12">
<div class="form">
<h4><img class="registerimage" src="Images/Registertemp/findservices.jpg" alt="register" height="35px"></img><strong>Looking for a Professional</strong></h4>
<p>Be the first to know when we launch this site!<p>
<form role="form">
<div class="form-group">
<label class="sr-only" for="firstname">First name:</label>
<input type="name" class="form-control" id="fname" placeholder="First name">
</div>
<div class="form-group">
<label class="sr-only" for="surname">Surname:</label>
<input type="name" class="form-control" id="sname" placeholder="Surname">
</div>
<div class="form-group">
<label class="sr-only" for="email">Email address:</label>
<input type="email" class="form-control" id="email" placeholder="Email">
</div>
<div class="form-group">
<label class="sr-only" for="number">Phone number:</label>
<input type="text" class="form-control" id="phone" placeholder="Phone number">
</div>
<div class="checkbox">
<label><input type="checkbox">I have read & agree with the <a href="termsandconditions.html">terms and conditions</a></label>
</div>
<button type="submit" class="btn btn-primary btn-md" rel="contact_form1" id="contact_form1_button">Submit</button>
</form>
</div><!--form-->
</div><!--col-->
</div><!--row-->
</div><!--container-->
<script src="jquery/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
5)錯誤 - Registerprofessional
6)錯誤 - Registeruser
7)urls.py
"""
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^$', 'src.views.home', name='home'),
url(r'^admin/', include(admin.site.urls)),
]
比ks提前尋求幫助
點擊鏈接時,鏈接會在哪裏? – TheoretiCAL
你有沒有嘗試過預先設置好你的路徑的「/」,讓它們變成相對的?即/registeruser.html – TheoretiCAL
@TheoretiCAL道歉,已添加錯誤的屏幕截圖...關於你的第二點,我添加了'/'並且命中了cmd + s(我在mac上)......它似乎並沒有保存我的更改。我可以看到這一點,因爲我也改變了標題,這也沒有反映出來......這可能是問題嗎?連接問題還是我錯過了一些非常簡單的東西,你認爲。 – vtj808