Inability to access django admin

the model.py file is 

from django.forms import ModelForm

from django.db import models

 

class Namerec (models.Model):

    name = models.CharField(max_length=30)   

    def __str__(self):

        return self.name

 

the error message is 

TypeError at /admin/

Cannot mix str and non-str arguments
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 2.1.5
Exception Type: TypeError
Exception Value:
Cannot mix str and non-str arguments
Exception Location: C:\Users\IFEANYI CHIELO\AppData\Local\Programs\Python\Python37\lib\urllib\parse.py in _coerce_args, line 120
Python Executable: C:\Users\IFEANYI CHIELO\AppData\Local\Programs\Python\Python37\python.exe
Python Version: 3.7.2
Python Path:
['C:\\Users\\IFEANYI CHIELO\\divinecrown',
 'C:\\Users\\IFEANYI '
 'CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
 'C:\\Users\\IFEANYI CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
 'C:\\Users\\IFEANYI CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\lib',
 'C:\\Users\\IFEANYI CHIELO\\AppData\\Local\\Programs\\Python\\Python37',
 'C:\\Users\\IFEANYI '
 'CHIELO\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages']
Server time: Tue, 7 Apr 2020 18:11:36 +0000

 

note that it affects other projects appart from the one that have this model.py

 

Django Replies 3 Views 64 Users 1
Replies 1

Suggested Topics

Django Updated on April 1, 2020, 9:12 p.m. Replies Views 55

Django Updated on April 6, 2020, 12:50 a.m. Replies Views 43

Django Updated on April 7, 2020, 9:54 p.m. Replies Views 74

Django Updated on April 13, 2020, 11:35 a.m. Replies Views 143