datacenter / ignite-DEPRECATED

Fire up your network with built-in poap on your Cisco Nexus switches and Ignite.
34 stars 19 forks source link

index pages does not displayed #2

Open Hemakuma opened 9 years ago

Hemakuma commented 9 years ago

Request Method: GET Request URL: http://10.114.217.249:8000/ui/index.html "/data/dist/index.html" does not exist

i changed the prod.py

UI_ROOT = os.getcwd()+ '/dist' to UI_ROOT = os.getcwd()+ '/ignite/dist'

Now i can see the index page but am not able to authenticate. the username/password was created successfully.

What else can i check to see why authentication is not working. It does not give any errors. Even the server does not show any errors.

vinayakbhakta commented 9 years ago

I think that you executing the "python manage.py runserver" in the incorrect directory.

Please keep UI_ROOT as "os.get_cwd() + '/dist'" and run the "python manage.py runserver" in the base ignite (https://github.com/datacenter/ignite) directory.

If you still facing issues, please post what is the authentication error you are seeing.

Hemakuma commented 9 years ago

ok changed back the url to /dist and run the manage.py from the ignite directory.

python manage.py runserver 172.17.0.19:8000

I get the authentication page and i enter the admin/admin but it goes no where. It seems like its doing something but then it stops.

here is what i see on the server side

[13/Sep/2015 23:11:02] "GET /ui/index.html HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/scripts.1fbaebdf.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/vendor.5383e6c0.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/styles/vendor.da6aa26e.css HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/pluginjs/snap.svg-min.b92f25bc.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/styles/main.9e5a8f97.css HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/pluginjs/snap.svg-connectors.bebb05cc.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/pluginjs/svg-pan-zoom.min.d07f5756.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/utils/topology-generator.51e716ed.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/utils/settings.6fc59791.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/scripts/modules/topology_viewer.546d6ba8.js HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/pages/common/views/svgimages.html HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/pages/common/views/header.html HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/pages/common/views/footer.html HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/pages/common/views/login.html HTTP/1.1" 304 0 [13/Sep/2015 23:11:02] "GET /ui/images/icon-person.jpg HTTP/1.1" 200 7308 [13/Sep/2015 23:11:02] "GET /ui/images/userimg.jpg HTTP/1.1" 200 6755 [13/Sep/2015 23:11:02] "GET /ui/images/logo.png HTTP/1.1" 200 15957 [13/Sep/2015 23:11:02] "GET /ui/images/color-logo.png HTTP/1.1" 200 16982

vinayakbhakta commented 9 years ago

When you entered admin/admin, you should get a

"POST /auth/login/ HTTP/1.1" 200

on the server side.

A few things to check

dgjustice commented 9 years ago

I have the same exact problem. When I authenticate, the POST never makes it to the box. I have tried a few different browsers with no luck. I am running from the OVA. I noticed the second "baseURL" and changed it to match the server IP as well with the same results. I also tried the original 9010 port with no luck. When the login page is initially rendered, I can see the request for the js file and a staus of 304. I even tried to create a new user and login. The user creation worked fine, but the login was still unresponsive.

angular.module("PoapServer")
    .constant('appSettings', {
        "static" : {
          "baseURL" : "http://10.0.2.15:8000"
        },

        //API URL
        "appAPI": {
            "baseURL": "http://10.0.2.15:8000",

...

Django version 1.7, using settings 'ignite.prod' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. [16/Sep/2015 02:58:53] "GET /ui/index.html HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/styles/main.9e5a8f97.css HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/styles/vendor.da6aa26e.css HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/vendor.5383e6c0.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/scripts.1fbaebdf.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/pluginjs/snap.svg-min.b92f25bc.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/pluginjs/snap.svg-connectors.bebb05cc.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/pluginjs/svg-pan-zoom.min.d07f5756.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/utils/topology-generator.51e716ed.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/modules/topology_viewer.546d6ba8.js HTTP/1.1" 304 0 [16/Sep/2015 02:58:53] "GET /ui/scripts/utils/settings.6fc59791.js HTTP/1.1" 200 15086

vinayakbhakta commented 9 years ago

As I said above, you will have to attach a client side debugger to see what is the issue. It is important to understand what happens to the authentication request on client.

FYI, the second "baseURL" has no impact on this. No need to change that.

One more thing - I noticed that your runserver is running on 0.0.0.0. "Starting development server at http://0.0.0.0:8000/" Shouldn't that be 10.0.2.15?

dgjustice commented 9 years ago

NAT breaks the application because the API crafts URLS based on the configured address on the backend. Once I setup VirtualBox for a bridged network, everything works fine. As far as the 0.0.0.0 address, please see: https://docs.djangoproject.com/en/1.7/ref/django-admin/#runserver-port-or-address-port

senglobe commented 9 years ago

Hi,

Many thanks for your efforts, looks like this will be cool tool to have. I tried to install and explore but didn't success.

I do face the same issue as other folks mentioned here. After the index page i cant proceed further. It is not throwing authentication failure either.

observations:

  1. I don't see "POST /auth/login/ HTTP/1.1" 200 in the server when i try to login from browser
  2. when I use json POST to login, it is getting authenticated and providing token too. ignite@ignite:~$ curl -X POST -i -H "Content-type: application/json" http://192.168.1.5:8080/auth/login/ -d '{"username":"admin", "password":"admin"}' HTTP/1.0 200 OK Date: Thu, 17 Sep 2015 08:04:15 GMT Server: WSGIServer/0.1 Python/2.7.6 Access-Control-Allow-Headers: Content-Type,,Authorization Vary: Accept, Cookie Allow: POST, OPTIONS Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE Content-Type: application/json X-Frame-Options: SAMEORIGIN

{"auth_token":"e18493f60b2e91519dd2d29716a17b40cccdd91b"}ignite@ignite:~$

  1. i can do the same in the browser as well with URL http://192.168.1.5:8080/auth/login/ . In both the cases I do see POST in the server console. [17/Sep/2015 13:04:35] "POST /auth/register/ HTTP/1.1" 400 63
  2. I tried various browser(firefox,safari,chrome) and OS (win/mac), authentication is not getting through.

one more, please add username and pwd (ignite/ignite) of the OVA server in the read me , after a long struggle it worked me in the fluke. step 5 and 6 can be interchanged.

Regards Senthil