Роман
bhzad
Hello, good time. Friends, I encountered a problem in Pycharm. When I create a new project and select the interpreter, it encounters a problem when creating the virtual environment. I also searched and tried Site Stacker Flow, but I did not find the desired result. Can you help me? thanks a lot
bhzad
Problem: Failed to create a virtual environment
bhzad
I went through the steps, but the previous problem is still not solved
lilobaje
By going to the official documentation, by reading it.
The recent google update is preventing Django from communicating with Gmail.. So I'm asking for an alternative
zveroboy_
And also make sure that ur in system's directory when ur finding the exe file
zveroboy_
https://youtu.be/YypH4XD_Fmc
Iliya
Hi I've set an env variable in a file let's say a.py and after I want to get that env variable in a file named b.py. I tried to get that variable like below : os.environ.get('pass_var') but it returned None. Why is that ? Is it just available for 'a.py' ?
𝖇𝖎𝖌𝖟𝖟𝖍
you should take a look at the load_dotenv package
𝖇𝖎𝖌𝖟𝖟𝖍
you can use it like that import os from dotenv import load_dotenv load_dotenv() SECRET_KEY = os.getenv("SECRET_KEY")
.
Hi, I have a simple question What skills are required to learn django rest framework ?
Vyacheslav
Can't catch handler404 handler404 = page_not_found (urls) def page_not_found(request, exception): return HttpResponseNotFound('<h1>Not found<h1/>') (view) All seemed to always work, and then it does not work, something has changed, maybe someone has faced?
Rami
you can use it like that import os from dotenv import load_dotenv load_dotenv() SECRET_KEY = os.getenv("SECRET_KEY")
You need to read the variable name from your script in b.py, not the environment variable; that one is already read by a.py assigned to a variable (that variable is the one you need to acces from b.py). I hope it’s understandable 😅
Vyacheslav
Sorry
Саша
Hi guys!
Саша
who made the mailing?
Саша
I need to make a newsletter, but I don't know how yet
Саша
google took away the less security program option:(
Саша
And now I don't know how make mailing in google
Hajri azza amina
Hello
Hajri azza amina
Can someone help me create a portfolio builderapp with django
Artyom
And now I don't know how make mailing in google
Is there any chance that you want to create an rss/atom feed?
Artyom
Maybe no
Email newsletter then?
Саша
Yep)
Сергей
google took away the less security program option:(
Doesn't Google just give you an application token for this purpose? This worked literally ten days ago.
Artyom
Yep)
MailChimp
Сергей
Where i can get this token?
https://support.google.com/mail/answer/185833?hl=en I think that's what Idid and it worked.
Сергей
Then just EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com ' EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST_USER =' my email' EMAIL_HOST_PASSWORD = yor_app_password_goes_here
Сергей
Of course there's 500 emails per month limitation for free tier.
부산
Hi guys. I am getting this error SMTP AUTH extension not supported by server When send task using celery in Django. can anybody help me?
𝖇𝖎𝖌𝖟𝖟𝖍
it didn't work
wdym didn't work ?
𝖇𝖎𝖌𝖟𝖟𝖍
you shouldn't use environment variable to change the application state i think
𝖇𝖎𝖌𝖟𝖟𝖍
env aren't made to be changed all the time
Iliya
env aren't made to be changed all the time
ok then I've set this using a python script then I want to read that env variable in other scripts. One time write and multiple times read
Iliya
the thing is you can not read that variable from other python scripts, if you try you will get none
Jay
Can we pass object I'd to the serializer
Nasir Ahmad
Hello, in Django, I have a model in which I store my list of articles and I want to create another model to select 10 articles from my article model and display only these 10. How should I do this?
..
Why not select 10 articles rather than creating another model?
Nasir Ahmad
Well, I wanted to select 10 articles from this model, it doesn't matter in what way, I just have to choose, that is, it must be selected on the admin page.
matrix
hey guys, could you please review this repo and tell me why am i unable to store the data in db.sql
Sahar
Hello everyone. do you use Stripe for your payment system? I have a question about it. Imagine a user is doing different things in our system and for each part, he has to pay. We send these payments to Stripe by calling: stripe.InvoiceItem.create() Then we create and finalize the invoice for him by calling: invoice=stripe.Invoice.create() stripe.Invoice.finalize_invoice(invoice.id) So if the user has to pay for 3 items: item1 = 1 item2 = 2 item3 = 3 The finalize_invoice will have an id, total, ...., and: total = 6 To test if all items are sending the correct amount to Stripe, I have to check the total from Stripe. In order to write unit test for our payment system, I had to mock Stripe, but the Stripe invoice total would always be zero. does Stripe has special way to test it? can you help me?
.
Well, I wanted to select 10 articles from this model, it doesn't matter in what way, I just have to choose, that is, it must be selected on the admin page.
I think you use a ManyToManyField. Put this field in the other model, and let it refer to the article model. That way in the admin page you can select and assign the 10 articles that belong your selection of the other model.
Sahar
What is your mean about total is zero? Total_Amount?
Yes, if I mock Stripe. But I think Stripe has some way for our unit test. For excample Stripe has some test cards. Maybe there is a way to use them.
Charan Cherry
Did anyone of you linked react app with django???
Mirco
Did anyone of you linked react app with django???
Django expose APIs React will consume them
Huzaifa
How can i add boilerplate to django...i installed it through pip and added it to installed apps but it is not showing up in html..
Sahar
The last time that i used stripe there was a fake payment you can test your process that way.
Do you know how can I use it for my unit test? I don't know how. I even asked here: https://stackoverflow.com/questions/74025640/how-mock-stripe-in-django-unit-test/74026460?noredirect=1#comment131020203_74026460
Morteza
and a test public and private key
Holla
am seeing this recurison error that i never saw before
Holla
https://pastebin.com/rRXyJdig
Holla
RecursionError at /admin/europe/trip/add/
spignelon ‌‌‎
Hey, I am currently learning Django, while I was running python manage.py makemigrations I got this error, and I am not able to run migrate or log into admin panel because if this, I have searched a lot on the internet and I found nothing useful. System check identified some issues: WARNINGS: home.Contact: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the HomeConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. No changes detected
Holla
check your models
spignelon ‌‌‎
check your models
Someone sent me: https://stackoverflow.com/questions/66971594/auto-create-primary-key-used-when-not-defining-a-primary-key-type-warning-in-dja Like the warning and the comment suggests, DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' is already added to my settings.py and I have also tried with DEFAULT_AUTO_FIELD='django.db.models.AutoField' but I am getting the same error.
Holla
i never defined primary keys that way
Holla
maybe someone will help
spignelon ‌‌‎
Hmm, thanks
v6nom 『 🅽🆃🅼 』
Hello i have a file view.py in Django and i want to use the variable start_event1 in a other file who name is api.py how i can make ? view.py py def form(request): form_user = Form() if request.method == 'POST': form_user = Form(request.POST) if form_user.is_valid(): start_event1 = form_user.cleaned_data['start_event'] I want this render in api.py py sequence = Sequence(start_event1, "10:10", 2, "Bonjour", 1, "Jean", "2")
부산
Can you share your complete error
The error that I said it completely above