小编Ope*_*eyi的帖子

Vercel Serverless 函数出现超时错误

我在 Vercel 上部署了一个 Nuxt.js 服务器端网站。我注意到,在某些情况下,我会收到504: GATEWAY_TIMEOUT错误,并显示代码FUNCTION_INVOCATION_TIMEOUT和消息“此无服务器函数已超时”。

为什么我会看到这个错误?

无服务器函数已超时

server serverless-framework nuxt.js serverless vercel

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

覆盖恢复密码重置电子邮件问题

美好的一天,我正在尝试覆盖 Django allauth 的 password_reset_email 。问题是它成功覆盖,但我得到的是刚刚发送给用户的 html 代码,而不是 html 表示形式。

我期待收到一封风格化的电子邮件,就像我收到的确认电子邮件一样,但情况似乎并非如此。

在我的templates/registration/password_reset_email.html

{% load i18n %}
{% autoescape off %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Confirm Your E-mail</title>
    <style>
        .body {
            background-color: #f6f6f6;
            padding: 30px;
            display: flex;
            flex-direction: row;
            justify-content: center; 
            align-items: center;
        }
        
        .content {
            background-color: #FFFFFF;
            color: #4d4d4d;
            max-width: 400px;
            padding: 20px;
            margin: auto;
        }
        
        .title {
            font-size: 20px;
            font-weight: 600;
            margin: 10px 0;
            text-align: center
        }
        
        .intro …
Run Code Online (Sandbox Code Playgroud)

django django-rest-framework django-allauth django-rest-auth

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

需要使用箭头键来浏览搜索建议

我有一个带有很好建议的搜索栏,我需要能够使用箭头键来浏览选项,但它不起作用,我真的很困惑,请你帮帮我,我一直在与这个作斗争好几天了。

var searchIndex = ["404 Error", "Address Bar", "Ajax", "Apache", "Autoresponder", "BitTorrent", "Blog", "Bookmark", "Bot", "Broadband", "Captcha", "Certificate", "Client", "Cloud", "Cloud Computing", "CMS", "Cookie", "CSS", "Cyberspace", "Denial of Service", "DHCP", "Dial-up", "DNS Record", "Domain Name", "Download", "E-mail", "Facebook", "FiOS", "Firewall", "FTP", "Gateway", "Google", "Google Drive", "Gopher", "Hashtag", "Hit", "Home Page", "HTML", "HTTP", "HTTPS", "Hyperlink", "Hypertext", "ICANN", "Inbox", "Internet", "InterNIC", "IP", "IP Address", "IPv4", "IPv6", "IRC", "iSCSI", "ISDN", "ISP", "JavaScript", "jQuery", "Meta Search Engine", "Meta Tag", "Minisite", "Mirror", "Name Server", "Packet", …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

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

重置用户 django Rest Auth 的密码

美好的一天,我正在尝试覆盖 Django allauth 的 password_reset_email 。问题是它成功覆盖,但数据(密码重置链接、站点名称和域名)未传递到电子邮件,这最终意味着用户无法重置密码,因为没有发送链接。

我的密码重置序列化器

class PasswordResetSerializer(PasswordResetSerializer):

    def get_email_options(self):
        return {
            'subject_template_name': 'account/email/password_reset_key_subject.txt',
            # 'email_template_name': 'account/email/password_reset_key.txt',
            'html_email_template_name': 'account/password_reset_key.html',
        }
Run Code Online (Sandbox Code Playgroud)

在我的templates/registration/password_reset_email.html

{% load i18n %}
{% autoescape off %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Confirm Your E-mail</title>
    <style>
        .body {
            background-color: #f6f6f6;
            padding: 30px;
            display: flex;
            flex-direction: row;
            justify-content: center; 
            align-items: center;
        }

        .content {
            background-color: #FFFFFF;
            color: #4d4d4d;
            max-width: 400px;
            padding: 20px;
            margin: auto;
        }

        .title {
            font-size: …
Run Code Online (Sandbox Code Playgroud)

django django-rest-framework django-allauth django-rest-auth

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

无法选择搜索建议

我有一个搜索栏,由于某种原因,我键入时无法选择搜索建议,我曾尝试编辑列表和其他一些方法,但是它不起作用

以下是我的代码段。

var searchIndex = ["404 Error", "Address Bar", "Ajax", "Apache", "Autoresponder", "BitTorrent", "Blog", "Bookmark", "Bot", "Broadband", "Captcha", "Certificate", "Client", "Cloud", "Cloud Computing", "CMS", "Cookie", "CSS", "Cyberspace", "Denial of Service", "DHCP", "Dial-up", "DNS Record", "Domain Name", "Download", "E-mail", "Facebook", "FiOS", "Firewall", "FTP", "Gateway", "Google", "Google Drive", "Gopher", "Hashtag", "Hit", "Home Page", "HTML", "HTTP", "HTTPS", "Hyperlink", "Hypertext", "ICANN", "Inbox", "Internet", "InterNIC", "IP", "IP Address", "IPv4", "IPv6", "IRC", "iSCSI", "ISDN", "ISP", "JavaScript", "jQuery", "Meta Search Engine", "Meta Tag", "Minisite", "Mirror", "Name Server", …
Run Code Online (Sandbox Code Playgroud)

javascript css html5

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