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 8516129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:20:12+00:00 2026-06-11T05:20:12+00:00

Ok so i am a noob building a basic site in django with python.

  • 0

Ok so i am a noob building a basic site in django with python. I am trying to implement a new page in my site called edit area. Whenever i visit the page all i get is this…

NameError at /
name 'editareapage' is not defined
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 1.4.1
Exception Type: NameError
Exception Value:    
name 'editareapage' is not defined

My views.py

from django.http import HttpResponse
from django.shortcuts import render_to_response
import datetime
def hello(request):
    return HttpResponse("Hello, World!")

def mainpage(request):

    return render_to_response('mainpage.html')

def current_datetime(request):
    now = datetime.datetime.now()
    return render_to_response('current_datetime.html', {'current_time':now})

def hours_ahead(request,offset):
    try:
        offset= int(offset)
    except ValueError:
        raise Http404()

    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    html = "<html><body>In %s hour(s), it will be %s.</body></html>" % (offset,dt)
    return HttpResponse(html)

def editareapage(request):
    return render_to_response('editareapage.html')

Also it is worth noting that editareapage is the one i am trying to access.

Here is my urls.py

    from django.conf.urls import patterns, include, url
from MyProj.views import hello,mainpage, current_datetime, hours_ahead
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
      (r'^hello/$', hello),
      (r'^$', mainpage),
      (r'^time/$',current_datetime),
      (r'^time/plus/(\d{1,2})/$', hours_ahead),
      (r'^editareapage/$', editareapage),
    # Examples:
    # url(r'^$', 'MyProj.views.home', name='home'),
    # url(r'^MyProj/', include('MyProj.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
     (r'^admin/', include(admin.site.urls)),
)

Hopefully this is enough for somone to help me, thanks!

  • 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-06-11T05:20:14+00:00Added an answer on June 11, 2026 at 5:20 am

    You should import editareapage in urls.py

    from MyProj.views import hello, mainpage, current_datetime, hours_ahead, editareapage
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

noob question: I'm building a checkout system for an online commerce site. I'm getting
Noob here trying to figure out the simple task of adding a page to
I'm new to python and a total noob with programming so bear with. If
I am a noob in ASP.NET and building a website currently... I want the
I'm a Pyro and CI noob, so sorry for any obvious omissions. I'm building
noob here still experimenting with templates. Trying to write a message processing class template
Noob dumb question, no doubt -- but here it is: Trying to tutorialize myself
This is a bit of noob question - I'm still fairly new to C#
noob to C# here, using iTextSharp examples from around SO I've made a basic
I'm a Django noob and fear the answer to my question is fairly obvious,

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.