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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:04:22+00:00 2026-06-01T15:04:22+00:00

I have a django test, on an amazon ec2 instance, I see the It

  • 0

I have a django test, on an amazon ec2 instance,
I see the “It worked!” page,

i have commented the necessary lines to have access to the admin,

but i cannot see the admin page,

I have to configure properly the urls.py to show the view in my app,

from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'micopiloto.views.home', name='home'),
    url(r'^$', 'portfolio.views.view', name='home'),
    # url(r'^micopiloto/', include('micopiloto.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:
    url(r'^admin/', include(admin.site.urls)),
)

the view for my app is in:
/home/ubuntu/djangoProj/micopiloto/portfolio/views.py

but I have an empty views.py [as i just created the app]

so how do I set the urls.py to connect with my app,

do i need some basic code to see the views.py of my app?

and how to load the admin page?

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-01T15:04:23+00:00Added an answer on June 1, 2026 at 3:04 pm

    Each view (a function in views.py file) in django is related to a url, that is when the url is visited, that view funciton will be called and the output will be shown in the browser.

    To create a simple view function, open the views.py file of the app with a text editor, and add this function to it:

    from django.http import HttpResponse
    
    def view(request):
        return HttpResponse('Hello World!')
    

    Now you can view your first page by visiting /, and also can see the admin page in /admin.

    Note that the function name must be same as the one you enter in the urls.py (here view as in: ‘portfolio.view.view‘).
    Also note that if you have a error in your urls.py files (and some other files like settings.py, admin.py, etc.) you cannot see the admin page, here the error what that you referenced a function called portfolio.views.view in urls.py but there was not such function in your views.py file.

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

Sidebar

Related Questions

I have a django test site and I can see the admin site, but
i have django installed and seems to be working it worked page I want
I have a test django app. In one page the test show the same
I have a Python (Django) unit test FAIL from an exception, but the failing
I have a django project, but for some reason basic jquery isn't working. <html>
I have the following django test case that is giving me errors: class MyTesting(unittest.TestCase):
So I have a Django app that processes test results, and I'm trying to
I have a Django application running locally and I'd like to test the send_mail()
I have been looking for a tool to load test my django application. I
I'm trying to use Amazon's new SMTP service for SES with Django 1.3.1 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.