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

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Harshit Agarwal
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Sipum Mishra
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <[hidden email]> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAGHZBzy1X-KiMXtLPmQ3V5nC2HBLC%2BpD_Wd8vAjV3nAnGGsFAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Harshit Agarwal
Here is urls.py of my app

from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

app_name="music"

urlpatterns=[
#/music/
path('',views.IndexView.as_view(),name='index'),

path('register/',views.UserFormView.as_view(),name='register'),

path('<pk>/',views.DetailView.as_view(),name='detail'),

path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Here is my main urls.py
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)

On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="6CcKGpihCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">agarwalh...@...> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="6CcKGpihCAAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@googlegroups.com.
To post to this group, send email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="6CcKGpihCAAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Sipum Mishra
Plz share views.py as well.. I hvae mentioned two. Kindly share. 

On Tue, 25 Jun, 2019, 8:47 PM Harshit, <[hidden email]> wrote:
Here is urls.py of my app

from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

app_name="music"

urlpatterns=[
#/music/
path('',views.IndexView.as_view(),name='index'),

path('register/',views.UserFormView.as_view(),name='register'),

path('<pk>/',views.DetailView.as_view(),name='detail'),

path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Here is my main urls.py
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)

On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <[hidden email]> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAGHZBzxqt7ZBr6iiRbbcdB%2B56%3D8Z5AGKNMGq57cFCJktQwCbTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Harshit Agarwal
This is my views.py
from django.views import generic
from django.views.generic import ListView
from django.views.generic import DetailView,UpdateView,DeleteView
from django.views.generic import CreateView
from django.shortcuts import render,redirect
from django.contrib.auth import authenticate,login
from django.views.generic import View
from .models import Album, Song
from .forms import UserForm

class IndexView(ListView):
template_name="music/index.html"
context_object_name='all_Albums'

def get_queryset(self):
return Album.objects.all()

class DetailView(DetailView):
model=Album
template_name="music/detail.html"

class AlbumCreate(CreateView):
model=Album
fields=['artist','album_title','genre','album_logo']

class UserFormView(View):
form_class=UserForm
template_name='music/registration_form.html'

#display blank form
def get(self , request):
form=self.form_class(None)
return render(request,self.template_name,{'form':form})

#process from data
def post(self, request):
form=self.form_class(request.POST)

if form.is_valid():
user=form.save(commit=False)

#cleaned (normalized) data
username=form.cleaned_data['username']
password=form.cleaned_data['password']
user.set_password(password)
user.save()

#returns User objects if credentials are correct

user=authenticate(username=username,password=password)

if user is not None:

if user.is_active:
login(request,user)
return redirect('music:index')
return render(request,self.template_name,{'form':form})

On Tuesday, June 25, 2019 at 9:37:34 PM UTC+5:30, Sipum wrote:
Plz share views.py as well.. I hvae mentioned two. Kindly share. 

On Tue, 25 Jun, 2019, 8:47 PM Harshit, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Sul_GD-zCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">agarwalh...@...> wrote:
Here is urls.py of my app

from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

app_name="music"

urlpatterns=[
#/music/
path('',views.IndexView.as_view(),name='index'),

path('register/',views.UserFormView.as_view(),name='register'),

path('<pk>/',views.DetailView.as_view(),name='detail'),

path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Here is my main urls.py
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)

On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <[hidden email]> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="Sul_GD-zCAAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@googlegroups.com.
To post to this group, send email to <a href="javascript:" rel="nofollow" target="_blank" gdf-obfuscated-mailto="Sul_GD-zCAAJ" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/15dbe92c-6344-4ca4-aa18-742610627b03%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/f8365b76-5004-4c11-b357-a6c838b74339%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

onyilimba martins mclaren tochukwu
In reply to this post by Sipum Mishra
I guess it's Django 2.2?

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/bb10db99-0411-468b-aace-e40509c34b51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Piotr Duda
In reply to this post by Harshit Agarwal
Try move first path to end in your main urls.py.

W dniu wtorek, 25 czerwca 2019 17:17:04 UTC+2 użytkownik Harshit napisał:
Here is urls.py of my app

from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

app_name="music"

urlpatterns=[
#/music/
path('',views.IndexView.as_view(),name='index'),

path('register/',views.UserFormView.as_view(),name='register'),

path('<pk>/',views.DetailView.as_view(),name='detail'),

path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Here is my main urls.py
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)

On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <[hidden email]> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d6cb02d4-6a25-4f9b-8d57-2038d1a0ad0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Sipum Mishra
In reply to this post by onyilimba martins mclaren tochukwu
Your problem is, in url you are passing id to detailview, but in views.py you have done anything with that...

Check this again. 

On Wed, 26 Jun, 2019, 4:01 AM onyilimba martins mclaren tochukwu, <[hidden email]> wrote:
I guess it's Django 2.2?

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/bb10db99-0411-468b-aace-e40509c34b51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAGHZBzzi7Lt9u299aGQOhd0e6rYsFeWyDgX%3DM1yB%2BpgWP_v_iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Harshit Agarwal
In reply to this post by Piotr Duda
It worked!. Thanks Piotr Duda

On Wednesday, June 26, 2019 at 6:11:24 PM UTC+5:30, Piotr Duda wrote:
Try move first path to end in your main urls.py.

W dniu wtorek, 25 czerwca 2019 17:17:04 UTC+2 użytkownik Harshit napisał:
Here is urls.py of my app

from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

app_name="music"

urlpatterns=[
#/music/
path('',views.IndexView.as_view(),name='index'),

path('register/',views.UserFormView.as_view(),name='register'),

path('<pk>/',views.DetailView.as_view(),name='detail'),

path('album/add/',views.AlbumCreate.as_view(),name='album-add'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Here is my main urls.py
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)

On Tuesday, June 25, 2019 at 4:14:05 PM UTC+5:30, Sipum wrote:
Can u plz attach your urls.py as functions associated in views.py

Thanks. 

On Mon, 24 Jun, 2019, 8:08 PM Harshit Agarwal, <[hidden email]> wrote:
 Hi guys,
I am currently working on a working on a project. Everything is working fine but i am not able to access my admin. How can i solve this? 
Here is my Stack Trace 
Traceback:

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
  34.             response = get_response(request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get
  106.         self.object = self.get_object()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\views\generic\detail.py" in get_object
  36.             queryset = queryset.filter(pk=pk)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in filter
  844.         return self._filter_or_exclude(False, *args, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
  862.             clone.query.add_q(Q(*args, **kwargs))

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in add_q
  1263.         clause, _ = self._add_q(q_object, self.used_aliases)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in _add_q
  1287.                     split_subq=split_subq,

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_filter
  1225.         condition = self.build_lookup(lookups, col, value)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\sql\query.py" in build_lookup
  1096.         lookup = lookup_class(lhs, rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in __init__
  20.         self.rhs = self.get_prep_lookup()

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
  70.             return self.lhs.output_field.get_prep_value(self.rhs)

File "C:\ProgramData\Anaconda3\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
  965.         return int(value)

Exception Type: ValueError at /admin/
Exception Value: invalid literal for int() with base 10: 'admin' 

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/CAE%2BC-X-o7sW8m2-DMx4R5CnGrYbYS%2B%2Bx_cYi-BL%3DHwK_b%2BdrHg%40mail.gmail.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/9b7d2ada-3107-477c-beb5-48d268ae96c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.