Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3426322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:42:04+00:00 2026-05-18T06:42:04+00:00

I started working on Django 1.0 Web Site Development and have gotten my server

  • 0

I started working on “Django 1.0 Web Site Development” and have gotten my server to work, but when I’m editing my views.py file, I have a difficulty editing the python code in emacs.

The problem seems to be a line that contains the triple quotes (”’):

def main_page(request):
  output = u'''
    <html>
    [more lines here]
    </html>
  ''' % (
    u'Django Bookmarks'
    u'Welcome to Django Bookmarks',
    u'Where you can store and share bookmarks!'
  )
  return HttpResponse(output)

Emacs identation gets all screwed up after the u”’ line and thus I get errors when I try to load the page that is generated from this.

I’ve tried several modes (including a nxhtml mumamo mode), but so far I can get Emacs to recognize only python code or only html, but not both at the same time. Short of editing the file as raw text and manipulating the tabs myself, is there another way/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:42:05+00:00Added an answer on May 18, 2026 at 6:42 am

    Take the hint.

    You’re doing it wrong. Get to the templates business in chapter 3 before even thinking about tools to support what you’re doing.

    Stop trying to embed HTML in your view functions and you’ll find that emacs is no longer confused. Move as quickly as possible to the next chapter. Stop messing with emacs and get going on learning Django. Move further forward in the book.

    But HTML in template files which are almost pure HTML with a few extra {{variable}} and {% tag %} things thrown around.

    You don’t have an “emacs formatting” problem.

    You have a “using Django incorrectly” problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running django on django's development server. It was working fine before but
I've got a django project working on a development server(ubuntu) that we have been
I am new to Django and have started working on a mature Django project.
I am working with a django project, I haven't started. The developed working on
I've just started building a prototype application in Django. I started out by working
Getting started with Django 1.3 here. Loving the system so far, but struggling on
I am working on building a web-application using Django. Since I'm new to working
I've spent a lot of time working in Django, and have grokked the framework
I'm working on a project in Django and I've just started trying to extend
I'm working on my first web app (www.shopperspoll.com). It's a Django based facebook app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.