小编gau*_*jaj的帖子

TypeError:__ init __()占用1个位置参数,但给出3个

我知道这个标题对于一些古老的问题看起来很熟悉,但我看过它们中的每一个,都没有解决.这是我的代码:

TypeError: __init__() takes 1 positional argument but 3 were given

Traceback (most recent call last)
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\_compat.py", line 33, in reraise
raise value
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\hp user\virtual_flask\lib\site-packages\flask\app.py", line 1381, …
Run Code Online (Sandbox Code Playgroud)

python flask python-3.x

8
推荐指数
1
解决办法
2万
查看次数

没有名为'django.templates'的模块

我使用的是python 3.4,django 1.8.我正在使用pycharm进行开发.在运行程序时,我得到'没有模块名为'django.templates''错误.

settings.py

"""
Django settings for dj project.

Generated by 'django-admin startproject' using Django 1.8.1.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'uhqkhi7h_w48bz*gnr+_!roaa8@c_)087a(!ees)mn2=n=lv-r'

# SECURITY WARNING: …
Run Code Online (Sandbox Code Playgroud)

django django-templates pycharm python-3.x

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

RuntimeError:populate()在Django中不可重入

我正在尝试部署django网站.项目名称是pom.我试图使用apache2在ec2服务器上运行django网站,并收到以下错误:

Apache错误文件:

[Fri Jul 24 12:37:33.621285 2015] [:info] [pid 20446:tid 140024755709824] mod_wsgi (pid=20446): Attach interpreter ''.
[Fri Jul 24 12:37:33.621462 2015] [:info] [pid 20446:tid 140024755709824] mod_wsgi (pid=20446): Adding '/home/ubuntu/.virtualenvs/edusamosa/lib/python2.7/site-packages/' to path.
[Fri Jul 24 12:37:44.145762 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of Require all granted: granted
[Fri Jul 24 12:37:44.145888 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of <RequireAny>: granted
[Fri Jul 24 12:37:44.145947 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client …
Run Code Online (Sandbox Code Playgroud)

apache django python-2.7 ubuntu-14.04

1
推荐指数
1
解决办法
8879
查看次数