小编mco*_*mco的帖子

带参数的django redirect()

已经有几个类似的问题已经问过,但是在花了很长时间后我找不到问题的答案.

在下面的代码中,当我使用参数"username"从"myView"重定向到"anotherView"时,它可以正常工作.但我需要在此重定向中包含"range"参数,因为重定向后使用的模板需要此"范围".每当我尝试做,我会得到几个错误,如:

- "不要把*args和**kwargs混合在一起来反转()"

有没有办法以我想要的方式管理它?

   def myView(request):
      if request.user.is_authenticated():
        if request.method == 'POST':
                #my code comes here
                ....
                return redirect('anotherView', username=request.user.username, {"range": range(int(layout))})



   def anotherView(request,username):
      if request.user.is_authenticated():
        #my code comes here
          ....
          return redirect(something)
Run Code Online (Sandbox Code Playgroud)

python django

7
推荐指数
1
解决办法
3万
查看次数

C编译器错误:找不到cdefs.h

(有类似的问题得到解答,但没有一个真正适用于此)

我有一个Fedora 20和armv71架构(32位)的主板.我已经安装所需要诸如经由荫所有GCC库gcc,g++,cmake,glibc,glibc-devel等.(glibc-devel相当于的libc6-dev-i386Fedora中).

我正在尝试编译一个C项目,它在MAC OS 64位和Ubuntu 64位上编译得很好,但在运行时在Fedora 20上给出了以下错误make:

/usr/include/features.h:364:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
Run Code Online (Sandbox Code Playgroud)

当我检查/usr/include/sys文件夹时,它是空的,并且cdefs.h文件不存在于系统的任何地方.

问题似乎是我错过了一个包(可能?)但是无法弄清楚哪一个丢失了,因为我好像已经安装了所有.或者32位C编译器因特定原因缺少该文件?任何帮助,将不胜感激.

c c++ linux gcc glibc

6
推荐指数
2
解决办法
6181
查看次数

标签 统计

c ×1

c++ ×1

django ×1

gcc ×1

glibc ×1

linux ×1

python ×1