Forum Stats

  • 3,874,761 Users
  • 2,266,769 Discussions
  • 7,911,962 Comments

Discussions

Oracle Cloud. Django. I can't runserver. Error, which ip Should I use?

User_0J6RL
User_0J6RL Member Posts: 2 Green Ribbon

Hello, I'm trying to run django server with external ip and getting error

Error: That IP address can't be assigned to.

If I use private ip it runs, but I can't get access to site or django, the site does not load. How to run django server on Oracle Cloud?.. :(

thx.

Answers

  • User_TUIFH
    User_TUIFH Member Posts: 3 Green Ribbon

    Hi all.

    It seems like I have a similar issue here. I am trying to set up Django on Nginx with uWSGI following steps from here: https://tonyteaches.tech/django-nginx-uwsgi-tutorial/.

    My problem is that web app is not accessible and I do not have any idea where is the problem.


    My setup as following:

    • Ubuntu 22.04
    • Python 3.10
    • Django 4.1.2

    I used https://dnschecker.org/ in order to verify that my domain name points to the right IP, everything looks fine there.

    It seems like there is nothing there to block the port I am using (8000):

    • Ingress rules:


    • firewall status:


    • iptables status;


    • Using virtual environment in order to run Django app;
    • Running server on localhost:


    • Running server on privet IP address;
    • Running server on external IP (getting error, see below):


    Any help would be much appreciated.

    Thanks

  • User_TUIFH
    User_TUIFH Member Posts: 3 Green Ribbon

    Hi all.

    It seems like I have a similar issue here. I am trying to Set Up Django on Nginx with uWSGI following steps from here: https://tonyteaches.tech/django-nginx-uwsgi-tutorial/

    The problem is that something is blocking access to my web app and I am not sure how to fix it.

    My setup as following:

    • Ubuntu server 22.04
    • Python 3.10.6
    • Django 4.1.2

    I am running the app on port 8000 and it seems like there is nothing there to block it:

    • ingress rules;


    • firewall status:


    • iptables status;

    The app is running inside virtual environment;

    I tried to run Django server in 3 different ways:

    • run as localhost;
    • run on privet IP address;
    • run on external server IP (gives an error message, see bellow);


    Any help would be much appreciated.


    Thanks

  • User_TUIFH
    User_TUIFH Member Posts: 3 Green Ribbon
    edited Oct 10, 2022 7:44PM

    One more thing that I forgot to mention, this is my settings.py file config;

    as you can see all hosts allowed, so that one should not be the problem as well.

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,656 Employee

    Please don't paste screen shots: :not everyone can read them; we can't text-search in them; we can't cut & paste for replies or testing.

    Typical problems with access include (i) selinux (ii) the machine's firewall.