Report this

What is the reason for this report?

Web content not showing

Posted on July 22, 2017

Greetings. I am following the tutotrial how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 and its great. I uploaded my project files and ran the development server (manage.py runserver ) it worked but my web content dont show up. All I see is my actual code and css. Like this

<!DOCTYPE html>
<html>
<head>
    <title>Log-in</title>
    <link href="/static/base.css" type="text/css" rel="stylesheet">
    <link href="base.css" type="text/css" rel="stylesheet">
    <style>

        h2 {
            font-family: Arial;
        }

        a {
  color: black;
  text-decoration: cyan;
}



* {
  font-family: Cambria, Cochin, Georgia, Times, Times New Roman, serif;
 
  
}

* {
    background-color: whitesmoke;
    border: 50px;
    
    /*border-style: solid*/
    
    

}

.action-list {
    text-align: center;
    height: 100%;
    width: 20%;
    min-width: 300px;
    max-width: 1600px;
    min-height: 150px;
    max-height: 1200px;
    padding: 10px 90px 10px 350px;
    background-color: white;
    border: 5px; 
    margin: 5px 80px 65px 390px;
    overflow: scroll;
    margin: 60px 80px 65px 390px;
    
    
    
    
    

}

#info {
    text-align: center;
    width: 173%;
    
    background-color: white;
    margin: 5px 620px 5px -279px;
}

#info2 {
    text-align: left;
    width: 119%;
    padding: 10px 40px 10px -90px;
    background-color: white;
    margin: 5px 80px 65px 10px;
}

#pro { 
    padding: 10px 400px 40px 10px;
    background-color: white;
    margin: -8px 5px 30px -280px;
    
    
    width: 65%;
    
}

#fiona {
    border-radius: 100%;
    margin: -8px 5px -20px -140px;
    
    
}

#more {
    background-color: white;
    margin: -29px 5px 5px -280px;
    padding: 5px 5px 5px -5px;
    
}

#name {
    margin: -5px 5px -5px -50px;
    padding: 5px 5px 5px -5px;
    width: 65%;
}

Somebody help.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It sounds like that your Nginx configuration is not correct, I would usually use the following server block:

server {
    listen 80;
    server_name server_domain_or_IP;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/sammy/myproject;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/sammy/myproject/myproject.sock;
    }
}

For anyone who comes across this in the future, here is a link to the tutorial:

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.