ValueError at /admin/

146 views
Skip to first unread message

anchal agarwal

unread,
Jun 16, 2019, 8:09:20 AM6/16/19
to django...@googlegroups.com
I recently deleted one of my app from my website directory. For deleting app I removed that app name from settings.py also I removed it's folder 
I then applied python manage.py migrate
But now i am unable to access my admin, it's giving an error 

ValueError: invalid literal for int() with base 10: 'admin'

Internal Server Error: /favicon.ico/
Any help would be greatly appreciated 


Karan Mittal

unread,
Jun 16, 2019, 8:27:30 AM6/16/19
to django...@googlegroups.com
You can try the sequence of commands, 
Makemigrations
Migrate
It solved the problem for me. 
Karan Mittal

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMT%3DisX4EEYjRDG0REECdjmKFiYvex8dHHdM9szqqSAyT%3Dd3pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

anchal agarwal

unread,
Jun 16, 2019, 9:20:24 AM6/16/19
to django...@googlegroups.com

It's still showing the same error , is there any other way to resolve this issue ?

On 16-Jun-2019 1:57 pm, "Karan Mittal" <karanshy...@gmail.com> wrote:
You can try the sequence of commands, 
Makemigrations
Migrate
It solved the problem for me. 
Karan Mittal

On Sun 16 Jun, 2019, 1:38 PM anchal agarwal, <agarwal...@gmail.com> wrote:
I recently deleted one of my app from my website directory. For deleting app I removed that app name from settings.py also I removed it's folder 
I then applied python manage.py migrate
But now i am unable to access my admin, it's giving an error 

ValueError: invalid literal for int() with base 10: 'admin'

Internal Server Error: /favicon.ico/
Any help would be greatly appreciated 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Dave Edwards

unread,
Jun 16, 2019, 10:27:38 AM6/16/19
to django...@googlegroups.com
What's in your urls.py at the project level? Do you have a copy of the urls.py that sit within the deleted app folder? 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

anchal agarwal

unread,
Jun 16, 2019, 1:09:08 PM6/16/19
to django...@googlegroups.com
here is my urls.py . I only need music app.
from django.contrib import admin
from django.urls import path,include
from . import settings
from django.contrib.staticfiles.urls import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns = [
path('',include('music.urls')),
path('music/',include('music.urls')),
path('admin/', admin.site.urls),
]
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


No, I don't have copy of urls.py of deleted app.  How can I resolve this?

Sai Praneeth

unread,
Jun 16, 2019, 1:46:07 PM6/16/19
to django...@googlegroups.com
Remove files in migration folder and then try to migrate 

On Sun 16 Jun, 2019, 1:38 PM anchal agarwal, <agarwal...@gmail.com> wrote:

anchal agarwal

unread,
Jun 16, 2019, 2:14:18 PM6/16/19
to django...@googlegroups.com
I removed all files,and when i applied migrations it's showing me this 
C:\Users\User\Desktop\mysite>python manage.py makemigrations
System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'music' isn't unique. You may not be able to reverse all URLs in this namespace
Migrations for 'music':
  music\migrations\0001_initial.py
    - Create model Album
    - Create model Song

C:\Users\User\Desktop\mysite>python manage.py migrate
System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'music' isn't unique. You may not be able to reverse all URLs in this namespace
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, music, sessions
Running migrations:
  No migrations to apply.



Reply all
Reply to author
Forward
0 new messages