how to register model in admin django

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.   Adding your models to the¬†administration site from django.contrib import admin # Register your models here. from .models import Article, Category admin.site.register(Article) admin.site.register(Category)   Let’s add…

Continue Reading →

How to reset Django admin password?

Open console using. python manage.py shell then use following script in shell from django.contrib.auth.models import User User.objects.filter(is_superuser=True) will list you all super users on the system. if you recognise your username from the list: usr = User.objects.get(username=’your username’) usr.set_password(‘raw password’) usr.save()        

Continue Reading →

Creating an administration site for your models in Django

Django comes with a built-in administration interface that is very useful for editing content. The Django admin site is built dynamically by reading your model metadata and providing a production-ready interface for editing content. You can use it out-of-the-box, configuring how you want your models to be displayed in it. Remember that django.contrib.admin is already included in the INSTALLED_APPS setting…

Continue Reading →

Installing Django and creating your first project

  If you have already installed Django, you can skip and jump directly to Creating your first project. If you haven’t installed Django yet, here is a quick guide to installing Django for local development. Django works well with Python versions 2.7 or 3.If you are not sure if Python is installed in your computer, you can verify it by…

Continue Reading →