hello everyone! I'm working on Django Framework. but when I run the script $ ./manage.py runserver or $./manage.py runserver 0.0.0.0:8000 it only work on my system. how to make it public? so that I can access it from other systems too... [ without

48 views
Skip to first unread message

Uddipta Poddar

unread,
Oct 18, 2017, 9:31:22 AM10/18/17
to Django users

hello everyone! 


I'm working on Django Framework. but when I run the script


$ ./manage.py runserver 

or 

ALLOWED_HOSTS = ['127.0.0.1']  # in settings.py

$./manage.py runserver 0.0.0.0:8000 


it only works on my system.


how to make it public? so that I can access it from other systems too... 
[ without deploying on heroku]


settings.py

Andréas Kühne

unread,
Oct 18, 2017, 11:39:58 AM10/18/17
to django...@googlegroups.com
Hi,

That is a bit outside of django.

1. First of all, you shouldn't run django with runserver on a production system. runserver is just for development purposes, and doesn't do a lot of optimization that you get when running it "correctly".
2. You need to be on a computer that is accessible from the Internet - so you will need to configure your router to be able to allow access from the outside (not django related at all).
3. If you want to run something that is publicly accessible, you need to run on port 80 - you don't access netflix from www.netflix.com:8000 ;-)

I would suggest that you checkout the following tutorials:

And finally a tutorial on how to setup an ubuntu 16.04 server for serving django:

Best regards,

Andréas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e8ea988a-2cdc-4dca-a534-c41d5952dee5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erik Rull

unread,
Oct 19, 2017, 5:27:35 AM10/19/17
to django...@googlegroups.com
Hello Andréas,

Andréas Kühne wrote:
> 1. First of all, you shouldn't run django with runserver on a production
> system. runserver is just for development purposes, and doesn't do a lot of
> optimization that you get when running it "correctly".

not a lot of optimizations - uh really? I run Django under Win10 and access
it as a single user only locally - so I use the runserver option, I didn't
want to install a whole webserver environment - it must only be available
when I need it so there is no need to run it always whenever the PC is on.

Which optimizations are disabled when using runserver? Is the overall
performance of all queries and generating the HTML response itself slower?
I know that only one request is handled in parallel, but that's okay, I'm
the only one accessing the pages :-)

> Best regards,
>
> Andréas

Best regards,

Erik

Andréas Kühne

unread,
Oct 19, 2017, 7:13:57 AM10/19/17
to django...@googlegroups.com
The main thing is that when you start runserver it continuesly checks for changes in your .py files. So if you change a file, you get a reload. This shouldn't be running on a production environment. 
Another thing is that runserver also serves static files - something that you don't want your application server to do in production - that is better handled by a webserver.

If only you are looking at the application that isn't a problem, but I wouldn't allow it to be accessible to the Internet....

Regards,

Andréas

 
> Best regards,
>
> Andréas

Best regards,

Erik
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Erik Rull

unread,
Oct 19, 2017, 7:47:30 AM10/19/17
to django...@googlegroups.com
Hi Andréas,

Andréas Kühne wrote:

> The main thing is that when you start runserver it continuesly checks for
> changes in your .py files. So if you change a file, you get a reload. This
> shouldn't be running on a production environment.
> Another thing is that runserver also serves static files - something that
> you don't want your application server to do in production - that is better
> handled by a webserver.

Okay, that's fine for me and my private / local application.

> If only you are looking at the application that isn't a problem, but I
> wouldn't allow it to be accessible to the Internet....

That's clear. No forwarding from/to any public IP is existing.

>
> Regards,
>
> Andréas
>

Best regards,

Erik

Reply all
Reply to author
Forward
0 new messages