Forums

static html website not using django

Hi I'd like to host a 2nd domain with a static html webpage (running javascript). My first domin is a django web app that runs great,. My second one is just a static html one.

I've hosted the domain here, loaded the files and altered the section for static sites as per the instructions https://help.pythonanywhere.com/pages/hosting-a-static-site - but I still get the www_dimitri-data_com_wsgi.py generated page.

What might I be missing? Is my path wrong? My directory structure is ../potfolio and I have an index.html file in place

is there something incorrect here from the Web page?:

Static files:

Files that aren't dynamically generated by your code, like CSS, JavaScript or uploaded files, can be served much faster straight off the disk if you specify them here. You need to Reload your web app to activate any changes you make to the mappings below.

URL Directory
:/ /home/dimitrikourouniotis/portfolio/index.html

I have also tried:

URL Directory
:/ /home/dimitrikourouniotis/portfolio/ and

URL Directory
:/ /home/dimitrikourouniotis/portfolio

Thanks!

what is that extra colon :/ ? It should probably be just /.

aha! Thanks! - I took out the colon and amended the path..

(It was from the instruction page, but the colon there was a went to denote "URL: <space> /" and denote the separation of the field name from the field content, not be part of the field. I need glasses I think)

Is there anything else required to be disabled for an html page reading js files to be served or to be running? I'm getting my page but it is blank :-(

Could you give us a URL of a page that's not loading JS so that we can take a look? I visited the website on your custom domain, and it looks OK -- there's definitely some JS being loaded.

Thanks!

I can see a sample non JS loading page loads fine: http://www.dimitri-data.com/blog

I suspect it is something with the javascript that will take me some time to parse as I am new to JS and Django (and scalable SVG).

Have a look at http://help.pythonanywhere.com/pages/DebuggingStaticFiles/. It will help you understand how static files mappings work and what might be wrong.

Hi @glenn, @giles and @conrad!

Thanks for all your answers and help. It is all working now. Originally I thought it was a javascript issue that was going to take longer to solve. It resolved itself as I added working non JS test page and figured out the specifics in having two sites/web apps/domain names associated with PA, and when I did the last git pull reloaded the website again time- it started working.

It was odd that all the files appeared to already be present and appeared to be working on my local... shrug... Anyway, I am relieved and thank you for all the help!- My learning D3 and SVG and javaScript continues.