已采納回答 / qq_晨曦8快樂_0
from?django.contrib?import?admin
from?django.urls?import?path
from?django.conf.urls?import?url,include
from?.?import?views
app_name?=?'[blog]'
urlpatterns?=?[
??#??path('admin/',?admin.site.urls),
????path('index/',?views.ind...
2019-07-19
def article_page(request,article_id):
article = models.Article.objects.get(pk=article_id)
#錯誤.前面加了blog/
#return render(request,'blog/article_page.html', {'article': article})
return render(request,'article_page.html',{'article':article})
article = models.Article.objects.get(pk=article_id)
#錯誤.前面加了blog/
#return render(request,'blog/article_page.html', {'article': article})
return render(request,'article_page.html',{'article':article})
2019-07-17
最新回答 / 找個大神
context must be a dict rather than set.? ?內容必須是字典而不是集合,檢查你views.py中 content格式
2019-07-16
最新回答 / 慕萊塢7143366
你是直接把path改了吧,這是自帶的一條管理頁面,應該復制一行再改成indexpath('admin/', admin.site.urls),path('index/', bv.index),
2019-06-27
最贊回答 / 慕勒1253529
article_page.html中 修改文章的href url是不是寫的'blog:article_page'而不是'blog:edit_page'?我之前也是在這里寫錯了
2019-06-27
最新回答 / Ethan_Ban
我沒學這個課程。但你這個問題,應該是在這個目錄下沒有安裝django,或者安裝的django沒有把路徑加入到環境變量中。 你可以運行pip3 list查驗。? 我的建議是創建虛擬環境virtualenv,在虛擬環境中安裝需要的包。如下圖,進入虛擬環境,方便管理。<...圖片...>
2019-06-19