Skip to content

Commit 66b8ba4

Browse files
committed
适配Django2.2 xadmin ueditor 可用性
1 parent 97065e4 commit 66b8ba4

File tree

87 files changed

+505
-4233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+505
-4233
lines changed

.idea/VueDjangoFrameWorkShop.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 325 additions & 297 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Readme.md renamed to README.MD

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.org/mtianyan/hexoBlog-Github.svg?branch=master)](https://travis-ci.org/mtianyan/hexoBlog-Github)
44
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
55

6-
使用Python3.6与Django2.0.2(Django-rest-framework)以及前端vue开发的前后端分离的商城网站
6+
使用Python3.7与Django2.2(Django-rest-framework)以及前端vue开发的前后端分离的商城网站
77

88
项目支持支付宝支付(暂不支持微信支付),支持手机短信验证码注册, 支持第三方登录。集成了sentry错误监控系统。
99

@@ -23,19 +23,14 @@ use the address: http://127.0.0.1:8000/
2323

2424
## Contents:
2525

26-
对应教程已开通简书连载文集: https://www.jianshu.com/nb/22309475
27-
28-
**欢迎大家关注订阅,点赞!!!**
29-
3026
[原版视频课程地址:](https://coding.imooc.com/learn/list/131.html)
3127

3228
## About me
3329

34-
[简书](https://www.jianshu.com/u/db9a7a0daa1f) && [mtianyan's blog](http://blog.mtianyan.cn/)
3530

3631
有趣的Python群:619417153
3732

38-
欢迎关注简书,star项目!谢谢!
33+
欢迎star项目!谢谢!
3934

4035
你的关注支持是我继续分享前进的动力。
4136

VueDjangoFrameWorkShop/local_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'ENGINE': 'django.db.backends.mysql',
1111
'NAME': 'vue_shop',
1212
'USER': 'root',
13-
'PASSWORD': 'tp158917',
13+
'PASSWORD': 'mtianyanroot',
1414
'HOST': '127.0.0.1',
1515
"OPTIONS": {"init_command": "SET default_storage_engine=INNODB;"}
1616
}

VueDjangoFrameWorkShop/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,17 @@
229229
import os
230230
import raven
231231

232+
CORS_ORIGIN_WHITELIST = [
233+
'http://localhost:3000',
234+
'http://localhost:8000',
235+
'http://localhost:8080',
236+
]
237+
232238
RAVEN_CONFIG = {
233239
'dsn': 'https://<key>:<secret>@sentry.io/<project>',
234240
}
235241

236-
REMOTE_DEBUG = True
242+
REMOTE_DEBUG = False
237243
PROJECT_ROOT = os.path.join(BASE_DIR, 'VueDjangoFrameWorkShop')
238244
if DEBUG and REMOTE_DEBUG:
239245
try:

apps/goods/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
class GoodsPagination(PageNumberPagination):
2727
page_size = 12
2828
# 向后台要多少条
29+
2930
page_size_query_param = 'page_size'
3031
# 定制多少页的参数
3132
page_query_param = "page"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.2 on 2019-06-19 16:50
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
('trade', '0003_auto_20180304_1535'),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name='orderinfo',
14+
name='pay_type',
15+
field=models.CharField(choices=[('alipay', '支付宝'), ('wechat', '微信')], default='alipay', max_length=10, verbose_name='支付类型'),
16+
),
17+
]

apps/users/serializers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ class UserRegSerializer(serializers.ModelSerializer):
6464

6565
# 调用父类的create方法,该方法会返回当前model的实例化对象即user。
6666
# 前面是将父类原有的create进行执行,后面是加入自己的逻辑
67-
# def create(self, validated_data):
68-
# user = super(UserRegSerializer, self).create(validated_data=validated_data)
69-
# user.set_password(validated_data["password"])
70-
# user.save()
71-
# return user
67+
def create(self, validated_data):
68+
user = super(UserRegSerializer, self).create(validated_data=validated_data)
69+
user.set_password(validated_data["password"])
70+
user.save()
71+
return user
7272

7373
def validate_code(self, code):
7474

apps/users/signals.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
def create_auth_token(sender, instance=None, created=False, **kwargs):
1818
# 是否新建,因为update的时候也会进行post_save
1919
if created:
20-
password = instance.password
21-
instance.set_password(password)
22-
instance.save()
20+
pass
21+
# password = instance.password
22+
# instance.set_password(password)
23+
# instance.save()

0 commit comments

Comments
 (0)