DJANGO app on linode server works apart from python script

I recently uploaded a django app to the linode server. It was a user friendly process and the site pages load and refresh quickly which is a great first impression. But one feature of the website is that when you click a button on the page a financial stock chart is meant to open up. The output file is a .html file. The process behind the button click is a python script, a .py file. This works fine on my local machine, at localhost:8000 but the chart output doesn't seem to work when loaded into the online machine/server. I've changed the path from C://…/… (local) to /home/…/… (server) for the file location, though this stops django reporting a path error, it doesn't bring up the chart. Any ideas what I need to do to solve this problem? I believe all dependencies and the virtual environment are correctly installed as the .html file is generated in the users/project folder.

1 Reply

I want to preface this to say that I'm not an expert in Django, but I did some research on this for you and I believe that I've found some guidance that may be able to help you out.

The first is a post on Stack Overflow where a user is running into an issue with .py files not displaying properly when using Django with Python. I think this is a good one because it gives examples of that user's code, which is diagnosed in the solution. It might be worthwhile to compare what you have to this:

Django form, view, and forms.py not working together

In another more recent post, a user is having issues with a Python script not working with Django. As I don't know much about your setup, this one being helpful is just speculation but I wanted to pass it along in case it might prove useful:

Python script not working with django shell

I hope this is good information to get you pointed in the right direction. I'll put some tags on this post to give it more visibility to other Django users.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct