Азатбек
Hi guys . How can I broadcast video from ip cameras?
Azer 🌚
hi guys im new in django, i want in production restart the app for changes.. but i dont find process for that, im tried restart nginx
cj
hi guys im new in django, i want in production restart the app for changes.. but i dont find process for that, im tried restart nginx
restarting nginx doesn't restart django app, how did you start it first? do you have your django process with systemd? or any other manager?
Jimmies San
i not have any ideas i have only nginx config.
check in the config for gunicorn/uwsgi pass, then restart the right component
Jimmies San
kill -HUP $(pidof component)
Jimmies San
nope, inside nginx config
Azer 🌚
nope, inside nginx config
upstream badminton_app_server { server unix:/webapps/badminton/run/badminton.sock fail_timeout=0; }
Azer 🌚
nope, inside nginx config
only that for proxy_pass
Jimmies San
upstream badminton_app_server { server unix:/webapps/badminton/run/badminton.sock fail_timeout=0; }
fail_timeout=0 is a parameter usually reccomended for gunicorn. to be sure, check in the sys process if exists a gunicorn [ps faux | grep gurnicorn]
Jimmies San
kill -HUP $(pidof gunicorn)
Jimmies San
in this way you restart the process
Azer 🌚
kill -HUP $(pidof gunicorn)
that gived me kill usage
Azer 🌚
kill -HUP $(pidof gunicorn)
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Jimmies San
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
it's strange. try taking the PID manually, and restart with the pid [kill -HUP pidnumber]
Jimmies San
i do it site gived me Internal Server Error
check logs, maybe some issue in the code or settings
Jimmies San
but the HUP flag restart the process... so there is a problem in the codebase
Jimmies San
where located that logs ?
on the filesystem? :P check the config and look where they are
Azer 🌚
File "/webapps/badminton/badminton/page/urls.py", line 7, in <module> url(r'^tournament/', tournament, name='tournament'), NameError: name 'tournament' is not defined
Azer 🌚
urlpatterns = ( url(r'^tournament/', tournament), url(r'^(?P<slug>([a-z-0-9]+))/$', page_details, name='details'), )
Azer 🌚
link tournament not working
Anonymous
from django.http import HttpResponse from django.template import loader from .models import Question def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') context = { 'latest_question_list': latest_question_list, } return HttpResponse(template.render(context, request)) #def detail(request, question_id) # question = get_object_or_404(Question, pk=question_id) # return render(request, 'polls/detail.html', {'question': question}) #def results(request, question_id): # response = "You.re looking at the results of question %s." # return HttpResponse(response % question_id) def vote(request, question_id): # return HttpResponse("You,re voting on question %s." % question_id)
Anonymous
It's still not displaying my templates
Anonymous
And I don't know why I followed all the instructions
Anonymous
Guys pls I need ur help
Anonymous
I'm really confused right now
Gopi
Can someone please help me on this error
cj
Can someone please help me on this error
it's telling you try reinstalling the program to fix this problem 🙄
Gopi
Tried multiple times
cj
well. I just can tell you to use a better OS than that... or wait until someone tell you what to do 🤷🏻‍♂️
Nizzle
Hello
Nizzle
I have question about redirect in django
Nizzle
return redirect('sendErc865')
Nizzle
url(r'^sendErc865/', views.sendErc865, name='sendErc865'),
Nizzle
def sendErc865(request): return render(request,'sendbalance.html')
Nizzle
return redirect('sendErc865')
This one does not redirect to specific view
Nizzle
But it returns [22/Jan/2019 23:21:51] "GET /sendErc865/ HTTP/1.1" 200 29615
Ghorz
ʚɞÇherry Łoveʚɞ
that name =))
Anonymous
Shubham
Hi all I am new in Django . I made models and want to make orm query using SQL query but it doesn't make it . Please help me. I have share my pastebin link https://pastebin.com/c6QfjMRf
Shubham
Please cut the 'connector_ats_api_.ats_endpoint_url' line in the select query's I added it by mistake sorry.
Anders (izzno / gooood) 🇳🇴
https://deals.tecmint.com/sales/pwyw-the-python-master-class-bundle
diproger
Hello everybody
diproger
i am new in django, but i should make a website multilanguage using django.conf.locale. Al translation words is written in specific language. But I can not create a field to select a language to change in template. so can any one suggest me useful material or website to solve this problem. Thanks in advance)
diproger
look for i18n on Django docs 😁
Thanks, I googled it, the only one thing i wanted to know is how can i load the selected language
Ayush
How can I change cache header in django? I have to change cache control
Shubham
Shubham
Is it
Shubham
?
Shubham
You can also use raw sql query
Is it best practice to use raw queries?
cj
it is best practicem
it's acceptable if you really need to do raw query, it's not bad
Shubham
But why we can't be able to make the orm for this query? Is this any limitation of Django or something else?
Akshay
<QueryDict: {'inventory': [<InMemoryUploadedFile: Shop Inv ar.csv (application/vnd.ms-excel)>]}> {'allproduct_csv': [ErrorDetail(string='No file was submitted.', code='required')]} Using Rest Framework, There's file in memory, while sending it to serializer for validating it, error occurs
Nadyrbek Sultanov
Hi guys what is better ? 1 Put Django and Scrappy projects in the same folder 2 Put scrapy project into django project ????
Modou-dev
Hi how to handle the exception TypeError (unsupported operand type(s) for +:'NoneType' AND 'str') ???
cj
But why we can't be able to make the orm for this query? Is this any limitation of Django or something else?
sometimes you will need some complex queries that the ORM can't build by itself... yet... that's why you have the option to run raw_querys
ⓦⓐⓢⓓⓚⓘⓛⓛⓔⓡ
I got an public IP address to setup the servee, think it is 192.168.1.1 I ran my Django server with 0.0.0.0:80 and hit that public IP address in browser to view my web site. But I got nothing. I also turn off my DEBUG mood and also add that public IP address to the ALLOWED_HOST list.
ⓦⓐⓢⓓⓚⓘⓛⓛⓔⓡ
cj
No no it's an example, I got real server IP address.
if you're running django in 0.0.0.0:80 then open your browser and go to x.x.x.x:80 too (where x.x.x.x is that real IP)
cj
unless you have some firewall configured somewhere else