Solved

Displaying static HTML in Django

Posted on 2015-01-26
10
43 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embedding Tags in a restricted UI 6 36
How can I make a div layout like the one in the image 2 45
links not working 2 27
Telerik RadEditor Control Save 8 15
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…
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?
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

726 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