0
我使用django-simple-captcha爲網頁上的不同聯繫人按鈕創建驗證碼。我想我擁有這一切除了事實的工作,對於驗證碼won't show up.圖像沒有顯示爲django-simple-captcha
urls.py圖像:
from django.conf.urls import url
from django.conf.urls import include
from . import views
urlpatterns = [
url(r'^$', views.product_landing, name='product_landing'),
url(r'(?P<product_slug>.*)/?$', views.product_detail,
name='product_detail'),url(r'^captcha/', include('captcha.urls'))
]
HTML頁面爲:
</form>
{% else %} {% if is_valid %}
<div style="margin-top: 70px; margin-bottom: 200px;">
<h1 style="margin-bottom: 25px">Thank you!</h1>
<p style="font-size: 17px; line-height: 32px;;">Your resume has been received and we will be in touch with a decision soon. Please contact us if you have any questions.</p>
</div>
{% else %}
<form action="" method="POST" id="apply-form" enctype="multipart/form-data" class="application-form">
{% csrf_token %}
<div class="firstname {% if form.first_name.errors %}form-error{% endif %}">
<p>FIRST NAME</p>
{{ form.first_name }}
</div>
<div class="lastname {% if form.last_name.errors %}form-error{% endif %}">
<p>LAST NAME</p>
{{ form.last_name }}
</div>
<div class="email {% if form.email.errors %}form-error{% endif %}">
<p>EMAIL</p>
{{ form.email }}
</div>
<div class="phone {% if form.phone.errors %}form-error{% endif %}">
<p>PHONE</p>
{{ form.phone }}
</div>
<div class="resume-container {% if form.resume.errors %}form-error{% endif %}">
<p>ATTACH PDF RESUME</p>
<input class="readonly" type="text" READONLY>
<div class="resume">
{{ form.resume }}
<div id="browse">
<a>BROWSE</a>
</div>
</div>
</div>
<div class="message {% if form.message.errors %}form-error{% endif %}">
<p>MESSAGE</p>
{{ form.message }}
</div>
{{ form.captcha }}
<button class="submit-button" type="submit">
APPLY
</button>
</form>
我根據文檔更新了我的表單和設置,所以我不認爲這是問題。從我目前所瞭解的情況來看,我認爲它必須與圖像庫有關,但我不太確定。我安裝了Pillow 4.1.1,如果有幫助,我在Mac上。
您的網絡服務器訪問日誌對這些圖像請求有什麼條目? –
啊,我忘了提及我在自己的系統上運行這個開發,並沒有將這些改變推到網絡服務器上。 – Jdubb
但是你的本地機器上仍然有多種web服務器運行,即使它只是django開發web服務器,對吧? –