Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread i...@serenityscotland.co.uk/webmail
Hi Folks, Here is models.py: from django.db import models class Product(models.Model): name = models.CharField(max_length=255) price = models.FloatField() stock = models.IntegerField() image_url = models.CharField(max_length=2083) class Offer(models.Model): code = models.CharField(max_length=1

Re: Possible server attacks

2020-05-04 Thread Miracle
Okay, I will do all those. Thank you so much. I appreciate. On Mon, 4 May 2020, 1:26 am Motaz Hejaze, wrote: > check the log file , what are the acts that invokes the call to those > links > example , logging in ? upload an image ? any act > > also try to check if there is a malicious sc

Django Package Website is not opening

2020-05-04 Thread Hamza Mirchi
Hi Everyone, Please Fix This issue This website is not opening https://djangopackages.org/ I need to check packages for my Django app but it's not opening please fix that -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Re: Django Package Website is not opening

2020-05-04 Thread Mike Dewhirst
On 4/05/2020 6:14 pm, Hamza Mirchi wrote: Hi Everyone, Please Fix This issue This website is not opening https://djangopackages.org/ I need to check packages for my Django app but it's not opening please fix that Works for me -- You received this message because you are subscribed to the G

Re: Django Package Website is not opening

2020-05-04 Thread Hamza Mirchi
If I use VPN it works but without VPN it's not working On Monday, May 4, 2020 at 4:22:37 AM UTC-4, Mike Dewhirst wrote: > > On 4/05/2020 6:14 pm, Hamza Mirchi wrote: > > Hi Everyone, > > > > Please Fix This issue > > > > This website is not opening > > https://djangopackages.org/ > > I need

Re: Django Package Website is not opening

2020-05-04 Thread Mike Dewhirst
On 4/05/2020 6:21 pm, Mike Dewhirst wrote: On 4/05/2020 6:14 pm, Hamza Mirchi wrote: Hi Everyone, Please Fix This issue This website is not opening https://djangopackages.org/ I need to check packages for my Django app but it's not opening please fix that Works for me Further to that, it

Re: not a valid UUID.

2020-05-04 Thread Nomeh Uchenna Gabriel
That looks good to you but is definitely a dangerous approach if the "12 digits" should be unique for each QuerySet since "random.random" can return dublicate numbers when called multiple times. ... I suggest you make a function for that or novicely adds the item's 'pk' to the random number mak

Re: not a valid UUID.

2020-05-04 Thread Nomeh Uchenna Gabriel
[CONTINUED] I just saw "unique=true" on that field ... you may not face the problems of using "random" just yet but must face it at some "random time in the future" - once you see something like this: >>>: IntegrityError ... then shall you remember my reply. The best option is to use a wel

How to get previously uploaded Images in Django

2020-05-04 Thread Nomeh Uchenna Gabriel
You should read about customising the admin here: https://docs.djangoproject.com/en/3.0/intro/tutorial07/ ... but I suggest that you build your own website control panel which will control your website with API's -- You received this message because you are subscribed to the Google Groups "D

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Adedotun Richard
Did you remember to add the models to the admin.py? >From .models import Product, Offer admin.site.register(Product) admin.site.register(Offer) On Mon, May 4, 2020, 8:02 AM i...@serenityscotland.co.uk/webmail < i...@serenityscotland.co.uk> wrote: > Hi Folks, > > Here is models.py: > > from dja

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Govind Kumar Yadav
can you pls share how your admin.py file looks like On Monday, 4 May 2020 12:33:03 UTC+5:30, ia...@serenityscotland.co.uk/webmail wrote: > > Hi Folks, > > Here is models.py: > > from django.db import models > > class Product(models.Model): > name = models.CharField(max_length=255) > price = mode

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread i...@serenityscotland.co.uk/webmail
I think so, from admin.py: from django.contrib import admin from .models import Product, Offer admin.site.register(Product) admin.site.register(Offer) On Mon, 4 May 2020 at 13:17, Adedotun Richard wrote: > Did you remember to add the models to the admin.py? > > From .models import Product, Off

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread i...@serenityscotland.co.uk/webmail
Hi, here it is. Any help much appreciated. from admin.py: from django.contrib import admin from .models import Product, Offer admin.site.register(Product) admin.site.register(Offer) On Mon, 4 May 2020 at 13:33, Govind Kumar Yadav wrote: > can you pls share how your admin.py file looks like >

Two forms in one template

2020-05-04 Thread Sergei Sokov
I have two forms in one template, but one of them doesn't have data to my database. Why does it happen and how to fix it? When I fill out the Pack form and press "submit" the terminal shows that: "POST" /sklad HTTP/1.1" 200 9937 This data doesn't save to my database. When I fill out the Sklad

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Sherif Adigun
Did you set up your project in a virtual environment?? If yes, always remember to runserver in the virtual environment -- 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 ema

Two forms in one template

2020-05-04 Thread Sherif Adigun
Your code is working perfectly. Just that you need to remember that the view has its model set to Sklad. Hence, when you called super() on form_valid, only the Skald instance is saved. You need to manually save the Pack form in the form_valid method. -- You received this message because you a

Re: Two forms in one template

2020-05-04 Thread Sergei Sokov
I guessed about it. But I dont know how to do that. понедельник, 4 мая 2020 г., 18:42:10 UTC+2 пользователь Sherif Adigun написал: > > Your code is working perfectly. Just that you need to remember that the > view has its model set to Sklad. Hence, when you called super() on > form_valid, only

Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Hi, I have just started learning django and was trying to make a meeting planner project y folllowing a course. I updated the setting.py file to add website into Instaled_Apps. Then have written a function named welcome in views.py Finally I added it's entry into urls.py fie But when I run the se

Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
There are lots of issues with urls.pyPlease go through the django documents on how to write urls.py Sent from Yahoo Mail on Android On Mon, 4 May 2020 at 23:39, Deepti sharma wrote: Hi, I have just started learning django and was trying to make a meeting planner project y folllowing a co

Re: Page 404 error after running Django server

2020-05-04 Thread franz ulenaers
path('welcome.html', welcome) should be : path('', welcome) Op 4/05/2020 om 20:11 schreef 'Amitesh Sahay' via Django users: There are lots of issues with urls.py Please go through the django documents on how to write urls.py Sent from Yahoo Mail on Android

Re: Page 404 error after running Django server

2020-05-04 Thread Franz Ulenaers
pleae change your urls.py as follow urlpatterns = [ path('admin/', admin.site.urls), path('', welcome) ] Op maandag 4 mei 2020 20:09:51 UTC+2 schreef Deepti sharma: > > Hi, I have just started learning django and was trying to make a meeting > planner project y folllowing a course. > I

Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Hi, I did replace it with: path('',welcome) But it's still no working: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/welcome Using the URLconf defined in meeting_planner.urls, Django tried these URL patterns, in this order: 1. admin/ 2. The current path, welc

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Nomeh Uchenna Gabriel
Hi! the reason is probably because you happened to have deleted "some but not all of your migrations" ... django will always look for the latest "sqlmigrate" with the versions in the right order(0001,0002,000x...) before it allows "makemigrations" add a new one. To fix, this you must: delete

Re: Page 404 error after running Django server

2020-05-04 Thread R D Saini
path("welcome/",views.welcom), On Mon 4 May, 2020, 11:42 PM 'Amitesh Sahay' via Django users, < django-users@googlegroups.com> wrote: > There are lots of issues with urls.py > Please go through the django documents on how to write urls.py > > Sent from Yahoo Mail on Android >

Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
@rdsaini...@gmail.com I updated it with: path("welcome/",views.welcome), But no success. Error at http://127.0.0.1:8000/welcome : TypeError at /welcome/ __init__() takes 1 positional argument but 2 were given Request Method: GET Request URL: http://127.0.0.1:8000/welcome/ Django Version: 3.0.5

Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
path("", views.welcome) This should work Sent from Yahoo Mail on Android On Tue, 5 May 2020 at 0:13, Deepti sharma wrote: @rdsaini...@gmail.com I updated it with: path("welcome/",views.welcome),But  no success. Error at http://127.0.0.1:8000/welcome : TypeError at /welcome/ __init__() ta

Re: Page 404 error after running Django server

2020-05-04 Thread 'Amitesh Sahay' via Django users
Please import HttpResponse ,  HttpRequest will not work Sent from Yahoo Mail on Android On Tue, 5 May 2020 at 0:14, Amitesh Sahay wrote: path("", views.welcome) This should work Sent from Yahoo Mail on Android On Tue, 5 May 2020 at 0:13, Deepti sharma wrote: @rdsaini...@gmail.com 

Re: Page 404 error after running Django server

2020-05-04 Thread Jorge Gimeno
I just realized that the view is returning an HttpRequest. It should be an HttpResponse object (and the import should be changed to bring that object in as well). -Jorge On Mon, May 4, 2020 at 11:43 AM Deepti sharma wrote: > @rdsaini...@gmail.com > I updated it with: path("welcome/",views.welc

[no subject]

2020-05-04 Thread fahad rasool
In my django project ,when a user sign up, a form is redirected to fill user information,further iam displaying this info on other page ,but whats happening is when i am dislaying the information of the current user who had logged in ,information of all users is displayed who had been signed up ear

Page 404 error after running Django server

2020-05-04 Thread Nomeh Uchenna Gabriel
Hi! you're just visiting a different url from what you specified in your "urls.py" file. look closely at the routes "django" is telling you that it tried: [admin/, welcome.html/] ... these are truly the two paths that you specified, why on earth are you trying to visit a non-existing path(http

Re:

2020-05-04 Thread Ernest Thuku
It means you have put remember password on in your browser settings..so the information that you have registered in a form from a user will be displayed. On Mon, May 4, 2020, 21:53 fahad rasool wrote: > In my django project ,when a user sign up, a form is redirected to fill > user information,fu

Re: Re:

2020-05-04 Thread fahad rasool
On Mon, 4 May 2020, 12:47 am Motaz Hejaze, wrote: > first remove all whitespaces in urls.py > > ' login' should be 'login' > > and then rename your login view to something else , maybe custom_login , > or put your app urls before admin panel urls > > On Sun, May 3, 2020 at 6:42 PM fahad rasool >

Re: Page 404 error after running Django server

2020-05-04 Thread Deepti sharma
Thanks everyone. I updated HttpRequest with HttpResponse. Then in urls.py: I did: path(‘’, views.welcome) Its working now On Mon, May 4, 2020 at 3:06 PM Nomeh Uchenna Gabriel < nomehgabri...@gmail.com> wrote: > Hi! you're just visiting a different url from what you specified in your > "urls.py"

Re:

2020-05-04 Thread fahad rasool
No man than also it shows same behaviour On Tue, 5 May 2020, 12:50 am Ernest Thuku, wrote: > It means you have put remember password on in your browser settings..so > the information that you have registered in a form from a user will be > displayed. > > On Mon, May 4, 2020, 21:53 fahad rasool

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Iain Stewart
HI Nomeh, Thanks for that. I have deleted the migration files, and made migrations again. Can you clarify exactly the python command: py manage.py sqlmigrate [app_Name]0001 if my app is called products please as I am getting: (venv) C:\Users\user\PycharmProjects\JoanneShop>py manage.py sqlmigrat

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Iain Stewart
worked it out, it is: py manage.py sqlmigrate products 0001 but I am still not being able to connect into the database from django admin. On Mon, 4 May 2020 at 20:41, Iain Stewart wrote: > HI Nomeh, > > Thanks for that. I have deleted the migration files, and made migrations > again. Can you c

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Iain Stewart
that is still not working, thanks for all your help though, any other ideas appreciated. Could it be that I need an older version of sqlite as this Mosh tutorial was in 2018? Iain On Mon, 4 May 2020 at 20:44, Iain Stewart wrote: > worked it out, it is: py manage.py sqlmigrate products 0001 bu

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-04 Thread Adedotun Richard
The only option now is to help you by connecting to your system remotely and see the error messages and try to help you remotely. If that will help On Mon, May 4, 2020, 8:52 PM Iain Stewart wrote: > that is still not working, thanks for all your help though, any other > ideas appreciated. Could

Re:

2020-05-04 Thread Adedotun Richard
Can you show your views.py let me check where you get it wrong? You might be calling a wrong function to handle the output On Mon, May 4, 2020, 7:53 PM fahad rasool wrote: > In my django project ,when a user sign up, a form is redirected to fill > user information,further iam displaying this in

Re:

2020-05-04 Thread Adedotun Richard
For the form not saving can you show the error message received? Hope you did not forget to put csrf_token above ur form in the template? And your views.py for the register should be in quote return redirect ('login') On Sun, May 3, 2020, 3:04 PM fahad rasool wrote: > > I am unable to redire

Re:

2020-05-04 Thread Famzaa
please show mw your views.py On Tue, May 5, 2020 at 1:08 AM Adedotun Richard wrote: > For the form not saving can you show the error message received? Hope you > did not forget to put csrf_token above ur form in the template? > > And your views.py for the register should be in quote > return r

Django MySQL database backup and restore to new server

2020-05-04 Thread marc bellazzini
Hello, I have Django 2.x running on an old Ubuntu server with a MySQL database. I have installed a new Ubuntu 20.04 server on another machine with Django 3.x and MySQL. I would like to backup the old Django/mysql database and restore it on the new server. What is the best practice for doing th

Inner Join Query

2020-05-04 Thread Giovanni Silva
Hello, I need execute one "complex" query in Django, but I don't know how I can do that. This is the query: select case WHEN NetSales_.ORGV = 'OVE2' THEN 'COC' WHEN NetSales_.ORGV = 'OVE5' THEN 'DOM BOSCO' WHEN NetSales_.ORGV = 'OVE8' THEN 'ATITUDE' ELSE 'Outra' end as 'Marca', NetSales_.CLIENTE,

Dynamic Radio Form

2020-05-04 Thread J.T.
I'm working on an app that will allow the user to select the winner between two teams (radio buttons) and I need the info saved to the database. I'm having trouble with the radio forms part. I've read the documentation and searched Google all day, but I can't seem to wrap my heads around it. H

Re: My first django app error: FATAL: password authentication failed for user "postgres"

2020-05-04 Thread Pratibha Gupta
Hi Eduardo, I am exactly in same situation. Configuring django first time from my Ubuntu 18.04.3 LTS. Facing the same issue. Did you get solution for it? Thanks, Pratibha On Monday, October 21, 2019 at 11:48:47 PM UTC+11, Eduardo Hidalgo García wrote: > > Hi Guys, > > Is my first time working

[no subject]

2020-05-04 Thread fahad rasool
I am working on project which is a diet planner,for that a user have to signup ,fill a form and them meal plan is generated,in that i have made two groups one for admin and other for customer,now i am unable to retroeve data of the customer who is logged in. -- You received this message because y

Re:

2020-05-04 Thread Motaz Hejaze
What do you need exactly ?? What is the error ?? Do you want to check for user type in templates or views ??? If this is your question .. 1 - use a custom user model 2 - put user types dictionary in custom user model 3 - in your templates and views check the current user type by using request.use

Re:

2020-05-04 Thread Adedotun Richard
Can you see that the Customer is not define that was the reason why it was underlined. Try and import your app model to your view.py: from .models import * On Mon, May 4, 2020, 10:35 PM fahad rasool wrote: > > On Tue, 5 May 2020, 1:30 am Adedotun Richard, > wrote: > >> Can you show your view