Naggafin
Ravi
where can i learn Django rest framework ORM with advance way
Naggafin
where can i learn Django rest framework ORM with advance way
the official tutorial docs for drf aren't so great, unfortunately. I learned mostly by experience and trial and error. your best bet is to actually learn by doing. take a project you've already created in the past, and give yourself a practice assignment of making basic CRUD API endpoints using drf, which would act like the django admin control pages, but serve as a REST API version of it for your app
Amnas
Hey, my Django WebSocket is running properly on the Django localhost, but it's not working on the live server. I'm not sure why it's not working. When I connect using the live server, it shows a 1011 Server Error: Internal server error while operating. ?
Shanu
DJanog
Shanu
DJANOG movie
Anzz
Krushna
Is there any library to receive e-mails into the django website via mailgun?
I've tried django-anymail and received inbound mail from the mailgun route. I want whole email functionality like inbox, sent items, spam, trash integrated into django project database.
Any suggestion is highly appreciated.
Naggafin
of course, if you're pulling data from a third party source, the most you should be doing with that data is caching it. I guess, if it were me, I'd probably have some caching backend like redis cache email data pulled from the third party source you're using and then having that as presented to the user as opposed to storage anything at all in the database, since without being the original source of that information, it makes not so much sense to store it
Ammar
Ammar
Put maybe this is a bad way to learn
Or what do you think
Naggafin
Put maybe this is a bad way to learn
Or what do you think
I ditched Windows in 2016 completely so I can't say entirely. my honest opinion, which lacks a lot of nuance, is developing on a non-Linux system is just not such a great idea to begin with because there exists exponentially more support for things on Linux if you're a dev. I've encountered many libraries over the users the that explicitly state they either don't support Windows or getting them to run on Windows would require a bunch of complicated things. but that's just my opinion. take it with a grain of salt.
I've heard good things about Cygwin though. if I were you, I'd install Cygwin (which is basically a Linux sandbox for Windows), learn a little bit of the basics, and you can follow this tut for redis: https://gist.github.com/cromat/a86511f72e1282c496ba156fb6eb2352
Naggafin
this of course differs from the official documentation. I don't know which way is better. the only reason I bring up Cygwin is because I've heard it recommended a lot. I've neither used Cygwin nor WSL myself since I don't use Windows
Ammar
Naggafin
I use Ubuntu because it's relatively easy to use in comparison to other distros and it's free. whatever you choose, be prepared to get comfortable using a terminal interface. a lot of things you do in Linux require that of you
مريم خالد
I want to learn about cache in django any recommendations
Doragonsureiyā
Ammar
Naggafin
yw
Krushna
Naggafin
yw
Ravi
How to create django pipeline. How it is useful
Naggafin
Diwakar_jii
Hello guys I am facing an issue related to audio Blob handling from django backend can anybody help me with that
Diwakar_jii
I am only getting 1kb audio
Doragonsureiyā
Diwakar_jii
What you want tell me
Doragonsureiyā
What you want tell me
Read this please:
http://catb.org/~esr/faqs/smart-questions.html#intro
Diwakar_jii
audio_blob = request.FILES['audio_blob']
aud_name = 'audio/'+name
path=os.path.join(settings.MEDIA_ROOT, f'{aud_name}.wav')
with open(path,'wb') as wav_file:
wav_file.write(audio_blob.read())
wav_file.close()
this me my code
Asukhan
Hey there! been reading the documentation, but still can not completely understand what is **kwargs in Django CBV. Like, is it the list, that contains the attributes of the class we created and then we pass them in get_context_data etc?
Muflone
Muflone
arguments passed to the method/constructor call, not attributes
Muflone
consult the python documentation for *args and **kwargs
levels
Im trying to deploy simple Django project in aws
In my project there are 5 urls include django admin dashboard
But at the end I can't login as admin or register any user
It claims  csrf token
During production everything works fine
Database i use is SQLite
Please can anyone help me with this issue?
Yaroslav
Vipul
I created a login API in django
I have connected it to postgres
It works fine when I define the field values in my views.py and return it
What I want to do is create field values directly using SQL query in postgres and it should run
But it's not running when I'm doing it like this
Can anyone help?
1man
Psycopg2- binary error
1man
https://nekobin.com/kaqitopaza
دانایی
My friends, I have a problem. I uploaded my files, I specified the media url and media root in the media settings, but when I click on the image link of Apple, it gives me a 404 error. Does anyone know how to fix it?
Kairat
Kairat
Kairat
Kairat
Kairat
and you gotta fix thing in setting.py also
دانایی
Shijin
Why u restrict photos in here. If u remove that. That will help me. Because I have lots of error. But I can't share pics here
Kairat
Read errors and google it step by step
Kairat
Or copy and paste your errors here
Maxim
カカロット
select column where ....=.... and ....=.... how this statement written in django
カカロット
Ravi
How to create meme generator in Django or any readyment project for learning
Maxim
Ravi
Yes, run and check how it work and what logic are me used
Oraz
Dear friends and distinguished Devs,
As an entry level of Django, I'd like to ask your confirmation and advice about my project.
So I've to reproduce a website made with PHP, a simple website that represents a number of vacation apartments for rent, without possiblity to interact with the website, because the reservation side is run by another third-party portal.
So I have to remake the website, making an admin for uploading apartments details and photos etc...
The question is:
do I have to create one model for all these details ?
(apartment_name, description, area, max_persons, address.)
Only this approach comes to my mind for now, as there's no other activities to assign.
I might add blog section, so I could add another model I think.
What do you think? Which approach is appropriate in my case and if someone suggests something more interesting or maybe more appropriate to this project aspects.
Thank you in advance!!!
Highly appreciate any feedback
Raymond
Dear friends and distinguished Devs,
As an entry level of Django, I'd like to ask your confirmation and advice about my project.
So I've to reproduce a website made with PHP, a simple website that represents a number of vacation apartments for rent, without possiblity to interact with the website, because the reservation side is run by another third-party portal.
So I have to remake the website, making an admin for uploading apartments details and photos etc...
The question is:
do I have to create one model for all these details ?
(apartment_name, description, area, max_persons, address.)
Only this approach comes to my mind for now, as there's no other activities to assign.
I might add blog section, so I could add another model I think.
What do you think? Which approach is appropriate in my case and if someone suggests something more interesting or maybe more appropriate to this project aspects.
Thank you in advance!!!
Highly appreciate any feedback
I think you have to create a few models here...
1) apartment model, with fields for describing each apartment and number of rooms etc
2) room model, with apartment-Id as foreign key, with room description, pictures, etc
3) blog model, maybe each blog article can be linked to an apartment...
One model I think would limit your ability to extend the application adequately in future
E
HELP
Hello, i have a task (read below) but don't understand what websocket have to do.
I made this: views.py set_cookie for new user and save it to db.json, react-admin show this data from json. as I understood, the websocket should monitor when the user connects and disconnects and it should delete his data from db.json. But in websocket I can't get cookie, so i couldn't delete this user from db.json.
TASK:
Solution consists of 3 components, which are connected with each other:
1. Simple website with several pages, theme/style is up to you. End-user gets its own id number, which is stored in cookie. For each web page visiting, information of {end_user_id, web_page_url} is sent to a server (second component).
2. Server gets the information from the first component and sent this information to the third component.
3. Admin website, which gets the information from the Server {end_user_id, web_page_url} and list this information grouped by end_user_id. It is up to you how to present the information.
My consumers.py
class MyAsyncWebsocketConsumer(AsyncWebsocketConsumer):
async def connect(self):
await self.accept()
async def receive(self, text_data=None, bytes_data=None):
pass
async def disconnect(self, close_code):
pass
My views.py
def index(request):
response = render(request, 'app/index.html')
response.set_cookie('user_id', '5') # not real, just for testing
return response
E
sorry, above is not all task:
+
1. Communication between second and third component is done via websocket.
2. Admin website is build using React Admin library
Oraz
Muflone
Ravi
Denilson
Good afternoon, I'm trying to use try/except to test the data, but I'm having some difficulty.
It always shows the following errors:
If the user already has registered data:
The DadosPaciente could not be changed because the data didn't validate.
If the user does not have registered data:
The DadosPaciente could not be created because the data didn't validate.
Someone already have this problem?
I already tried
if form.is_valid():
form.save()
But, doesn't word
https://gist.github.com/DenilsonRBatista/d81bc55fc2a2278fe20a6448d6e5f048
👑 Dharmzeey
👑 Dharmzeey
Denilson
I don't understand
I have 2 model’s, PacienteCreate and DadosPacienteCreate.
First, I create the paciente and after I alocate the DadosPaciente.
So, I want to use the same button to create DadosPaciente or edit DadosPaciente.
For this, I’m trying using “try/exception”
Denilson
Джонни
ModuleNotFoundError
Fan / Ac
Hi, when there is collisions in migrations do you try to fix it using python manage.py makemigraions --merge ??
or is there a better way(without manual renaming of migrations file) ??
https://www.algotech.solutions/blog/python/django-migrations-and-how-to-manage-conflicts/
https://adamj.eu/tech/2020/12/10/introducing-django-linear-migrations/