Mirco
There's an entire topic about deploying
Martín
https://docs.djangoproject.com/en/2.2/howto/deployment/
this, right?
m0nte cr1st0
Hello. Help, pls
https://stackoverflow.com/q/59694061/11214129
Batman
Anonymous
Martín
right now I'm reading the docs
Batman
Batman
m0nte cr1st0
Martín
I will probably try, because I will test locally with some people I know, but I don't want any warning like "This web is not secure" showing up
Martín
But I'm with deployment issues first
Mirco
Mirco
Anonymous
Write a Django based web server to parse a user request (POST), and write it to a CSV file.
Anonymous
Please help
Mirco
Martín
Martín
But that's already taken care of with cookiecutter-django
The thing is that in some views I'm building paths over my URL all the time. There I need the scheme, and I would prefer not to inspect the request all the time
Martín
Mmmmh, I feel like I will end putting the https in production.py
Martín
Hardcoding the scheme there
Mirco
Martín
Can I omit the scheme?
Mirco
Martín
Maybe I'm doing stupid stuff just because I'm ignorant
Anonymous
Martín
Oh, I also forgot I'm using the same SERVER_URL variable for tests, that's another reason when using TDD
Martín
But I could use different variables in tests
Martín
m0nte cr1st0
m0nte cr1st0
thnx
Anonymous
welcome
Yash
I am working with openpyxl lib to edit excel file in django. I am using this method to save the file. But how can I convert this to pdf and export it back to user?
Anonymous
Hello) For example, I need to take after authorization on another site to take the name of his products that he has in the basket of goods on his authorization account) How to do this? Well, or other information
Aditya
Hello from my Django page it's not going to admin page it's showing error what need to be done
Mirco
Aditya
Mirco
AJ
Anonymous
Hi
I had a error in my project, as I am a beginner with dev Django, I went to read the manual. But I remained a little confused. In my case I have the models called Clients and Hosts.
Every Host belongs to a Client, so I added the id_client field as a foreign key, in the Host table, in the templates when I have to access the client name through the Host table do so for example: {{host.id_client.name}}.
But when I was learning and trying to implement CRUD + AJAX on my project, when trying to create a new Hosts model record, I had to use id_client_id, for function "create ()" ...
In the Models documentation, I found the paragraph "Database Representation" that says Django adds "_id", but would you like to understand if this is editable? Or should you rename the column FK?
My models:
class Clients(models.Model):
id_client = models.BigIntegerField(primary_key=True, blank=True)
...
class Hosts(models.Model):
id_host = models.BigIntegerField(primary_key=True)
id_client = models.ForeignKey('Clients', models.DO_NOTHING, db_column='id_client', related_name='host_client_id')
...
obj = Hosts.objects.create(
id_client_id=id_client,
<others fields>
)
PV
Jorge Luis
Hi
I had a error in my project, as I am a beginner with dev Django, I went to read the manual. But I remained a little confused. In my case I have the models called Clients and Hosts.
Every Host belongs to a Client, so I added the id_client field as a foreign key, in the Host table, in the templates when I have to access the client name through the Host table do so for example: {{host.id_client.name}}.
But when I was learning and trying to implement CRUD + AJAX on my project, when trying to create a new Hosts model record, I had to use id_client_id, for function "create ()" ...
In the Models documentation, I found the paragraph "Database Representation" that says Django adds "_id", but would you like to understand if this is editable? Or should you rename the column FK?
My models:
class Clients(models.Model):
id_client = models.BigIntegerField(primary_key=True, blank=True)
...
class Hosts(models.Model):
id_host = models.BigIntegerField(primary_key=True)
id_client = models.ForeignKey('Clients', models.DO_NOTHING, db_column='id_client', related_name='host_client_id')
...
obj = Hosts.objects.create(
id_client_id=id_client,
<others fields>
)
A tip, Django assigns a field ID automatically to the models
Aditya
مــا
Hello everyone. I'm considering Django as the backend of my Vue.js application, because I need to do some text processing on file uploads and python can be good for that. I am starting to learn Django but I thought perhaps somebody in this group could give me some guidance so that I don't beat about the bush too much.
مــا
I think I can write all the frontend in Vue.js, then what I need to do in the backend is just to process the files the user uploads and as a result to insert some data in a database. My concrete question is: Would I need to use Django for that, or just Django Rest Framework is enough?
Anonymous
A tip, Django assigns a field ID automatically to the models
I read this in the documentation, but the database already existed. I had to declare the PK's in the models. What I haven't really learned yet is how to make django stop waiting for this "_id" for FK. This is possible?
PV
form.save(commit=false)
process data here then
form.save
PV
For example
if form.is_valid():
data = form.save(commit=False) data.creator = request.user data.updater = request.user data.auto_id = get_auto_id(Customer) data.save()
PV
If anyone doesn't got solution after 24 hour of posting questions, ping me, i will help you
PV
Anonymous
can anyone tell me how to render pdf files in templates
Sweetie
Any django template available to build something like this website:
https://shoppy.gg/
Yash
i have too much data with same value in database and i want to show only one time that who have a exact same value so how i do that like same name shows only one time when i retrieve data
Yash
Batman
Damron
Hi guys!
Can someone give advise about working in team between backender and frontender?
We don't know how to frontender to make render of site without waiting for backend end their work?
I mean we are going to make site, and it's a big problem to communicate frontenders and backenders.
My question may be not so understandable)
Mirco
maroong
Cesar
Anonymous
Hi. The task is this. Suppose I want to add subheadings to the chapter from the admin panel. Initially, I do not know how many of them. And with each addition to the admin panel, a new field should appear. That is, initially one thing, if I fill it out, the following will appear, etc.
Sweetie
How to make django restframework to work with api keys so users can consume service like:
/endpoint?token=xxxxxxxxxxx&foo=bar
Mirco
⟨ Simon |
Mirco
Sweetie
Token passed via get parameters ?!
Use headers!
See TokenAuthentication class
I don't want to use Authorisation headers that makes it complex for user to consume api.
I want them to easily consume api from anywhere.
example.com/endpoint?token=xxxxxxx&foo=bar
The header auth make it hard to consume api for non programmers.
My api should be callable from browsers directly
⟨ Simon |
Mirco
Mirco
Sweetie
I just want to know if django restframework allows to do that or I have to create a token model and generate token for users and authenticate them by comparing the received token all in my code.
Mirco