Rohan
Basic Frontend development and Database management.
Carl
hi everyone
Carl
I'm confused about static and media. I'm not sure to understand how to use both in my app, especially the part in urls.py
Carl
should I use static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) or/and static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) in my urls.py? I explained my conf in details at https://www.reddit.com/r/learndjango/comments/9ck3x7/django_static_and_media_im_confused/
Carl
MEDIA and STATIC aren't the same thing
thanks for your answer 😀 Yes I know that's not the same thing, but I actually need both: static for my logo website, css, js and media for the user-uploaded images of my users
Anonymous
Mirco
thanks for your answer 😀 Yes I know that's not the same thing, but I actually need both: static for my logo website, css, js and media for the user-uploaded images of my users
yep but you asked which you should use between static(MEDIA...) or static(STATIC...) you need both to get your goal and the use of static() in your urls.py is for manually serving your static/media when you don't have django.contrib.staticfiles in your INSTALLED_APPS as django docs explains you
Василий
MEDIA_ROOT is directory where saving your media files. MEDIA_URL is url path concatinated with base url. Adding it to url_patterns just make it visible for django webserver router
Anonymous
I looking for a python rimote job if you have it message me ❤️
Django Bot
>> Blogs - python django
Jimmies San
Abilkhaiyr
Hi folks, can you suggest one paas/vps for deploying django app? just very easiest one?
Abhi
for test project ?
Abhi
or for commercial purpose ?
Abilkhaiyr
btw, without docker, I mean, other options?
Jimmies San
take a vps from linode/digitalocean/hetzner
Jimmies San
or use aws if you need to scale
Django Bot
>> Links - wagtail - What is the difference between slugurl and pageurl in wagtil - St
Dcruz
Need a simple example of Ajax on Django
Dcruz
hello??
Charly
Need a simple example of Ajax on Django
have you checked the official documentation?
Charly
or even tried to use google?
Charly
https://hackernoon.com/consume-rest-services-with-ajax-and-csrf-protection-in-django-410ece54690
Dcruz
have you checked the official documentation?
Docs say nothing about simple Ajax..
Dcruz
its really too hard to explain it??
Charly
Have you seen the links?
Charly
(deleted prev message, read wrong)
Dcruz
ñoo, the opposite. simple
Dcruz
too advanced for me right now
Charly
The point is, django itself doesn't care if call was a page render or an AJAX call
Charly
the ajax part matters more int the frontend
Dcruz
ups..
Dcruz
wrong group i guess jajajja
Charly
but really, read the link I just passed
Dcruz
i readed it
Dcruz
+1
Dcruz
I need a JQuery Ajax simple example, i know, its Django only 😁
inchidi
I need a JQuery Ajax simple example, i know, its Django only 😁
this part is simple jquery ajax example, all you need to change is the url if you didnt use django
Anonymous
@login_required(login_url='/accounts/login/') def edit_events(request, id): event = Events.objects.get(id=id) print(event) if request.user.is_authenticated: if event.planner_id == request.user: form = EventsPostForm(request or None, instance=event) if request.method == 'POST' and form.is_valid(): edited_event = form.save(commit=False) edited_event.planner_id = request.user edited_event.save() return redirect('home') else: form = EventsPostForm(request or None, instance=event) return render(request, 'events/events_edit.html', {'form':form})
Anonymous
AttributeError at /events/2/ 'WSGIRequest' object has no attribute 'get'
Anonymous
i keep getting this errors when i call this function please help
inchidi
share full traceback
Anonymous
```
Anonymous
share full traceback
unable to, it automatically deletes on group
inchidi
because you are not using proper code sharing service.
Anonymous
ok thanks
Anonymous
https://dpaste.de/URju
Денис
how get this event get_expire_at_browser_close() ?
inchidi
https://dpaste.de/URju
share your File "C:\Users\FREEDEXTECH\Desktop\OLLY\projects\Web projects\Djangoprojects\faaji\faaji\events\views.py"
Anonymous
Ok
Денис
always check active session is not reasonable If dango deletes a session, then i can access the function. how to find it
Hélio
guys, do you know why this list of elements are not clickable?
Hélio
because i'm trying to select
Hélio
but is not going
Hélio
i'm trying to fix
Hélio
from here
Hélio
http://a-to-mi-co.ml/shop/
Василий
use browser development tool to check nesting in DOM and where going event click
Hélio
right
Hélio
do you know some tutorial?
Django Bot
>> Links - (101) Django Tutorials - YouTube - Your first Django project! · Django Girls Tutorial - Web Development with Django Cookbook - Second Edition | Now just $10 - Django Book: How to Tango with Django: A Python Django Tutorial
Mirco
U r missing parentheses if your goal is a list comprehension
Anonymous
Where is their places?
Василий
Where is their places?
around expression
Anonymous
Combot
Ali _A (0) has increased reputation of Василий Карбовничий (1)
ʚɞÇherry Łoveʚɞ
wrong python version
Mirco
wrong python version
why ? that error message is related to comprehensions imho you mean the difference between py2/py3 print
ʚɞÇherry Łoveʚɞ
some library is not support python3.7 yet.
Mirco
yep, now I understand better what you mean sorry man 😅 I didn't read well the message
Django Bot
>> Blogs - django-registration 3.0