Zey
I am getting this error File "C:\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response raise ValueError( ValueError: The view home.views.seller_register didn't return an HttpResponse object. It returned None instead. [03/Apr/2021 21:43:10] "POST /seller_register/ HTTP/1.1" 500 60706
Zey
I am getting this error File "C:\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response raise ValueError( ValueError: The view home.views.seller_register didn't return an HttpResponse object. It returned None instead. [03/Apr/2021 21:43:10] "POST /seller_register/ HTTP/1.1" 500 60706
This is view def seller_register(request): if request.method=='POST': a=SellerRegisterForm(request.POST) if a.is_valid(): email=a.cleaned_data['email'] try: f=SellerRegister.objects.get(email=email) error_message="Email Already Taken" return render(request,'seller_register.html',{'error':error_message,'fm':a}) except: a.save() return redirect('index') else: a=SellerRegisterForm() return render(request,'seller_register.html',{'fm':a})
Harsh
if a.is_valid(): else for this if
Zey
if a.is_valid(): else for this if
Thanks I add and it resolved
Harsh
exactly thasts why you are receiving this error because if a.is_valid(): is false then its looking for else but its not their and neither the statement for if method =post
Zey
But why it is important to add that bcz I had not added in others but it worked
Harsh
But why it is important to add that bcz I had not added in others but it worked
condition is not true just track the flow and you will know
Zey
Ok, Thanks once again
Harsh
NP
Akhil
Can anyone tell me how to transfer postgresql database to SQLite
Akhil
??
Mareedu
Anyone Good in Django Framework?
Mareedu
Sign in with Fire Based Account's
Mareedu
I'm Generated up to API Key Next How to Integrate the Code in Django Framework
Mareedu
Login With Facebook
Zey
If I am using usercreationform for both user and seller so how I will know which is seller and which is user?
Zey
Groups
Can you explain it in more detail?
Umar
Django has groups to group user types
Zey
Like multiple user type
Umar
Like roles
Umar
Check official docs
Zey
Ok, Thanks
Kamal
Guys, hello everyone, I am writing (trying) tests for a view that inherits from generic.CreateView, the difficulty is that I have a field in the model that refers to the User model, in the view I get the user's request.user and save it in the model field generic.CreateView, I don't know how to organize it in tests https://pastebin.com/0put8zQN
Patience
Try Apscheduler
Thank you a lot, I will try it. Celery is not working.
Mirco
Thank you a lot, I will try it. Celery is not working.
Celery works, it depends on your code Something is wrong for sure If you follow Celery documentation everything will work properly
Mirco
By changing to another one it does not solve anything Try Django Q if you wanna something easier to configure and maintain
Mirco
I tried documentation, import future fail
It does not make sense what u have said Try to share code and errors u have
Patience
"from future imports must occur at the beginning of the file"
Patience
future
Patience
There is double underscore on beginning and end on future.
Mirco
"from future imports must occur at the beginning of the file"
It's a python error not a Celery one You need to put at the beginning of the file most of times
Sai
Hi, I need a better tutorial to setup the weaockets in Django.
Doragonsureiyā
Hi, I need a better tutorial to setup the weaockets in Django.
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Rishabh
If there is lot of change required in admin panel(like for design) then you should go for react or angular
Rishabh
Yes, you can go for it
Tawfiq
Guys Can someone please explain the get_context_data() for me
Tukhtamurod
create category table in db
Tukhtamurod
how would i know?? before creating a website you should clearly define models and create draft of database schema with all entity and relationship tables, after making sure everything is fine, then you have to implement it
Tukhtamurod
the core part of backend application is not just your view functions, the most important part is db part, if your db is well implemented, you will have much less difficulty in your project
Ali
Hi all. I've a problem. X model related the Y model. I need to see to X models fields. How can i do?
Ali
X(id, name,brand,size) , Y(X foreign key, ...) . I want to see X.brand in to the Y model) How can i do that.
Mirco
What should I put on the beginning to solve that?
The import statement, what the errors is telling u
Patience
The import statement, what the errors is telling u
from _ _future_ _ imports must occur at the beginning of the file I tried to copy - paste from documentation and still give me error. Import of future only works.
Patience
The import statement, what the errors is telling u
Worked, I started importing it now worked, thank you so much. Let me continue documentation. I didn't know that should be first.
Patience
It's python, not so strictly related to celery
Let me continue, if run I will tell you
Patience
Patience
Use this code: data = models.Foreignkey(X, on_delete = models.CASCADE)
It works for me. X is the models class name as you said.
Ali
It works for me. X is the models class name as you said.
oh thanks. Sorry for my English. I need to fields of the Model(as X) in to the Y model. For example: X model has this fields= name,color_code. Y model has this field = X(related with ForeignKey) and other fields parameter. But i want to Y model include the color_code in the Admin panel. I hopefully understand me
Mohammad
Do default = None and Null = true do the same thing? No data is to be recorded in the field
Anonymous
Hii guys , I am begginer to this django
Anonymous
Can you suggest some resources to learn django
Zey
I am also making e-commerce website and when u will start the project , project will get bigger and bigger and how many tables u should add it depends upon your requirement
Tukhtamurod
X(id, name,brand,size) , Y(X foreign key, ...) . I want to see X.brand in to the Y model) How can i do that.
Inside Y you can access all X fields just using X.brand, X.*, when you define a relationship, the X inside Y is not just a field in ORM, it is a particular instance of X model
Anonymous
Amir m
Hi In windows we runserver and can see my site What should we do inside the github?
Amir m
Question is not clear
I want to see the site I uploaded to the github
Tukhtamurod
I want to see the site I uploaded to the github
Github is not a hosting server, it is a storage
Tukhtamurod
Version control system
Amir m
Github is not a hosting server, it is a storage
So why does it show the html , css , javascript , php , ...... file ?
Amir m
In setings and on github pages
Amir m
You can get a address for your cods
Patience
Github is not a hosting server, it is a storage
Anyway I want to learn how to synchronize Django and other projects to other people, can you recommend us how we can do it? I have git cmd installed.
Tukhtamurod
So why does it show the html , css , javascript , php , ...... file ?
what do you mean by "it shows html, css, .... file"?
Amir m
what do you mean by "it shows html, css, .... file"?
Like things " localhost : " on windows
Tukhtamurod
Like things " localhost : " on windows
sorry I dont understand you) never mind if someone else does they will help you