Giter Site home page Giter Site logo

djangopracticeproject's Issues

Django 实战 (2017, 第一版) 217页中的数据迁移问题

您在书中关于缩略图的使用中使用了 sudo 管理员权限进行迁移, 然而在实际开发中似乎大家倾向于使用虚拟环境(Virtualenv等)进行开发
如此, 若使用sudo命令操作, 则使用的是系统的Python, 二者的库并不相同. 不知道您使用sudo的用意是什么?
我在实际操作中还是没有使用sudo, 目前得到的结果与书中是一致的.

djang2.0内置登录方法等,已经不用login,loginout

path('login/', auth_views.login, name='user_login'),
path('new-login/', auth_views.login, {'template_name': 'account/login.html'}, name='user_login'),
path('logout/', auth_views.logout, {'template_name': 'account/logout.html'}, name='user_logout'),
path('register/', views.register, name='user_register'),
path('password-change/', auth_views.password_change, {"post_change_redirect":"/account/password-change-done", 'template_name': 'account/password_change_form.html'}, name='password_change'),
path('password-change-done/', auth_views.password_change_done, {'template_name': 'account/password_change_done.html'}, name='password_change_done'),
path('password-reset/', auth_views.password_reset, {"template_name":"account/password_reset_form.html", "email_template_name":"account/password_reset_email.html", "subject_template_name":"account/password_reset_subject.txt", "post_reset_redirect":"/account/password-reset-done"}, name="password_reset"),
path('password-reset-done/', auth_views.password_reset_done, {"template_name":"account/password_reset_done.html"}, name="password_reset_done"),
path('password-reset-confirm///', auth_views.password_reset_confirm, {"template_name":"account/password_reset_confirm.html", "post_reset_redirect":"/account/password-reset-complete"}, name="password_reset_confirm"),
path('password-reset-complete/', auth_views.password_reset_complete, {"template_name":"account/password_reset_complete.html"}, name="password_reset_complete"),

上述代码中的内置方法,已经在django2.0不适用了,代码需修改,从以下模块中导入内置方法
from django.contrib.auth.views import LoginView
url中需修改为以下代码
path('login/', LoginView.as_view(), name='user_login'), # django内置登录
path('new-login/', LoginView.as_view(), {'template_name': 'account/login.html'}, name='user_login'),

www.itdiffer.com无法访问

齐老师您好,
目前www.itdiffer.com相关课程内容无法访问了,截图显示如下:
image

您能告诉我这是什么原因吗?
希望网站能尽快恢复。也希望您的课程能越来越火
祝好!

裁剪图片为什么只是显示一小部分

$('#btnCrop').on('click', function(){
//alert("图片上传喽");
$.ajax({
url: '{% url "account:my_image" %}',
type: 'POST',
data: {"img": img},
success: function(e){
location.href= "{% url 'account:my_information' %}" },

            });
});

photo=models.ImageField(max_length=15000,blank=True)
个人信息页面显示的图片只是剪裁图片页面所剪裁图片的的一小部分

Dango实战一书中一个小问题

第61页
if request.user.is_anonymous():
....
is_anonymous()方法上有@Property
所以不能这样调用
也不是什么大问题,不过如果书卖的好,以后再版时改一下,严谨一点好。

裁剪图片的ajax不能提交

<script type="text/javascript" src= "{% static 'js/csrf.js'%}"></script>

	$('#btnCrop').on('click', function(){
		//alert("图片上传喽");
            $.ajax({
                url: '{% url "account:my_image" %}',
                type: 'POST',
                data: {"img": img},
                success: function(e){
                    location.href= "{% url 'account:my_information' %}" },

                
                });
	});

按照教程, 但是点击OK后仍然不能提交

求指点

齐老师,在修改这个章节,遇到以下问题,不知道怎么解决,请指点下,代码检查了好几次,没发现问题

image

Class 'BlogArticles' has no 'objects' member

文件 ./blog/views.py里,blog_title()函数中 blogs = BlogArticles.objects.all(),提示Class 'BlogArticles' has no 'objects' member",请教下这个怎么解决下?

内置方法重置密码

齐老师,您好!
我用内置的方法重置密码的时候,向qq邮箱发送邮件时,网页显示已经发送了,但是qq邮箱并没有收到,肯能是什么原因啊

源码2.0还有bug

Request Method: GET
http://127.0.0.1:8002/article/article-content/7/python-language/
2.0.1
ConnectionError
Error 10061 connecting to localhost:6379. 由于目标计算机积极拒绝,无法连接。.
C:\Users\Adminliujing.virtualenvs\MyDjango7-6mb12HDd\lib\site-packages\redis\connection.py in connect, line 498
C:\Users\Adminliujing.virtualenvs\MyDjango7-6mb12HDd\Scripts\python.exe
3.6.6
['D:\MyDjango7\mysite', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd\Scripts\python36.zip', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd\DLLs', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd\lib', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd\Scripts', 'e:\python36\Lib', 'e:\python36\DLLs', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd', 'C:\Users\Adminliujing\.virtualenvs\MyDjango7-6mb12HDd\lib\site-packages']
星期四, 17 一月 2019 16:35:11 +0800

1. 访问http://127.0.0.1:8002/article/list-article-titles/报错

展示个人信息章节,用get()会报错

齐老师,您好,在django2.0中,展示个人信息这个章节中,按书中的例子输入代码,用get()会一直提示书中的那个错误,在网上百度了也没有找到解决方法以,求老师指点

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.