Solved

Displaying static HTML in Django

Posted on 2015-01-26
10
41 Views
Last Modified: 2015-03-03
Hi
If I have got some flat HTML files that I want to display on my Django development environment. What is the simplest way to do that?

thanks
0
Comment
Question by:lz7cjc
  • 5
  • 3
10 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40570945
if the files are well-formed HTML, then just return them as is to the requesting client.

Cd&
0
 

Author Comment

by:lz7cjc
ID: 40570959
thanks but what does that mean?!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40571156
Are you not a web developer?

The files are HTML. if the HTML is valid and the files are complete documents, then they can be displayed by any browser.  

Sorry but I can't make it any simpler than that. Type the file location of a file in the browser address bar and see if it displays as a page.

Cd&
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:lz7cjc
ID: 40572794
ok - i guess I didn't explain enough of the situation since that is what I thought you meant and it doesn't work!

I am running Django with its own web server on my development environment. . If I just enter the <root>/<path>/<filename> i get an error since the entries aren't in the URLs.py file for Django to resolve. I therefore need to understand how I can display them and avoid this error message:

Using the URLconf defined in recharge.urls, Django tried these URL patterns, in this order:
^admin/
^daypass/$
^accounts/
^accounts/
The current URL, recharge/template/design/facilities.html, didn't match any of these.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40573629
I have no experience with django internals; so I have no idea what might work.  If I was going to guess, I would say your best option might be to more the files into one of those paths that it appears to be searching.  Sorry I can't be more help.

Cd&
0
 

Author Comment

by:lz7cjc
ID: 40616423
ok I've sorted it
thanks
0
 

Author Comment

by:lz7cjc
ID: 40624801
I've requested that this question be closed as follows:

Accepted answer: 0 points for lz7cjc's comment #a40616423

for the following reason:

I found the answer through other sites - the answers on here got me nowhere
0
 

Accepted Solution

by:
lz7cjc earned 0 total points
ID: 40625275
seriously? quite annoying that I have to spend time on this when the only answer I was given was so awful!
In urls.py
(r'^home/', Home.as_view()),
in views.py
class Home(TemplateView):
    template_name = "facilities_list.html"
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question