如何从Django应用程序中删除端口号

时间:2015-10-22 04:44:04

标签: python django nginx

我已经使用nginx作为代理服务器和Gunicorn将Django应用程序部署到虚拟服务器。该应用程序绑定为

#include "LinkedList.h"
#include "Node.h"




LinkedList::LinkedList()
{
    //constructor
    head = new Node("head"); //dummy variable
    tail = new Node("tail"); //dummy variable
    head->setNext(tail);

}

void LinkedList::insertNode(Node* newNode, Node *position)
{

    newNode->setNext(position->getNext());         // set its pointer to position
    position->setNext(newNode);
}

void LinkedList::insertFirst(Node* newNode)
{
    std::cout<<"head here is  "<< head->getData() <<std::endl; //
    insertNode(newNode, head);
}

void LinkedList::insertLast(Node* newNode)
{
    std::cout<<"inserting before tail (LinkedList)"<<std::endl; //
    Node* cur = head;
    std::cout<<"outside the loop "<< cur->getData() <<std::endl; //
    std::cout<<"current node is "<< cur->getData() <<std::endl; //
    while(cur->getNext() != tail) //iterate until you reach one before tail
    {
        std::cout<<"current node is "<< cur->getData() <<std::endl; //
        cur = cur->getNext();

    }
    std::cout<<"inserting before tail"<<std::endl; //
    insertNode(newNode, cur); //insert at the end before the dummy tail

}

Node* LinkedList::removeFirst()
{
    if(isEmpty())
    {
        return head;
    }
    Node* result = head->getNext(); //store pointer to Node that you need to return
    head->setNext(result->getNext());
    return result;
}


Node* LinkedList::getTail()
{
    return tail;
}

Node* LinkedList::getHead()
{
    return head;
}

int LinkedList::isEmpty()
{
    return head->getNext() == tail;
}

std::string LinkedList::printList(){
    Node *current = head;
    std::string str;
    //append pieces of string to create new line
    while(current != tail){
            str.append (" --> (");
            str.append ( current->getData());
            str.append (",");
            str.append (current->getNext()->getData());
            str.append (")") ;
            current = current->getNext();
    }
    std::cout<<str<<std::endl; //display new
    return str; //return string containing next line that will be written to a file in main

}

LinkedList::~LinkedList()
{
    //destructor
    Node *current = head;
    while( current->getNext() != tail ) { //go through whole linked list and delete each node to free memory
        Node* next = current->getNext();
        delete current;
        current = next;
    }
    delete current;
    delete tail;
}

我的nginx配置为

gunicorn --bind example.com:8000 MyApp.wsgi:application

问题在于,该应用程序在www.example.com上正常运行。但是当我们使用Django密码重置时,重置电子邮件包含这样的链接server { server_name <my_ip_address>; access_log off; location /static/ { alias /opt/examApp/static/admin/; } location / { proxy_pass http://example.com:8000; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; }

如何从链接中删除http://example.com:8000/reset/MjA/466-434d4ewe54546878b4/

1 个答案:

答案 0 :(得分:0)

尝试配置the sites framework

PasswordResetForm默认使用domain,它存储在数据库中,可以更改为您需要的任何内容。