007
Can you tell me the actual code
.
Model.objects.filter(datelt=greater_date, dategt=less_date)
Guillermo
Can you tell me the actual code
you should take a look here: https://docs.djangoproject.com/en/2.1/topics/db/queries/
.
Can you tell me the actual code
https://stackoverflow.com/questions/1317714/how-can-i-filter-a-date-of-a-datetimefield-in-django
007
Ok.. thank you all ✌️✌️
Anonymous
Hello guys, I want to know if I can redirect certain users from default admin login page. Thanks
cj
🤔
cj
Hello guys, I want to know if I can redirect certain users from default admin login page. Thanks
can you give more context/information about what do you want to do?
.
Django permissions
Anonymous
can you give more context/information about what do you want to do?
Well, I just began with the project and I don't want to waste any time with login page. And admin interface is good for my project to create some models that can be managed by users. So admin create some model and normal users gets redirected to management interface that I will create
Anonymous
I didnt really find any app available that could be integrated for this purpose
Anonymous
Managing interface after user login
007
According to me, There is no option available to use admin panel as login screen
Anonymous
According to me, There is no option available to use admin panel as login screen
Yeah, that's the problem, I couldn't access the code to modify connection behavior.
007
But you can use superuser credential for custom login screen using OneToOneField
Anonymous
But you can use superuser credential for custom login screen using OneToOneField
I can alter the login page after logging to superuser interface?
Anonymous
One more question, django apps should be reusable. Where I can find apps that I can integrate ?
{°_°}
How can I get profile model on the users model at the admin panel?
Sardor
How can I get profile model on the users model at the admin panel?
you should register them in admin.py of your app
Sardor
here, after I save the form, it does not take me back to dashboard
Sardor
should I use reverse method?
cj
Sardor wanted to post this long code: https://del.dog/tesilayafi
cj
if you want to redirect your user to another view, use redirect
cj
you shouldn't render the dashboard template in your edit view 🤷🏻‍♂️
Sardor
thank you!
Corteis
Someone can help me!!! How to make any page in django... I have problems ... Or someone can make one example?? Version 2.1.5
Corteis
did you read the django tutorial ?
Yes !! But i dont find anything
Corteis
But!!! Let me show u the error
Luis
But!!! Let me show u the error
Post it in pastebin and share the error message
ⓦⓐⓢⓓⓚⓘⓛⓛⓔⓡ
I got the file object to variable call "file" (just assume). file = request.FILE['file'] fs = FileSystemStorage() fs.save('filename1.csv', file) fs.save('filename2.csv', file) First file saved, but when try to save second file it will raise file not found error. I don't why this happens, I create different FILE objects and different FileSystemStorage objects, but I failed.
ⓦⓐⓢⓓⓚⓘⓛⓛⓔⓡ
And it shows file not found in path like '/tmp/.............'
ⓦⓐⓢⓓⓚⓘⓛⓛⓔⓡ
The first file saved into the default location correctly
John
somene know pgloader?
Anonymous
Did any one try onetoone relation with mongodb
Anonymous
That does not seem to work
Pinecorp
Can someone tell me the advantages of django over laravel?
Ronald
except php v python
Ronald
If you're better in python go for Django, if you prefer php, go for Laravel
Pinecorp
Mirco
Can someone tell me the advantages of django over laravel?
Django uses python. no other words needed imho
Anonymous
What to install module for add route address for inventory system in django?
Anonymous
Can anyone please share a sample project built on Django framework. I need it so badly. I'll be highly thankful
Pavel
Hi all. Is there some manual how to optimize a django+uwsgi app? I have performance issues on the production server with uwsgi, and they are not constant. Sometimes one page loads for 2 seconds and sometimes 60 seconds, there is nothing definite in logs or profiling on dev (which is always fast) except "OS: Write error" which seems more a warning from nginx+uwsgi than a source of the problem
Ronald
but
Ronald
considering
Ronald
that you say it is working sometimes
Pavel
Write error might be something with your permissions
I'm not writing anything actually in HEAD/GET requests. Google says it's just a problem of communication between nginx and uwsgi, some of them close the pipe and the other ones tries to write there after the timeout and so on
Pavel
Should not be a problem except logs cluttering
Ronald
is it doing any data intesive tasks?
Pavel
Not really, just a small imageboard
Ronald
Recently a client's server gave a lot of time out errors as its quering 5m+ database entries and upgrading to more CPU's helped a lot.
Pavel
It's not loading my CPUs even to 10%
Pavel
And the tasks are rather simple, there is nothing that could keep it loaded for 30 seconds when the same page opends in 0.5s on dev server (with just runserver)
Pavel
Even simple pages with just settings from the session is slow
Ronald
Does the same happen on your Dev environment?
Pavel
No, dev is always fast
Pavel
I suspect something in nginx+uwsgi+django, but don't know where to look
Ronald
Is it possible to use Gunicorn as opposed to uwsgi ?
Pavel
Tried it but it does not seem faster
Ronald
can probably loook in your web browser's console
Pavel
Maybe it's more stable in its slowness, while uwsgi is sometimes fast and sometimes slow, but it's not better
Ronald
to see what's loading
Ronald
is it ajax or something?
Ronald
or just a page load and rendering by django/jinja
Ronald
?
Pavel
Nope, it does not come to ajax yet. I'm looking at just a page load
Pavel
Some slowness may be added by included templates, I agree with that, but again it should be at constant speed
Pavel
I have posts rendered as inclusion tags with some small preprocessing which is not very fast