Solved

Displaying static HTML in Django

Posted on 2015-01-26
10
33 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
 

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now