Why openattic could not be used when using "manage.py runserver "

22 views
Skip to first unread message

Larry

unread,
Jan 8, 2018, 11:22:17 PM1/8/18
to openATTIC Users
Hi all,
I'm a new beginner in django.

I just want to debug it, and I tried to run "./manage.py runserver 0:8000"

But I can not access openattic web portal using url my_ip:8000

Is there any way to run openattic without apache??

Thanks
Larry


Sebastian Wagner

unread,
Jan 9, 2018, 4:52:53 AM1/9/18
to openATTIC Users
Hi Larry,

we mainly use Django's embedded server for developing openATTIC. 

There is only one major difference between the Apache deployment compared to the Django server: The frontend needs to know that it needs to skip the /openattic prefix. 

There are about 2 to 3 .js files in the /webui and /webui/app folders where you're going to need to remove the /openattic prefix from string constants. Then you have to build the frontend with npm run build and then you're good to go. 

Please keep in mind that this is not really a supported deployment configuration. 

- Sebastian

Patrick Nawracay

unread,
Jan 9, 2018, 5:48:15 AM1/9/18
to Larry, openATTIC Users
Hi Larry,

yes, there's a way to run openATTIC without Apache!

And in fact, it looks like you've started the server correctly.

The reason why you don't see the frontend may be that openATTIC is, by
default, configured to use "openattic" as path right after the
hostname/port in the URL (http://host:port/openattic).  The Django web
server makes the contents of openATTIC available on the root path.
 That means, that the frontend is wrongly configured for the Django web
server and the path needs to be adapted.  Afterwards, you'd need to
rebuild the frontend. I'll guide you through this.

1. Change the API URL in `webui/app/config.js` from "/openattic
/api/" to "/api/".

2. Next, you'll need to create the file `webui/app/webpack.config.json`
with the following content:

{
  "target": "http://0.0.0.0:8000",
  "contextRoot": "/"
}


3. And last you'll need to rebuild the frontend. Do so by executing
`npm run build` in the `webui/` folder.

If `npm run build` doesn't work for you, it's likely that you're
missing some dependencies which need to be installed. These are "node"
(or "nodejs") and "npm".

You may also find our developer documentation [1] useful.

- Patrick


[1] http://docs.openattic.org/en/latest/developer_docs/
> -- 
> You received this message because you are subscribed to the Google
> Groups "openATTIC Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to openattic-use...@googlegroups.com.
> To post to this group, send email to openatt...@googlegroups.com
> .
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/openattic-users/c90f3ffe-7a06-4516-a4aa-
> 32c7c7b9df4b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

signature.asc

Lei Chen

unread,
Jan 28, 2018, 12:14:31 AM1/28/18
to Patrick Nawracay, openATTIC Users
Hi Sebastian and Patrick,
Sorry, I missed your reply until recently I reopened openattic google group.
Really thanks for your help.

:-)
Larry Chen


> send an email to openattic-users+unsubscribe@googlegroups.com.
> To post to this group, send email to openattic-users@googlegroups.com

> .
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/openattic-users/c90f3ffe-7a06-4516-a4aa-
> 32c7c7b9df4b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages