Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session问题解决和模版文件优化 #338

Merged
merged 9 commits into from
Nov 23, 2016
Merged

session问题解决和模版文件优化 #338

merged 9 commits into from
Nov 23, 2016

Conversation

LuPan2015
Copy link
Collaborator

@LuPan2015 LuPan2015 commented Nov 16, 2016

完成的功能如下:

  1. 修复session问题: Fixed login界面,在用户session失效时,首次登录会失败 #331
    session如果失效则直接跳回登录页面.
  2. 优化模版方便形成一键部署
    新版的模版会对一下2个命令做优化:
      npm run build  #可以直接生成django可以识别的index.html文件不用做任何修改
    npm start #执行改命令前不用每次修改webpack.config文件。
  3. 编写build.sh脚本
    sh build.sh # 直接帮你编译好前端代码并拷贝到sirius web对应的目录。不用做任何操作就可以直接启动sirius了
  4. 代码风格
    1. = 号两边为1个空格
    2. , 号后面为1个空格

2. 优化模版方便形成一键部署
3. 编写build.sh脚本
@qqzxingchen
Copy link
Contributor

按照最新的代码做镜像,部署运行后会报错,排查后发现问题原因为:

Aries/user_auth/templates/index/index.html 文件
指定主js文件的语句有问题:
        <script src="{% static 'aries/app..js' %}" > </script>
正确的应该是下面的样子:
        <script src="{% static 'aries/app.51da56de08b01c697425.js' %}" > </script>

@qqzxingchen
Copy link
Contributor

已经通过修改 Dockerfile、build.sh 文件,将bug修复

@@ -5,7 +5,7 @@ django-bootstrap-tags==1.2.0
Django==1.8.6
djangorestframework-jsonp==1.0.2
requests==2.10.0
uWSGI==0.8
#uWSGI==0.9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要就删掉?

return HttpResponse('<h2>Permission Forbidden!</h2>')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般会说"Permission denied"或直接"Forbidden","Permission Forbidden"不这么写

npm install
npm run build

rm -rf ${staticHome}/*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf 删除之前最好判断一下前面的变量是否为空. 因为该数据的执行权限是root. 如果前面的 {staticHome}为空。则会导致整个机器都完了。

def login(request):
if request.method == "POST":
res = {}
username = request.POST.get("username")
password = request.POST.get("password")
email = username + "@baifendian.com"
ldap_user = ldap_get_vaild(username=username,passwd=password)
# ldap_user = ldap_get_vaild(username=username,passwd=password)
ldap_user = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不做ldap验证了?

Copy link
Collaborator Author

@LuPan2015 LuPan2015 Nov 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以了。 @abigbigbird

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@qqzxingchen qqzxingchen merged commit c0924ea into dev Nov 23, 2016
@qqzxingchen qqzxingchen deleted the fix-session-tpl branch November 23, 2016 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants