Eddie
i have this .....
Eddie
class LeaveRequestStatus(IntEnum): open = 0 accepted = 1 rejected = 2 closed = 3
Eddie
and i need to set the status here to choices
Eddie
class LeaveRequest(models.Model): status = models.PositiveSmallIntegerField(default=LeaveRequestStatus.open)
Anonymous
Send you urls.py views.py in pastebin
Kaushal
I have a class named "userform" with two form fields "password" and "password2" (password2 as confirm password). Also I have a funcn "clean" where I have cleaned_data= super(userform,self).clean password = cleaned_data.get("password") password2 = cleaned_data.get("password2") if password != password2: raise forms.validationerror("...") return cleaned_data but when I typed two different password in the two fields,no error was raised and the data was saved in db
Денис
class LeaveRequest(models.Model): status = models.PositiveSmallIntegerField(default=LeaveRequestStatus.open)
too complex. https://docs.djangoproject.com/en/2.2/ref/models/fields/#choices
Anonymous
Hello
Anonymous
Can anyone help me with how to connect Vue.js with a Django REST API
Anonymous
a tutorial would be awesome
Remy
Can anyone help me with how to connect Vue.js with a Django REST API
What do you mean? Just call your django DRF endpoints from your vue code, what is the question?
Anonymous
How to make connections to Vue?
Anonymous
I have never done any front-end development
Anonymous
And I'm a complete beginner to JS
Remy
How to make connections to Vue?
Then you want to look for Vue.js tutorial before going further
Anonymous
Yeah
Anonymous
I tried looking for it
Remy
And I'm a complete beginner to JS
And you should learn JS before starting to learn Vue
Anonymous
I know the basics of Vanilla JS
Anonymous
But have never worked with a framework other than jQuery
Remy
Then you just look for a vue js tutorial
Anonymous
I don't know weather jQuery is even a framework or a library
Remy
the official one for starters
Remy
It's a library
Remy
again, just work on the foundations first
Remy
Just learn the tools before building a castle, that's common sense I guess
Anonymous
Then you just look for a vue js tutorial
Do you know any tutorial regarding Vue and REST APIs
Remy
Here to start: https://vuejs.org/v2/guide/index.html
Remy
Why do you want to use vue + django btw?
Anonymous
I have a website built with Django and for the front-end it uses HTML CSS, bootstrap and jQuery. For some time I was planning on to learn React and build the website more responsive
Anonymous
Also, I want to separate the front-end from the backend
Anonymous
Why do you want to use vue + django btw?
Do you work with Vue often?
Remy
I do but most of the time it's quite overkill
Remy
creating and maintaining endpoints for everything is a lot of work
Remy
Django templates + some ajax things to make it behave modern is way more efficient IMO
Remy
if you can have a full dedicated guy on frontend, then it's another thing
Remy
Frontend "expires" quite fast, the cost are really hight, a lot of unjustified hype
Remy
that's just my opinion of course
Anonymous
Ok
Anonymous
Thank you for helping me out
Anonymous
I found an article on Medium with Vue and Django REST framework
Anonymous
How do I update the cookies values
The
im not able to access https://api.domainsdb.info/search?query=facebook for api. Im new to python and uing ubuntu. Windows can access this. how to get api for such domains
Денис
im not able to access https://api.domainsdb.info/search?query=facebook for api. Im new to python and uing ubuntu. Windows can access this. how to get api for such domains
First: it's strange as I'm freely accessing it from a Linux desktop. Second: sorry, but this is an offtopic case and should no longer be discussed here.
The
ok..
inchidi
is there any way to use redis as django db?
inchidi
nvm i'll use sqlite instead
Tommaso
Here is a simple way to add paginator to a template showing results from a model filtered through a search bar. I leave it here in case someone needs it. https://stackoverflow.com/questions/58527833/paginator-resets-query-as-i-change-page/58540438#58540438
Ihor 🐈
Hi there, I want to discover a point about Django-development sphere: is it "normal" and appropriate practice to use type hints to imitate static typing as it possible? I don't have a big experiance exactly with Django, but projects which I happened to work on didn't have any type hints. Should I include typehints with mypy at my dev tools while working on django projects? Wouldn't it be excesses?
Ihor 🐈
I actually used to type hints during developing with pure python or some "thin" frameworks like Flask/Tornado. It helped me to make clearer structure (as seemed to me at least). But Django already contains quite a lot of codebase, and in may seems kind of mess to mix typing with code provided by django.
Bernard Kwey
Guys I have a problem with my virtualenv
Gourav
Hey all, I need help regarding nginx. I used certbot for providing the certificate to my website. Now my website changes to http to https but site can't reach. I used ec2 and django. When i run the command for django on server then my site will open on public ip but domain is not redirecting the site. I guess there is some configuration issue. Can anybody help??
Bernard Kwey
Guys I installed it but when I'm verifying the version of the virtualenv the a message comes saying that it is not recognised as an internal or external command
Bernard Kwey
Still not working
Денис
is there any way to use redis as django db?
Yes. Read "Django by Example", there's a section about Redis usage.
Денис
Sencer
Hello, Does atomic transactions or commit=False argument of save method trigger the signals?
Sencer
or not?
Ihor 🐈
Hello, Does atomic transactions or commit=False argument of save method trigger the signals?
You mean post_save signal? According to this topic, save method triggers the signal even with commit=False flag.
Daniel
Hello! I want to use celery in a project created in Python / Django on Apache and postgretsql BD manager, my question is ... what BD server can I use? Is Redis compatible with Apache?
Ihor 🐈
Hello! I want to use celery in a project created in Python / Django on Apache and postgretsql BD manager, my question is ... what BD server can I use? Is Redis compatible with Apache?
Well, how are Redis and Apache related? :) You going to interact with Redis by application layer, not web-server layer. Apache as a web-server just gets raw requests and move them forward to the your applications (Django apps) and there will be communication between Redis and Celery-tasks
Gourav
Go to your site config in nginx sites-available, comment out the ssl portion
Already did but still domain does not redirect to ip
Ghorz
First rerun certbot
Pedro
jello every body... i was wandering how i can ovewrite templates from inherence to modify the original (similar to xml and xpath), odoo and inherit modules... ??? can help me anybody with some documnetation...
Player
Hello everyone! I have a small issue. I created few users, and when I try to login, I get the error "Your username or password is wrong!"". Altough username and password are 100% correct. What could be the problem? I get no errors on console or anywhere else.
Tommaso
Empiric question here: What's the typical django-import-export data import speed for xlsx files? I am estimating 38 cells per second (I have a sheet of 14 columns and 1000 rows)
Arturo
Depend of xlsx package. openpyxl is more fast to write that xlwt. In read i think both have the same speed
Anonymous
any free hosting s for a Django project