Dennoh
<a href="{% url 'i' %}"><h3>POLLS</h3></a>
Just <a href="{% url 'index' %}"><h3>POLLS</h3></a> doesn't work?
Anonymous
i made it correct by using namespace
Anonymous
i dont know whether it is the right way to do
Anonymous
but it worked
Dennoh
Dennoh
but it worked
Yeah it is it makes sense
Omar M.
hi guys
Omar M.
I need awsome django book for beginners
Omar M.
plz
Omar M.
high recommend book
Doragonsureiyā
high recommend book
Check out PythonRes, a channel for Python resources (links to help you out).
Abhishek
.I have this model that users can log in to the site and add their posts and all posts are displayed in home. At the same time I want the posts by the user to be displayed in user profile.
Maksim
And?
Fedor
Hey everyone. Im stucked with a problem. I have 2 djagno servers communicating between each other. I realized that when i am runnin second server with uwsgi it respond with 500, but when i run it just via python manage.py runserver it respond with 200. Does anyone know whats the problem? Can uwsgi restrict requests?
Ori
Your set up is probably not correct
Fedor
Yeah I have checked them. But i did not found answer on question «what restricts my requests» there
Fedor
Your set up is probably not correct
But what can be incorrect? uwsgi set up?
Ori
Logs usually contain what went wrong
Fedor
Yeah, but uwsgi log does not have my request at all, server just respond with 500. But when i turned off uwsgi it worked good.
Fedor
Logs usually contain what went wrong
It just ignored my request, but first serevr got 500.
Ori
uwsgi is not easy to set up. It's not as easy as running runserver. So it's not ignoring your requests, it's probably can't serve them because of configuration error.
Fedor
@chomuchomu but it can’t serve some requests from server. All the requests from users and other requests from server are handled good.
Ori
Do you have anything else running in front of uwsgi? Like nginx?
Fedor
Do you have anything else running in front of uwsgi? Like nginx?
Yeah I do. But it’s not nginx because I ran manage.py runserver on the port that is listened by nginx. And it worked.
Anders (izzno / gooood) 🇳🇴
Yeah I do. But it’s not nginx because I ran manage.py runserver on the port that is listened by nginx. And it worked.
You need to paste your startupcommands / setup in a pastebin ish place and let us see. Then we can help you. Otherwise its 3461 people looking at a flat tire wondering how it happened...
Fedor
Here is my uwsgi.ini file: [uwsgi] # Variables project_dir = /srv/www/ld-v3 # Configuration plugins = python36u pythonpath = %(project_dir) virtualenv = %(project_dir)/python socket = %(project_dir)/tmp/%n.sock wsgi-file = %(project_dir)/repo/%n/wsgi/django.wsgi touch-reload = %(project_dir)/repo/%n/django.wsgi logto = %(project_dir)/logs/uwsgi-%n.log ignore-sigpipe = true ignore-write-errors = true disable-write-exception = true buffer-size = 32768 env = LANG=en_US.utf8 env = LC_ALL=en_US.UTF-8 env = LC_LANG=en_US.UTF-8
Suicide Liza
hello
Suicide Liza
i have an issue
Suicide Liza
can somebody help me? i deploy django and try to connect from localhost:3000 and the django api is on ip 157.XX.XX.XX but it returns always 404 on any request
Suicide Liza
can somebody help me to figure it out react client side
Suicide Liza
i will appreciate any help
Suicide Liza
i am not backend developer can you tell me where to see them?
cj
i am not backend developer can you tell me where to see them?
depends where you set them to be 🤷‍♂️
Suicide Liza
back | Not Found: /api/userdetails/ back | [2019/08/14 21:39:05] HTTP GET /api/userdetails/ 404 [0.01, 172.19.0.2:41150]
Suicide Liza
this?
Suicide Liza
just i want somehow make django api not only allow same-origin but also localhost
Suicide Liza
same origin works well
cj
if the second, you need to manage CORS thingy
godmode
hi guys again, i'm new in django classes, and i want to know what class can ii use for make a post_detail in a blog, this post detail got a comentary form ... should i use DetailView... in that case how do you do to pass the slug? and you know any info?
Suicide Liza
are you using DRF? or just pure Django?
settings is ALLOWED_HOSTS = ['*'] CORS_ORIGIN_ALLOW_ALL = True
Suicide Liza
maybe also need to check nginx?
Chowdary
hi guys again, i'm new in django classes, and i want to know what class can ii use for make a post_detail in a blog, this post detail got a comentary form ... should i use DetailView... in that case how do you do to pass the slug? and you know any info?
DetailView import it from generic views... Here is the code sample code class YourModelDetailView(DetailView): model=YourModelName template_name= "templates/templatename"
Chowdary
And you need not pass any slug here
Chowdary
It will automatically get it from the absolute url method which is on your model, and in urls you have to mention the slug
Chowdary
Welcome brother
Aaron
For some reason when I add something to requirements.txt, even though the pip -r requirements.txt succeeds and claims it installed it, when I try to include it I get an error that it can't be found.
Aaron
Consistently, no matter what I add. Whether I use pip or pip3.
Aaron
Can anyone help?
$whoami
3
Aaron
Turns out I needed to add —build to my docker-compose up command
Raam Goulikar
Any ideas how to process background tasks like data processing in Django projects
Raam Goulikar
?
Raam Goulikar
I would want something other than celery and should be simple for implementation for POC phase
Paul
Hi! i'm trying to use django-filters with drf. when i'm trying to use filters on decorator action i'm getting local variable 'permission_classes' referenced before assignment response. any advice?
Anonymous
How can we save the average of two different fields in another field?
Lugano
Am sorry,am about to study web application using django framework I was asking if i could use jupiter notebook for this or i should use pycharm?
Lugano
Thanks
Abimbola
Can someone help me on how to implement machine learning model into web app via Django framework
Aaron
I've got a local tunnel running. I'm seeing it being hit: HTTP request from (ip) to (url)
Aaron
but I'm not seeing a log I have in my view for that URL:
Aaron
LOGGER.warning('Hit (url)')
Jimmies San
LOGGER.warning('Hit (url)')
import logging LOGGER = getLogger blabla done this?
Aaron
Yep
Jimmies San
mmmh strange
Aaron
import logging LOGGER = logging.getLogger(__name__)
Jimmies San
change syntax