Anonymous
See the documentation for WhiteNoise. Adding whitnoise to the middlewares solved the static file problems for me along with adding a separate STATIC_ROOT path in settings.py http://whitenoise.evans.io/en/stable/
Anonymous
Also, just a heads up that if your project uses media files, it will not load in production if you're using heroku. You need to host your media files separately. I wanted to avoid using Amazon S3 or similar services as they are not free.
Anonymous
I'am using sb-admin-2 template of bootstrap. . when I'am deploying the app. . the server cant find the sb-admin-2.css and .js. . have you encountered this kind of error?. .
Also, try manually running the command 'python manage.py collectstatic' and see if that solves the problem. Heroku actually does this automatically for us though.
Anonymous
OMG, im using media files, is there any free host for this media files?. .
I think Amazon S3 is free for first 12 months but need to confirm it from their website. I want to try and use Google Drive to host both my static and media files. Also raised a question on Stackoverflow for it. Someone suggested a library but it didn't work for me. Its documentation also doesn't really explain much. https://stackoverflow.com/questions/59254707/how-to-use-google-drive-to-save-media-files-for-a-django-app-that-is-deployed-in/59255729#59255729
Anonymous
try share your full error traceback
Sorry I missed responding to this. This is the error message I get. smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. Learn more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError g9sm1439845pfm.150 - gsmtp', '<my email id>')
Aswath
Dudes....
Aswath
how can i ask the user for his image, phone number and some id proof on sign up. i mean he/she could only complete the signup if they provide all the mentioned fields
Aswath
how might i go about doing that guys
Aswath
please let me know
Aswath
Anyone there ????
John
question guys, for example I have two projects. . Is it good that both of my projects have the same secret_keys which is stored in my bash? or it should be different? . .
Tanjiro
Have anyone worked a Django app that has single sign on with Microsoft active directory?
Anonymous
Okay, thank you so much for sharing this idea. Thanks much mate! 😄
Well if you're able to figure out how to handle media files, let me know too.. I am still looking out for completely free solutions.. 😅
John
Well if you're able to figure out how to handle media files, let me know too.. I am still looking out for completely free solutions.. 😅
I havent tried yet but I think my solution at this moment for that is to put all my media files in static directory, i'll just create a folder in replace of that media folder, still didnt know if it will work but i'll inform you once its good. . 😄
Anonymous
yoo answer please
Make Fields as Required
Anonymous
In your html input tag use required
Anonymous
When he/she submit the form with empty fields it will gives error msg on that filed as "This Field is Require"
Kiro
halo
Kiro
i have question
Kiro
i have php script for($i=29; $i >= 0; $i--){ $total = array(); $query = "SELECT total FROM orders where DATE_FORMAT(created_at,'%Y-%m-%d') = DATE_ADD(CURDATE(), INTERVAL -$i DAY"; $que = mysqli_query($koneksi, $query) or die(mysqli_error($koneksi)); $count = mysqli_num_rows($que); if($count == 0){ $total [] = 0; }else{ while($res = mysqli_fetch_array($que)){ $total[] = $res['total']; } } ${'totalcostpart' . $kodepart}[] = number_format(array_sum($total),2,".",""); } i wanna convert that to python but always fail i try this for i in range(30, 0, -1): cursor = connection.cursor() #Cursor could be a normal cursor or dict cursor query = cursor.execute("SELECT total FROM orders where DATE_FORMAT(created_at,'%Y-%m-%d') = DATE_ADD(CURDATE(), INTERVAL -%i DAY",i) data = query.fetchall
Kiro
Its not related to django
i wanna convert to django script
Anonymous
i wanna convert to django script
Ok wait untill someone else may help you
Kiro
oof wrong territory
pardon me sir i dunno i just wanna convert my php script to python(django)
Zaryab
DJANGIO Problem: Trying to build a monthly expanse record website where each user can store the money spent by them in the project in a month. So we have 3 records name, amount spent, and the stuff bought. ISSUE: I want to add all the money spent by one particular user in a month. How can I do that??? Please HELP.
d3vsh3d
Hello. New here!!
Eric
Here's a quick example of what might work: https://dpaste.org/OCwh
Zaryab Whoops, you'll need to replace "for record in e_total:" with "for record in e_thismonth:" on line 10
Anonymous
Template does not exist in django, What I should do?
Anonymous
I have two django projects, one mysite and one account. I want to import the urls account to mysite so that later mysite can access the account, how do I do that please help me
Anonymous
Template does not exist in django, What I should do?
please check the location of the error below available
Anonymous
Template does not exist in django, What I should do?
In settings.py file TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['templates', ] Make sure that you have 'templates' in DIRS list and templates folder in you Project where manage.py exists.
Anonymous
I want to connect it,
Anonymous
2 projects
I don't know... Wait for someone else's reply
Anonymous
Omg
Anonymous
Thank you
d3vsh3d
Has anyone ever use twilio in sending multimedia content?
Way
Good afternoon, chat. I can not agree with myself. Task: Users are registered on the site, users can purchase tariffs of different categories. With these rates, they can register their companies. Tariffs show the number of companies. for example Tariff1 - can register 1 company Tariff2 - can register 3 companies How can I describe the tariffs and where to describe the restrictions?
Anonymous
Anybody having django PDF please send ..
Doragonsureiyā
Anybody having django PDF please send ..
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
WhiteDevil
Hello All - I am not able to install gunicorn 19.9.0
WhiteDevil
Can somebody help please,m
Anonymous
Hello All - I am not able to install gunicorn 19.9.0
There is a newer version. Have you tried installing it?
Mirco
Mirco
Django for APIs
Orack
The one of William Vincent
wew not much thick
Orack
The one of William Vincent
this also doesnt have nested serializers ;_;
Orack
can any share 1 sample and how to send postman request for it
WhiteDevil
There is a newer version. Have you tried installing it?
I tired installing the latest version I am still facing the same error
WhiteDevil
pipenv install guincorn==20.0.4
Mirco
this also doesnt have nested serializers ;_;
nested serializers are on official docs
Orack
nested serializers are on official docs
I have them, but docs dont show how the request is sent using httpie/postman
Rohan
Are you using viewset and configured a router?
Hermann
I have a project written in python2, I have to import it to django, the script in python after it has been executed takes keyboard input. do you know recommend me some tutorials ?.
Alex
I have a project written in python2, I have to import it to django, the script in python after it has been executed takes keyboard input. do you know recommend me some tutorials ?.
You mean you wanna have a form to replace your keyboard input? You'll have to modify your script and place it in a view or connect it
WhiteDevil
Anybody have used Django for beginners book from Wincent
Doragonsureiyā
Anybody have used Django for beginners book from Wincent
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Orack
no routers, GenericAPIView
class AView(GenericAPIView): serializer_class = Aserializer parser_classes = (MultiPartParser, JSONParser) def post(self, request,*args,**kwargs): try: serializer = Aserializer(data=request.data) if serializer.is_valid(): serializer.save() data =serializer.data return Response(data,status=status.HTTP_201_CREATED)
Orack
just serializer.save() inside views
Денис
Anybody have used Django for beginners book from Wincent
you've drawn a lot of attention and don't even ask anything. Why?
WhiteDevil
I am following the book and learning
WhiteDevil
While going through some of the steps I am facing error