当我尝试跑步时
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion",
"s3:DeleteObject",
"s3:DeleteObjectVersion"
],
"Resource":"arn:aws:s3:::examplebucket/${aws:username}/*"
}
]
}
显示以下错误,
python manage.py makemigrations
这是我的项目urls.py文件,
path('account/', include('django.contrib.auth.urls', namespace='auth')),
File "/home/barsmansvps/DataScience/anaconda3/lib/python3.6/site-packages/django/urls/conf.py", line 39, in include
'Specifying a namespace in include() without providing an app_name '
django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
答案 0 :(得分:0)
从Django Documentation引述,这是 include()
方法的可能签名
include(module, namespace=None, app_name=None) include(pattern_list) include((pattern_list, app_namespace), namespace=None) include((pattern_list, app_namespace, instance_namespace))
因此将您的urls.py
更改为
urlpatterns = [
path('', include('home.urls')),
# path('', include('pages.urls')),
path('products/', include('products.urls')),
path('reports/', include('reports.urls')),
path('account/', include(('social_django.urls', 'social_django'), namespace='social')),
path('account/', include(('django.contrib.auth.urls', 'django'), namespace='auth')),
path('admin/', admin.site.urls),
]