?
Solved

Displaying static HTML in Django

Posted on 2015-01-26
10
Medium Priority
?
54 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article discusses four methods for overlaying images in a container on a web page
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses

800 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