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've got a django project working on a development server(ubuntu) that we have been
I've just started building a prototype application in Django. I started out by working
I have recently started working on a very large C++ project that, after completing
I have only recently started working with the MVC approach, so I suppose this
I have recently started working with Unified Communication Managed API 2.0 (UCMA) and Office
Just started working with android and ran into a small problem. I am have
I have just started working with with Styles and Control Templates and have created
I have recently started working on a legacy application that has most of its
I have just started working at a new place and they don't have any
I've been working with Django for a while now (currently on version 1.2), but

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.