小编B. *_*kba的帖子

Django 和 Certbot - 未经授权、无效响应 (HTTPS)

我正在尝试使用 Nginx 配置 Certbot (Letsencrypt)。

我收到此错误:

 - The following errors were reported by the server:

   Domain: koomancomputing.com
   Type:   unauthorized
   Detail: Invalid response from
   http://koomancomputing.com/.well-known/acme-challenge/xvDuo8MqaKvUhdDMjE3FFbnP1fqbp9R66ah5_uLdaZk
   [2600:3c03::f03c:92ff:fefb:794b]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
   Not Found</h1></center>\r\n<hr><center>"

   Domain: www.koomancomputing.com
   Type:   unauthorized
   Detail: Invalid response from
   http://www.koomancomputing.com/.well-known/acme-challenge/T8GQaufb9qhKIRAva-_3IPfdu6qsDeN5wQPafS0mKNA
   [2600:3c03::f03c:92ff:fefb:794b]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
   Not Found</h1></center>\r\n<hr><center>"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
 - Your account credentials have been …
Run Code Online (Sandbox Code Playgroud)

django https nginx certbot

5
推荐指数
2
解决办法
9798
查看次数

使用 Selenium 和 Django 的 DigitalOcean (gunicorn/nginx) 的 502 错误网关

我有一个使用 Selenium 和 Django 的 DigitalOcean (gunicorn/nginx) 网络应用程序。

我正在尝试从 3 个网站抓取数据并将这些数据保存在数据库中,但如果该过程花费超过 60 秒,我会收到此错误

502 Bad Gateway
nginx/1.14.0 (Ubuntu)
Run Code Online (Sandbox Code Playgroud)

如何延长或禁用 nginx 的响应等待时间?

django selenium nginx gunicorn digital-ocean

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

将 django models.py 拆分为文件夹内的多个文件(Django 3.0.4)

我正在尝试将models.py拆分为文件夹内的多个文件。

这样做的正确方法是什么?

8年前互联网上的所有方法,现在都行不通。

更新1:

test1
    __init__.py
    admin.py
    apps.py
    tests.py
    views.py
    migrations
    models
        __init__.py
        comment.py
        like.py
        post.py
        profile.py
Run Code Online (Sandbox Code Playgroud)

init .py里面

from django.db import models
from django.conf import settings

from .like import Like
from .post import Post
from .profile import Profile
from .comment import Comment
Run Code Online (Sandbox Code Playgroud)

里面评论.py

class Comment(models.Model): 
    commented_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    for_post = models.ForeignKey(Post, on_delete=models.CASCADE)
Run Code Online (Sandbox Code Playgroud)

里面like.py

class Like(models.Model): 
    liked_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    post = models.ForeignKey(Post, on_delete=models.CASCADE)
Run Code Online (Sandbox Code Playgroud)

post.py里面

class Post(models.Model): 
    posted_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) …
Run Code Online (Sandbox Code Playgroud)

python django django-models

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