Bob
but redirect method expects a url/template
Mahan
Mahan
class OrderView(View):
def get(self, request, pk):
cart = Cart(request)
if not request.user.is_authenticated:
return redirect('account:register')
if not cart.cart:
return redirect('cart:cart')
else:
order = get_object_or_404(Order, id=pk)
return render(request, 'orderdetail.html', {'order': order})
Bob
what's the error ur getting?
Mahan
Bob
maybe ur if condition is not in right place?
dvd
Hello everyone. I am new here and need some help with a Django project. I started my app locally in windows and I have finished it . The problems come when I want to deploy the server for production. I am not getting the right information. Someone could help? Btw. I didnt use a venv, I read It's not mandatory to use it. I read your replies
dvd
I want to deploy the server in a Linux, Debian based PC. I could run it with runserver, but as I need to install a SSL certificate I have to deploy it for prod
Bob
Bob
I mean gunicorn to serve the app and nginx to reverse proxy
dvd
I tried it, but not getting good results. Maybe I am not following the right documentation/tutorials
dvd
Or I am missing some steps
deficiente ✙
Hi everyone!)
I'm using django_ninja to write my api and a have slight a problem with authentification. I have ReferralUser model - that's the custom model that i want to use in my api. But for the admin panel i want to use built-in django user. How can i manage to do that?)
Данил
As I now Django can use only one Authentication model. But you can use relation one-to-one for your Models with extra fields.
Данил
Did you get?
deficiente ✙
I have one to one relation between Referral user and built-in user models, but it has blank and null True, because referral users can be registered from the website and they don't necessarily need separate django user to operate
deficiente ✙
deficiente ✙
I've read about specifying authentication backends in django, can i use it for my purpose?
Morteza
Morteza
Use only one model for users authentication, and specify extra fields for it, with groups or anything that fits your project.
Morteza
Данил
Or use OOP instead relations
Morteza
deficiente ✙
deficiente ✙
@Wisely456 you too man)
Morteza
cj
use any VPS
𝐊✞𝐚𝐧
Pythonanywhere if you looking for free host
Heroku is good too ,but not for where we live
Anonymous
Which breadcrumb package would you recommend for Django when using class-based views?
Charly
Do some research on google mate.
Charly
Bingo!
Charly
Yeah you need to learn these things. There are no host solutions that require no learning.
Charly
It's a service it will last while you pay for it or you destroy it.
Charly
No, there is no such thing as pay once.
Charly
Use pythonanywhere is free
Charly
You won't have 1000 users. Don't overestimate your work.
Charly
So when you are ready to invest money you can use the paid plan of pytohn anywhere or another server.
Pavel
Hi everyone, please share examples of best practice tests for DRF on Pytest. I want to get good test coverage for my application and develop new functionality using TDD.
Maybe someone of you have open repository with pretty tests, or some examples in your favorites.
Anonymous
Shay
Hi folks,
Can anyone tell me I created django app and the database used is sqlite.
How to deploy and host it for free?
Pavel
Shay
Shay
Okay
deficiente ✙
deficiente ✙
So it would be great to learn how to work with postgre
Shay
Shay
Pavel
And for free dns you can use cloudfire
Данил
There is no free hosting. If VPS is free it doesn't fit to real work
Данил
You should use digital ocean for deploy through docker. Digital ocean also has articles for deploying
Данил
Railway, Versel, Flyio, Render , python anywhere. All of these are bad things for real work
Данил
By the way Versel is only for frontend developers as I know
deficiente ✙
Данил
If he wants stable work of his project, than have to use this
Soa
deficiente ✙
.®️eza.
Hi there
Does anyone know YouTube channels about Django that introduce the latest Django features and tricks?
deficiente ✙
Shay
Кошка
Does anyone have django roadmap to share?
Mirco
Ahmed
Is there any plane for django to support creating api without using third party framework like drf
Bhushan
Hii there
How can i develop my business logic in django I have the understanding of django but now I am facing difficulty to develop my business logic
ᅠ ᅠ
Hello everyone, tell me how to add Python files to a Django project that do not belong to the project, but should work when called.
Anonymous
Hello
I want to create a project with Celery and Django for my resume, but I have no idea
Help 😅