Anonymous
duh..
Bhadrinath
Hi, I provided following policies to the IAM user 1. AdministratorAccess-AWSElasticBeanstalk 2. AWSCodeDeployRole 3. AWSCodeDeployFullAccess But still I am facing the following error ERROR: NotAuthorizedError - Operation Denied. User: arn:aws:iam::XXXXX:user/YYYY is not authorized to perform: elasticbeanstalk:CreateApplication on resource: arn:aws:elasticbeanstalk:us-west-2:ZZZZZ:application/django-tutorial Can anyone help me with this?
Njain
def increment_invoice_number(): last_invoice = Invoice.objects.all().order_by('id').last() if not last_invoice: return 'MAG0001' invoice_no = last_invoice.invoice_no invoice_int = int(invoice_no.split('MAG')[-1]) width = 4 new_invoice_int = invoice_int + 1 formatted = (width - len(str(new_invoice_int))) * "0" + str(new_invoice_int) new_invoice_no = 'MAG' + str(formatted) return new_invoice_no class Invoice(models.Model): invoice_no = models.CharField(max_length = 500, default = increment_invoice_number, null = True, blank = True)
Mirco
!ot
Doragonsureiyā
Looks like you need an offtopic group, please continue this conversation at @pythonofftopic as it's not related to Python
Piyush
Django not loading static files if DEBUG= False
Yes I m also facing the same problem.
Roshan
Django dont allow loading static files when debug is False
Roshan
Then what is the solution?
I got this On stackoverflow
Roshan
With debug turned off Django won't handle static files for you any more - your production web server (Apache o r something) should take care of that
Piyush
Send me the link
.
https://stackoverflow.com/questions/67748775/django-ajax-like-button-with-css-classes
.
can someone please take a look at my query
ma
CommandError: You have not set ASGI_APPLICATION, which is needed to run the server.
ma
??
Anonymous
Then what is the solution?
Use whitenoise It will help you serve static files from static root in production mode
Anonymous
I'm trying to deploy Django app in Heroku, but getting below error-
Anonymous
Compiled slug size: 542.5M is too large (max is 500M). remote: ! See: http://devcenter.heroku.com/articles/slug-size remote: remote: ! Push failed
Anonymous
Could anyone help Please?
Infinite
Can anyone suggest some free hosting for my django website?
Anonymous
I tried below command but did not work for me heroku plugins:install heroku-builds heroku builds:cache:purge
Anonymous
Can anyone suggest some free hosting for my django website?
You can try Heroku and Pythonanywhere for hosting
Infinite
You can try Heroku and Pythonanywhere for hosting
Will my database persist on Heroku? I'm using sqlite3 as a database
Anonymous
yes
Infinite
Thanks :)
Infinite
No. U need to use postgres
I suspected that. Anyway thanks :)
Sourav
I am integrating elastic search with DRF. Getting connection issue while building indexes... Urllib3 connection issue..?😔
Almaz
Hello everyone. I have a question regarding user photos in Django production. There is a way to serve it using Nginx, but then there is a security problem. One can easily change a link a get others' photos. Seems like it is better to server images through Django. So, I configured Nginx to proxy "/user_images" requests to Django, but it does not work at all. Django is able to handle images only when debug mode is on. Can anyone give a hint or a link to a good tutorial?
Nakul
Hey any project suggestions for django learning !
Slawa
Hey any project suggestions for django learning !
Do a clone of any web application you like
Slawa
Thank you!
If you don’t want to work with Amazon - Minio is a good self hosted alternative
.
hello, I have the following the condition on my template: {% if request.user.id in Hasliked %} <button id="likeBtn{{ i.id }}" class="likeClassBtn colorRed"> <i class="fas fa-heart"></i> </button> {% endif %} {% if request.user.id in Hasnotliked %} <button id="likeBtn{{ i.id }}" class="likeClassBtn"> <i class="fas fa-heart"></i> </button> {% endif %} where Hasliked and Hasnotliked are two different tuples passed as context with values [1,2] and [2] resp., but the request.user.id is 1. For some reason, Im not able to see the button in second condition, is there anything wrong with the conditions?
Alex
Hey there. How can how can I query pagination using numbers of the page instead of next and previous button on Django rest framework. Cheers
Bharathwajan
Use signals
thank you so much bro , that worked i took many days to study about it but that time worth it
Alex
page_obj.number i guess for current page.
Actually this works in Django Paginator but in rest it’s different :(
whatsinaname
What could be some good django projects of intermediate level for resume?
卐 𐎷𐏃𐎼𐎠𐎴 卐
Hi I use two database (postgresql,mongodb) for project and I want store all objects postgresql model to Mongo dB but give error
Master of None
Екатерина
Can anyone recommend a good YouTube tutorial or a good pdf to learn Django??
Macurrent
why is it that every tutorial i find for teaching django i just see them using bootsrap and not materialize css
Екатерина
🙏🙏 thanks
Macurrent
Because bootstrap is a lot more easier😅
But materialize is better than bootsrap right
Anonymous
Heroku
أ.صفاء
Hello , does any of you have an experience gantt chart?
Anonymous
Hello, Can anyone help me for triggering a mail for maintenance update(alert mail) on particular date and the date will fetch from the database of django. (Not by filling a form, it should auto send on the date which was fetched from database) It's urgent, please help
Manuel
how can I show a validation Error on the model on the template
Prakhar de
1. I'm facing trouble while serving my static files. 2. The JavaScript is working fine, 3. But the css, even the online Css does not affect the Template 4. Any help will be greatly appreciated.
Crack
How to get user data by using default jwt get token
Bharathwajan
why is it that every tutorial i find for teaching django i just see them using bootsrap and not materialize css
that was more easier to use i came to django from ML background with knowing anything in front end development but now i am working on a django project,all credits go to the my projects template owner and bootstrap
Macurrent
So all of you guys don't use materialize css
Macurrent
I use
https://bootstrapshuffle.com/classes/text/font-weight-bold
Macurrent
https://bootstrapshuffle.com/classes/text/font-weight-bold
Is there anything like this for materialize css users??
Macurrent
You want to use external css?
from bootsrap, it seems they did not use any css for that, and it was very easy though
Macurrent
<p class="font-weight-bold">Bold text.</p> They just used this 👆🏽
Fazel
<p class="font-weight-bold">Bold text.</p> They just used this 👆🏽
You have to link some css and js first Get start from here https://getbootstrap.com/docs/4.0/getting-started/introduction/
Macurrent
Maybe i need to learn bootsrap first then go to materialize css later.
Wishmaster
I need some help. I am using django-select2. I have define a form with a foreignkey field using the widget ModelSelect2Widget. I need to know how to change the value of that field using javascript. More info here: https://stackoverflow.com/questions/67732253/how-to-set-value-to-django-select2-field-programmatically-on-button-click-usin
Kashif
BHARATHIDASAN
Guys,in my system django is not running properly, if I run one web application django project folder, it shows the output in the website but the alignment is not in the proper way. And I checked that same project folder in another system there it's running properly. But I don't know why it is not run properly in my laptop..😔😔😟 SOMEBODY HELP ME GUYS...
BHARATHIDASAN
I'm working on the software vs code and pycharm
Javohir
hi guys, Im trying to display an image on my page but the image is not visible. However the other fields are displayed