Chrome not connecting to network - django

I was wondering how I could let Chrome connect to my network. I am using a website called Codeanywhere.com and I was using a Django container. I used the built-in terminal and installed Python 3.4 and Django 10. I created a project and ran the server, and it said it had created one at this ip: http://127.0.0.1:8000/. However, whenever I try to access it, it the site can't be reached. If it helps, I am using a Chromebook Thinkpad, and it is a school computer. They do block things with Lightspeed Systems and they have a lot of blacklisting things going on. I am trying to learn Django for a project. Below is a screenshot of the screen when I try to access the server.
My screenshot of the error screen.
I can't embed my image yet, I don't have 10 reputation points :/ It's a link instead.

Mistake #1
The server isn't located on your local host, so you need to go to the provided server. for example, when I opened a project I got this instruction:
To access your application over HTTPS, make sure your application is running on port 3000 and use the following link:
https://mysite-{username}551936.codeanyapp.com
Mistake #2
you should run the server with a specified ip commend - and use 0.0.0.0:3000 instead of the usual localhost, like so:
python manage.py runserver 0.0.0.0:3000
In addition, I would reccomend you to read the "mysite Container" file which explains everything about the setup in detail.

Related

Django Application

I have finished coding a Django App. In that app I have created two models in order to record some project information. Also I am showing project locations with markers on a map (OpenStreetMap) by using leaflet.js.
I will use this app only by starting an offline server like "python manage.py runserver". I am using "Firefox" to display the django app.
I really wonder if somehow the information that I keep in my django models or the markers on the OpenStreetMap is somehow reachable by others via on Firefox or leaflet.
Thank you very much in advance.
If you are in the same wi-fi network you can run python manage.py runserver 0.0.0.0:8000 and then your application will be visible for everybody by typing http://your-pc-up:8000
If you want to make it public you have to buy domain (or register free domain) and put it in your vpc / free hosting. There are plenty of tutorial out there which show how to host an application.
This tutorial is really easy and straight forward: http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
You can use ngrok service which gives you domain such as https://c2757c5f.ngrok.io and other users can visit it by accessing this url. In addition, this url can be visited from anywhere!
See more details by visiting here
If you want other users can visit you website from you local server, then you can run manage.py runserver 0.0.0.0:8000. Your app is visible to other users on same network by accessing this http://your-ip:8000/
You could know you ip by using ifconfig command on linux or ubuntu

django same localhost not responding in another browser or second instance

my new created django project working fine with this information
Django version 2.1.7, using settings 'django_server_api.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
running fine
then i opened in one browser is loaded quickly working quickly.
but if i open same local host in another browser it is taking more than 5 minutes, i dont know what is the issues? may be django is like this? or do i need to change any config in the setting,py file ?
Some browsers (Firefox) has a problem browsing to localhost on some Windows machines.
You can solve it by switching off ipv6, which isn't really recommended.
Using 127.0.0.1 directly is another way round the problem.
Note : If there are heavy media is can also slow downs django

Accessing javascript resource under a Rails Engine throws net::ERR_CONNECTION_RESET

I have a Rails 4.2.1 application with multiple engines under it. The application has been hosted in production with Apache2 and Passenger and was working fine till a few weeks back. I am now facing a strange problem and unable to load assets under one particular engine and get the error "Failed to load resource: net::ERR_CONNECTION_RESET" when trying to load javascript or other asset files under a particular engine.
The application structure is
Root
AssessmentTools (app->assets->javascript->assessment_tools->angular.js)
QuestionBankTools (app->assets->javascript->question_bank_tools->angular.js)
All seems to work fine when loading resources under AssessmentTools (http:///assets/assessment_tools/angular.js), but fails for QuestionBankTools (http:///assets/question_bank_tools/angular.js).
Also, everything seems to work fine on localhost and even in a VM that i hosted on my development machine (with app running behind Apache2 and Passenger), but the problem appears when i host it on server behind a proper a domain.
I have tried cleaning up the server and re-installing the application but without success. I am not able to figure out what could have changed in the past weeks to create this issue.
In my case the problem turned out to be an over eager firewall filter introduced by the data server admin. They had blocked off all url having particular keywords in it.
Fixed the firewall and all is well.

Amazon AWS Service Error

I am currently trying to set up a Virtual Machine and a Database Server for my website to launch off of. I decided to go with Amazon's AWS.
I have beeing working through This Tutorial and am at Part 3 now.
I got to the point where I started the Apache Web Server and went to my local DNS name in my browser, and successfully saw the Test Page.
I proceeded forward with Downloading "Drupal" and got to the section where it says "Configure Drupal". I am now trying to load my local DNS name in my browser again, only to get a 500 Server Error.
I'm not sure what could've went wrong, I only entered the commands in the tutorial for the whole section on "Install Drupal".
Thank you
EDIT: Also, what exactly does Drupal do? And do I need to use it?
Drupal is a CMS system, and you don't have to use it. It is only being used to provide an example for a website. Instead of installing Drupal, you can install your own site on the server if you prefer or even something like Wordpress if you're more familiar with that.
However, if you do want to follow the example your best bet for discovering the problem is to look into what the exact error is. You should be able to find more information about that in the log files located in /var/log/httpd. The error log in there should show you more details about what failed.

How can I view a django site running with 'runserver' remotely

I currently have a django project that I am working on. The project is sitting on my remote webserver, and I start it by running manage.py runserver 0.0.0.0:8000. Howver, if I try to access the site via domainname.com:8000, I can't see the site.
How can I view a django project remotely like this? Do I need to do setup using apache? Punch a hole in the firewall? Is there an easy way?
This is strictly for development purposes.
You need to bind it to an IP, not 0.0.0.0.
Also, you may want to check that firewall rules are not stopping you from accessing port 8000 (I did this this morning!)
You can use ssh tunnels. It's easy to set up in Windows with Putty (look at this example for manageing postgresql) or google how to use tunnels with ssh in Linux. I think this is amazing thing, since I first time get to my databse on remote server :)