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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:55:02+00:00 2026-06-18T12:55:02+00:00

NOTE: THE SPECIFIC QUESTION IS AT THE END BELOW. FIRST I DESCRIBE ALL THE

  • 0

NOTE: THE SPECIFIC QUESTION IS AT THE END BELOW. FIRST I DESCRIBE ALL THE STEPS I WENT THROUGH 🙂 )

Im using Python 2.7 and Django 4.2.1
on Windows.

I am creating a project called “mysite” which is the project used at docs.djangoproject.com.

So far, I have done the following just like in the tutorial:

1)typed: django-admin.py startproject mysite
This created all the standard folders, which are:

mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py

2) typed: manage.py runserver
and when typing http://127.0.0.1:8000 in the address bar I got a congratulations message.

So far, so good..

3) Then I edited the settings.py file. First I edited the DATABASE ENGINE and typed the following:

'django.db.backends.sqlite3'

4) Still in settings.py, I indicated a DATABASE name so that it creates a database file. I called it:

'mysitedb'

5) Then I synced the database (to create the tables) by typing:

manage.py syncdb

6) Then the tutorial asks to create an app called polls. So I typed:

manage.py startapp polls

That created the following folder and files:

polls/
    __init__.py
    admin.py
    models.py
    tests.py
    views.py

7) The tutorial then asks to edit the models.py by typing the following:

from django.db import models
import datetime
from django.utils import timezone

class Poll(models.Model):
    question = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

    def __unicode__(self):
        return self.question

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField()

    def __unicode__(self):
        return self.choice_text

    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

8) Moving along, I then I had to edit the INSTALLED_APPS section in the settings.py file by typing the following:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'polls',
)

9) Then I typed the following to create tables and their fields (I guess..):

manage.py sql polls

then the following printed out:

BEGIN;
CREATE TABLE "polls_poll" (
    "id" integer NOT NULL PRIMARY KEY,
    "question" varchar(200) NOT NULL,
    "pub_date" datetime NOT NULL
);
CREATE TABLE "polls_choice" (
    "id" integer NOT NULL PRIMARY KEY,
    "poll_id" integer NOT NULL REFERENCES "polls_poll" ("id"),
    "choice_text" varchar(200) NOT NULL,
    "votes" integer NOT NULL
);
COMMIT;

10) Then I had to type this to create the tables (sync):

manage.py syncdb

So far, still so good..

10) Then they suggest I run python shell in command and play with the database API. At that point everything was working fine. Could add data in the tables’ fields, etc.

But here is where it doesn’t work. From PART 2 of the tutorial. I have to runserver again (I did that: manage.py runserver, and it worked fine..).
I opened a browser webpage and typed http://127.0.0.1:8000/admin/ and I get the same “It worked! Congratulations on your first Django-powered page…”

No error message. So how do I get the admin page with user logins (username and password) to appear?

Any help will be appreciated.
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-18T12:55:03+00:00Added an answer on June 18, 2026 at 12:55 pm

    Usually when the admin in Django isn’t working the two main culprits are forgetting to add the following two lines to the urls.py file.

    admin.autodiscover()
    

    and

    url(r'^admin/', include(admin.site.urls))
    

    Now you can go ahead with the tutorial and when you register models in your admin.py, don’t forget

    admin.site.register(MyModelGoesHere, MyModelAdminNameGoesHere)
    

    Good luck! 🙂

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

Sidebar

Related Questions

Note: I had another similar question about how to GZIP data using Ruby's zlib
Note: This is a general programming question, not specific to any language, but feel
Note : This question has been re-asked with a summary of all debugging attempts
Forgive me for yet another question on Python decorators. I did read through many
Note This is not a REBOL-specific question. You can answer it in any language.
Note, this is not a duplicate of .prop() vs .attr() ; that question refers
(Note: This is not a question about what is the best way with code
NOTE: This is a followup to my question here. I have a program that
NOTE: This is an old question and the answers here no longer works (since
Note: By workflow i'm not referring to workflow technology, such as Workflow foundation. All

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.