Luis
thanks
cj
ok I'll try it without gunicorn
anyway, if you want to run your project in "production mode", whether you're using nginx or apache or any other web server, you should rely on an application server like gunicorn or any other one, don't run your project with runserver if you want to deploy it to the wild internet
cj
I do want to deploy it to the internet
then use an application server like gunicorn, it doesn't matter if you use nginx or apache
Luis
can it work without a domain for now?
cj
can it work without a domain for now?
yes, if you have a public IP
cj
just make sure to register that public IP in ALLOWED_HOSTS constant
Luis
I will, thanks
Alex
I do want to deploy it to the internet
I will suggest use docker on local then deploy docker itself
Hamza
I need a python list has name of cities in Saudi Arabia in Arabic language
Hamza
Where can I get it ?
Alex
I need a python list has name of cities in Saudi Arabia in Arabic language
create a txt file or db with all names and import it in code.
Dipanshu Vora
Is there any solution to transfer all the data from one django admin to another??
Dipanshu Vora
I want all the data of it
Mirco
I want all the data of it
dump db and inject in a new one
Mirco
all data u see in admin is all data u have in db
Mirco
it can be useful for other people
Dipanshu Vora
But that one is giving me an error and the error is data already exists so what the solution for that
Mirco
But that one is giving me an error and the error is data already exists so what the solution for that
you have to migrate that data in a fresh db otherwise it's normal u have that error
Dipanshu Vora
you have to migrate that data in a fresh db otherwise it's normal u have that error
Yess that i have done it but is there any solution if i have the existing data and if i import the one which is already present are ignored and rest are transferred???
Mirco
Yess that i have done it but is there any solution if i have the existing data and if i import the one which is already present are ignored and rest are transferred???
yes, I don't remember right now the command but if u use Postgres u can ignore already existing data conflicts
Dipanshu Vora
Yes i am using postgres in that also i got the same error as data already exists
Mirco
Dipanshu Vora
Okk thank you
Hasan
hi why my set-cookie header doesn't set any cookie for me? I'm using django-rest and dj-rest-ath for authentication and react & nextjs for front end
cj
hi why my set-cookie header doesn't set any cookie for me? I'm using django-rest and dj-rest-ath for authentication and react & nextjs for front end
because REST doesn't rely on cookies ¯\_(ツ)_/¯ that's not how an REST API should work, it relies on tokens instead
Mirco
cj
actually I want to store my tokens in cookie
then that's a frontend job, nothing to do with django-rest
Hasan
I hope they are HttpOnly ones
they are httpOnly samesite:none secure
Hasan
then that's a frontend job, nothing to do with django-rest
no the best way is set cookies with backend if I want to store tokens with frontend, these can't be httpOnly so are not secure if this is frontend job so why Django send set-cookie headers?
cj
what do you mean?🥲
you're using django-rest, so you're building a REST API, right? so the idea of a REST API is that the clients are any kind of app that can make a request to your API, so they are not necessarily a web-browser app, so there must be clients that don't manage cookies ¯\_(ツ)_/¯ so wanting to use cookies in a REST API is adding a very complex and inconvenient layer to your app
Hasan
no it's a frontend job and must use HttpOnly cookies otherwise don't use cookies at all 😅
I'm using Django for my own projects in the company that I work in, the bacedn is Laravel and we do that like this🤔 we don't store cookies manually and the Laravel set it for me🤔
cj
oh👌 therefoe the best way is set cookies manually and send it automatically by withCrentional:True??
the best way to work with a REST API is not to rely on cookies at all ¯\_(ツ)_/¯ if you want, you can manage the cookies in your frontend web-app and send the values you want to the API using headers or query params ¯\_(ツ)_/¯ that's how you should work with an API... forget about cookies when working with an API
Mirco
oh👌 therefoe the best way is set cookies manually and send it automatically by withCrentional:True??
https://www.youtube.com/watch?v=_BZ_LtAyfSk see this playlist and everything will be clearer
Unknown
Someone tell me how to used and learnt the restframe in django
Doragonsureiyā
Someone tell me how to used and learnt the restframe in django
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Unknown
Is there any tutorial
cj
Is there any tutorial
can't you read the message above?
Unknown
can't you read the message above?
I just want lecture in easy way to learnt
Никайтос
Hi, how can I multiply two ModelFields? Because Django tells me neither IntegerField nor DecimalField has no mul method or smt like that
Никита
There is a problem with deploying to the server: run gunicorn gunicorn --bind 0.0.0.0:8000 berlinfest.wsgi but nginx says that the port is busy, I remove the gunicorn, nginx does not work) Ubuntu 20, anyone tell me how to fix it?
Sukhmanjeet
I am making an Instagram clone. I am adding data to the database. It is even getting added. I can see through admin url but it is not displaying the data on the user login session. What should i check?
codec
show your code
Daniyal4Real
how to send image if it is not allowed?
cj
how to send image if it is not allowed?
why do you want to send an image?
cj
Isn't it obvious?
to show his ugly face?
Neo
no
Neo
TO BE BANNED
cj
no
your face?
cj
TO BE BANNED
it's enough by his name for that
Neo
Well i suppose we must dispose of individuals that name themselves after sub-par boy bands
Law
Some Vue js course that you share
Sanjarbek
Hello everyone. friends I put one project on the server, but when I worked in the local, the server did not work. the site has been run through docker
Mohd Hanafee
Hi , anyone know how to pass data value id in the datalist instead of data text? Example 1. John 2. Alex 3. Michelle I want to display name in the datalist but send the value number to django view function
Mohd Hanafee
tq @TRAXCUTTER , but i want use search text like auto complete . data is big. not very good using html select tag
Mohd Hanafee
Use tag to html
Thanks @Is_mmli , can u share example?
Rishabh
How can I get rid of segmentation fault error(django). Happens when I run any kind of test in my venv ?
Rishabh
any help will be appreciated
JHIN
Can someone help me with as_crispy_field error
Doragonsureiyā
Can someone help me with as_crispy_field error
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Rishabh
No
Muhammad Amin
Hello, the question is the url http://127.0.0.1:8000/categories which is attached to one view and I want to continue the same url like this http://127.0.0.1:8000/categories/programming/ and provide all the books from this category but with a different view and model, and when the user has selected a book from this category, then continue this url like this http://127.0.0.1:8000/categories/programming/django (which will return all django books), and then http://127.0.0.1:8000/categories/programming/django/django-for-beginners (i.e. detailed page), how can this be done?
Shugaba
Hello, the question is the url http://127.0.0.1:8000/categories which is attached to one view and I want to continue the same url like this http://127.0.0.1:8000/categories/programming/ and provide all the books from this category but with a different view and model, and when the user has selected a book from this category, then continue this url like this http://127.0.0.1:8000/categories/programming/django (which will return all django books), and then http://127.0.0.1:8000/categories/programming/django/django-for-beginners (i.e. detailed page), how can this be done?
If you want to implement such, you will need dynamic urls. In your urlpatterns you can add: path("categories/<str:category>/<str:framework>/<str:item>", YourView.as_view()) for the url: categories/programming/django/django-for-beginners . You can then perform filter like Piyush said with the values. Note: The values for the dynamic urls wil be available in **kwargs of the method/ function of your view..
Sukhmanjeet
You need to add permission to users
Oh yes. Let me try. Thank you much!!
VAIBHAV
Hello 👋, I've a Django doubt.
VAIBHAV
Here's what I wanted to know Well thanks for this but my doubt is different, I've a question that I had created a web app using Django. This was a CRUD web app but I want is , how can I implement multiple create and multiple delete features? As you may have seen django admin panel and what we do to delete is just checking checkbox of data to be deleted and then select action to delete and click on go. That's something similar I want to do but for bulk create I want to have a button for adding more inputs or just a first input where user can tell no of inputs and then those input fields will be generated with a single submit button so that if user has filled all the fields then user can submit all the data by clicking on that single submit button. And bulk deleting kinda similar with django admin panel bulk delete feature.