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

2019-06-27 Thread Harshit
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

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

2019-06-26 Thread Piotr Duda
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_na

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

2019-06-26 Thread Sipum Mishra
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, < tochimcla...@gmail.com> wrote: > I guess it's Django 2.2? > > -- > You received this message because

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

2019-06-25 Thread onyilimba martins mclaren tochukwu
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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-u

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

2019-06-25 Thread Harshit
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,log

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

2019-06-25 Thread Sipum Mishra
Plz share views.py as well.. I hvae mentioned two. Kindly share. On Tue, 25 Jun, 2019, 8:47 PM Harshit, 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" >

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

2019-06-25 Thread Harshit
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='reg

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

2019-06-25 Thread 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, 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 S

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

2019-06-22 Thread Alejandro Pena
Try this instead: cart_obj, new_obj = Cart.objects.get_or_create(user=request.user) You originally had: cart_obj, new_obj = Cart.objects.new_or_get(request) There is no .new_or_get method in the Django QuerySet API: https://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-create Als

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

2019-06-22 Thread Lutalo Bbosa joseph
it all is not working, i guess i have to write another independent function for reomving products from the cart but thx. though i thought, it would workout On Sat, Jun 22, 2019 at 9:00 PM Alejandro Pena wrote: > Which error are you seeing now? Try making this change and let us know > what the re

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

2019-06-22 Thread Alejandro Pena
Which error are you seeing now? Try making this change and let us know what the results are. cart_obj, new_obj = Cart.objects.get(user=request.user) if product_obj in cart_obj.products.all(): cart_obj.products.remove(product_obj) added = False Context: ht

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

2019-06-22 Thread Lutalo Bbosa joseph
but the remove function is supposed to work yet it returns the error but add works def update(request): product_id = request.POST.get("product_id") if product_id is not None : print(product_id) product_id = int(product_id) try: product_id = int(product_id)

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

2019-06-22 Thread Alejandro Pena
Sweet, looks like your code is working! You’re still seeing the ‘2’ and that the type of product_id is a string because your print statements are placed before you convert product_id into an int and then use it to search for product_obj. The evidence that it’s working is that it didn’t raise an

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

2019-06-22 Thread Lutalo Bbosa joseph
This is what happens in the terminal when i use int(product_id) 2 2 [22/Jun/2019 16:56:33] "POST /carts/update/ HTTP/1.1" 302 0 [22/Jun/2019 16:56:33] "GET /carts/ HTTP/1.1" 200 8245 On Sat, Jun 22, 2019 at 7:50 PM Alejandro Pena wrote: > I feel you, figuring out such errors for the first tim

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

2019-06-22 Thread Lutalo Bbosa joseph
kk will do that, On Sat, Jun 22, 2019 at 7:29 PM Amiya Dash wrote: > Can u send me the full project.share me the github link > > -- > 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

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

2019-06-22 Thread Alejandro Pena
I feel you, figuring out such errors for the first time can be infinitely frustrating. I believe that the form is sending you product id numbers as strings, or 1 as ‘1’. If the product_id = ‘1’ then product_id is not None. However, you have defined product_id in the model for Product as an in

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

2019-06-22 Thread Amiya Dash
Can u send me the full project.share me the github link -- 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+unsubscr...@googlegroups.com. To post to thi

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

2019-06-21 Thread Héctor Alonso Lozada Echezuría
Of course, Share your source code and stack trace through pastebin El vie., 21 jun. 2019 a las 13:34, Lutalo Bbosa joseph () escribió: > am trying to figure it out but when i > print(product_id) > print(type(product_id)) i get this output > 1 > , so probably its because i cant iterate over a s

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

2019-06-21 Thread Lutalo Bbosa joseph
am trying to figure it out but when i print(product_id) print(type(product_id)) i get this output 1 , so probably its because i cant iterate over a string but am still failing to figure it out On Fri, Jun 21, 2019 at 10:16 PM Lutalo Bbosa joseph wrote: > hi hector, can u help me fix it, coz am

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

2019-06-21 Thread Lutalo Bbosa joseph
hi hector, can u help me fix it, coz am kinda puzzled On Fri, Jun 21, 2019 at 9:56 PM Héctor Alonso Lozada Echezuría < ima...@gmail.com> wrote: > Apparently product_id has no value > > product_id = request.POST.get("product_id") > print(product_id) > print(type(product_id)) > > > El vie., 21 j

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

2019-06-21 Thread Héctor Alonso Lozada Echezuría
Apparently product_id has no value product_id = request.POST.get("product_id") print(product_id) print(type(product_id)) El vie., 21 jun. 2019 a las 6:33, Lutalo Bbosa joseph () escribió: > hi guys, am working on an ecommerce system, which has cart as an app, but > i keep on getting this error

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

2019-06-21 Thread Lutalo Bbosa joseph
ValueError at /carts/update/ invalid literal for int() with base 10: '' thats the error On Fri, Jun 21, 2019 at 7:46 PM Jorge Gimeno wrote: > Would you be able to copy and paste the stack trace here? Without that, > it's really hard to see where this exception is coming from. > > -Jorge > > On

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

2019-06-21 Thread Jorge Gimeno
Would you be able to copy and paste the stack trace here? Without that, it's really hard to see where this exception is coming from. -Jorge On Fri, Jun 21, 2019 at 9:13 AM Lutalo Bbosa joseph wrote: > here is my template that handles that bit, and i have as well attached > atemplate in which it

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

2019-06-21 Thread Aldian Fazrihady
Does the stack trace mention a template variable name? It looks like a template variable that is expected to have integer value is not properly initialized. Regards, Aldian Fazrihady On Fri, 21 Jun 2019, 22:42 Lutalo Bbosa joseph, wrote: > i as well have a models.py file for carts, and produc

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

2019-06-21 Thread Lutalo Bbosa joseph
on pressing remove the product is supposed to be removed from the cart, but it instead displays an error On Fri, Jun 21, 2019 at 6:34 PM Lutalo Bbosa joseph wrote: > well here is apic of what am doing, > > On Fri, Jun 21, 2019 at 6:20 PM Ahmed Ishtiaque > wrote: > >> Hi Lutalo, >> >> Could you

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

2019-06-21 Thread Ahmed Ishtiaque
Hi Lutalo, Could you also share the stacktrace of the error and when it happens? It would help us decipher what's really going on in relation to what you're trying to do. Best, Ahmed On Fri, Jun 21, 2019 at 8:33 AM Lutalo Bbosa joseph wrote: > hi guys, am working on an ecommerce system, which

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

2019-06-21 Thread anchal agarwal
Hello lutalo I am also facing the same issue. If you find any solution please let me know . It would be very helpful. Thank you hi guys, am working on an ecommerce system, which has cart as an app, but i keep on getting this error and cant move on any help, here is my views.py , from the commandlin

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

2018-07-25 Thread Jorge Gimeno
Can you please post your view? On Tue, Jul 24, 2018 at 9:02 PM, Nitesh Chaudhary wrote: > I got the error on "Writinh your first Django app, part4, in the view of > vote. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe

Re: invalid literal for int() with base 10: '' using FormSet with File Upload

2016-01-12 Thread Luis Zárate
What is the value of pk in study_form_set = DiagnosticStudyFormSet(request.POST, request.FILES, prefix='studies', queryset=DiagnosticStudy.objects.filter(diagnostic__id=pk)). ? Is pk an int? try print type(pk) El martes, 12 de enero de 2016, Néstor Boscán escribió: > Hi Django Forum > I'm wor

Re: invalid literal for int() with base 10 trying to access uploaded image

2015-04-17 Thread Stephen J. Butler
On Fri, Apr 17, 2015 at 8:16 AM, Jyothi Naidu wrote: > > if 'audit_info_manage' in request.POST: > 192 #fullname = Employee.objects.get(emp_id=request.POST['emp_id']) > 193 audit_manage_key = request.POST.get('audit_info_getdata') > 194 if audit_manage_key: > 195

Re: invalid literal for int() with base 10 trying to access uploaded image

2015-04-17 Thread Jyothi Naidu
Hi Kelvin, I am also having the similar issue where i am not able to solve it invalid literal for int() with base 10: '' Request Method:POSTRequest URL: http://172.19.7.125:8001/super-admin-dashboard/status-change/Django Version: 1.6Exception Type:ValueErrorException Value: invalid literal fo

Re: invalid literal for int() with base 10

2012-10-22 Thread Nathan Knight
Just so you know, it is bad practice to use "import * " when importing modules in python. With many modules being used, you can run into conflicting definitions. Plus, it increases overhead - potentially an exponential decrease in performance! -- You received this message because you are subs

Re: invalid literal for int() with base 10

2010-04-13 Thread Pankaj Singh
ok i resolved .. primary key was the problem i was using name as pk instead of id -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email t

Re: invalid literal for int with base 10

2010-04-01 Thread sim
Thanks for your kind reply! Yes you are right I running two scripts. I got your point and you are right but my problem is to savde string which is coming from client script. How I can do this? here is my code: client.py client.service.is_valid_user('121ABC',2) server.py def get_user(

Re: invalid literal for int with base 10

2010-04-01 Thread bruno desthuilliers
On 1 avr, 16:12, sim wrote: > Hello, > I am new to Python/Django and working on web services. > I have two files client and server both running on different ports I assume you mean "two scripts" ? > and > working as client server. Problem is this: When I send a string say > '121ABC' from client

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-10-01 Thread mrtot
Hi Kelvin, I just ran into that problem, too. However the hint to MEDIA_URL was correct! You must add the following to the very bottom of your urls.py: if settings.DEBUG: urlpatterns += patterns('', (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': 'd:sites/sgms/me

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-20 Thread kelvin pompey
ok I've set the MEDIA_URL and MEDIA_ROOT, but when I click the link I get the 404 file not found error message. If i set ADMIN_MEDIA_PREFIX to a blank string then I can access the link. But there is a problem, when I try to change the image through the form I get a page does not exist error message

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-20 Thread Srik
Make sure you have MEDIA_URL set :) Run into similar error, setting MEDIA_URL resolved it :) On Sep 18, 1:17 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote: > I am using an imagefield from the admin interface. I can upload images > without problems but when I click the link to view the image, I ge

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-19 Thread barbara shaurette
Try logging out your SQL and look for any suspicious INSERTs - I've run across this error a few times, under different circumstances, always because my code is trying to insert a string when the column is expecting an integer. --~--~-~--~~~---~--~~ You received this

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Is there a way to modify the html for the admin form to display the image using the html img tag instead of having a link to the image? On Thu, Sep 18, 2008 at 11:50 AM, Lisa Dusseault <[EMAIL PROTECTED]>wrote: > I've seen the same problem with FileFields, so it's not just ImageFields. > I haven'

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Lisa Dusseault
I've seen the same problem with FileFields, so it's not just ImageFields. I haven't figured it out yet. I can make a link to the file work from the main UI, but I don't know how the admin constructs its link in an unmodified admin form. Lisa On Thu, Sep 18, 2008 at 5:17 AM, silk.odyssey <[EMAIL

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
Here is mine, since I don't know how to reference dpaste... ;) Environment: Request Method: GET Request URL: http://localhost:8000/admin/tvsite/areas/1/areas/batzos.jpeg/ Django Version: 1.0-final-SVN-unknown Python Version: 2.5.2 Installed Applications: ['django.contrib.admin', 'django.contrib.

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
It happens inside the admin interface, so I've little control on It (AFAIK). This what i have in my urls.py: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/doc/', include('django.contrib.admindocs.urls')),

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread kelvin pompey
Everything is being handled by the admin application. Environment: Request Method: GET Request URL: http://localhost:8000/admin/grades/student/1/photos/desktop.png/ Django Version: 1.0-final-SVN-unknown Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.content

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Ross
The error looks like you are passing '1/photos/desktop.png' to int(), which converts a string to an integer. How are you creating the link to the picture? Your urls.py could be capturing that entire string and passing it as a parameter that you are trying to cast to an integer. A bigger stack tr

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-18 Thread Picio
I have the same issue, tried: Django 1.0 with sqlite3 (Wiindows) Django 1.0 with Mysql 5.0 (Windows) Django 1.0 with sqlite3 (Mac OS X) Daniele 2008/9/18 silk.odyssey <[EMAIL PROTECTED]>: > > I am using an imagefield from the admin interface. I can upload images > without problems but when I cli