Krydos Posted February 24, 2017 Posted February 24, 2017 Yeah, no problem. We all would appreciate it if you could create a wiki account at http://wiki.helionet.org/ and create a tutorial for people to do what you have just done. This would be especially useful for people if you use windows on your home pc since most people use that os. I find it makes more sense to people from the point of view of another user such as yourself. You could use http://wiki.helionet.org/Java_Servlet http://wiki.helionet.org/Installing_an_SSL_Certificate_on_Tommy_with_ZeroSSL or http://wiki.helionet.org/Running_Auto_Backups as templates.
albertoc Posted February 27, 2017 Author Posted February 27, 2017 Hi Krydos!I'll definitely write a tutorial, I love helping other users and I have some experience with wikis :-)I'll do it in a couple of days, since I'm quite busy with my thesis. Thanks again!
Krydos Posted March 1, 2017 Posted March 1, 2017 Awesome! Just let me know your wiki username, and I'll get you promoted.
albertoc Posted March 10, 2017 Author Posted March 10, 2017 Hi guys!I'm still trying to fully setup the website on Tommy, but I'm facing some issues.. When I run the django server locally on my computer at home and I execute some operations (POST requests from IoT devices) they are satisfied and I can see the records being added to the server.When I make the devices perform POST requests at my django app on heliohost, I cannot see any change. This made me think that it could have been a permissions problem on the sqlite Database, since I can make django read some test data from it ( http://sest.gq/1/ ) but I cannot make it write to it, and the view showing the channel/feed stays empty ( http://sest.gq/2/ ). I changed the permissions on the db.sqlite3 file to 777, but nothing changed. So I'm asking if there's any way to debug a django app on heliohost, which is not working only there, and without having access to the django logs (so I cannot insert print statements neither, while it's working on POST requests from my devices).Any hint? An other attempt would be to setup a proper DB engine, like postgresql, to work with my app.
Krydos Posted March 11, 2017 Posted March 11, 2017 I HIGHLY recommend switching to MySQL. We have remote MySQL enabled on Tommy so you can use the same connection settings and the same database locally and on the server. Is there any reason you have to use sqlite?
albertoc Posted March 18, 2017 Author Posted March 18, 2017 I solved the problem relative to sqlite: by using curl and performing a request to the server, I saw the error: the solution is to set the permission to 770 (allowing writing to the users of my same group) to the parent folder containing the db.sqlite3 file (in my case is public_html/):http://stackoverflow.com/questions/7670289/sqlite3-operationalerror-unable-to-open-database-file/7670618#7670618 Another problem I have now is that I'm using a small python package in my project: https://github.com/Stranger6667/postmarkerit's a python package that sends requests to Postmark that afterwards sends emails (according to some conditions inside my application).This package doesn't spam, since it's just a wrapper that sends requests to a third-party service, so it doesn't use tommy's IP address to send email.Could you be so kind to install it on tommy?
Krydos Posted March 19, 2017 Posted March 19, 2017 # /usr/local/python3.6/bin/pip3.6 install postmarker Collecting postmarker Downloading postmarker-0.8.1-py2.py3-none-any.whl Collecting requests (from postmarker) Downloading requests-2.13.0-py2.py3-none-any.whl (584kB) 100% |████████████████████████████████| 593kB 1.5MB/s Installing collected packages: requests, postmarker Successfully installed postmarker-0.8.1 requests-2.13.0
albertoc Posted March 19, 2017 Author Posted March 19, 2017 You guys rock! :) many thanks for all the help you gave me. I registered an account on the wiki, with username albertoc. Can you activate it, so I can write down the tutorial for the installation of a django app?
albertoc Posted March 21, 2017 Author Posted March 21, 2017 Yeah, no problem. We all would appreciate it if you could create a wiki account at http://wiki.helionet.org/ and create a tutorial for people to do what you have just done. This would be especially useful for people if you use windows on your home pc since most people use that os. I find it makes more sense to people from the point of view of another user such as yourself. You could use http://wiki.helionet.org/Java_Servlet http://wiki.helionet.org/Installing_an_SSL_Certificate_on_Tommy_with_ZeroSSL or http://wiki.helionet.org/Running_Auto_Backups as templates.Done: http://wiki.helionet.org/Django#Getting_started_with_Django_1.10 check it out, any feedback is appreciated!
Krydos Posted March 21, 2017 Posted March 21, 2017 Looks good. Does typing 0.0.0.0:8000 into a browser actually work though? Setting a server to listen on 0.0.0.0:8000 means to listen on all available IP addresses on port 8000, but 127.0.0.1:8000 or localhost:8000 is what I would think you would need to type into the browser for the loopback address. I've never tried 0.0.0.0:8000 though.
albertoc Posted March 21, 2017 Author Posted March 21, 2017 0.0.0.0/32 is a reserved IPv4 address: it allows a server listening on it to listen to all the interfaces available on the local machine.It's a little broader than 127.0.0.1If you try to launch a "normal" python manage.py runserver, you can only browse the app on localhost or on 127.0.0.1, but you cannot visit it from any other address of the class 127.0.0.0/32.And I think it's useful even if you want to make others (on your same network) to browse your app (obviously you need to open the port 8000 though). With localhost you can't. You can change it if you prefer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now