Solved

Displaying static HTML in Django

Posted on 2015-01-26
10
37 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
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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.
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

863 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

21 Experts available now in Live!

Get 1:1 Help Now