Building A Blog Website With Django Part 2

After we successfully create a Django project like in this previous part one, we will make back-end admin accessible. Inside terminal in your root folder, which in this case is “myblog”, run this syntax.

python manage.py migrate

The “python manage.py migrate” syntax is a Django command that applies pending database migrations to synchronize the database schema with the current state of the Django model. This command reads the migration file created by python manage.py makemigrations and executes the SQL statements defined in it.

Create a super user named “admin” with password “123” and fake email “admin@yahoo.com”

python manage.py createsuperuser

In development environment you can write fake email and weak password. If you are going to run in production/live environment pay attention to security measurements and create stronger password.

Now let’s run our server and login to admin dashboard.

python manage.py runserver

In your browser open url http://127.0.0.1:8000/admin or http://localhost:8000/admin

By the way, if you ever happen to forget the super user password in future, please check this article about reset password.

Next in part three we will create blog app, the database, the tables. Part Three

Leave a Comment