Ghorz
My site runs on this setting on heliohost.org
Ghorz
Check out this project file settings
Ghorz
https://github.com/mymi14s/Django-Project-Starter-Template/blob/master/src/core/settings.py
Gio
hi everyone
Gio
can anyone please help me with this? https://stackoverflow.com/questions/53812936/django-queryset-cannot-filter-by-current-week-when-use-tz-is-enabled
Mohit
During deployment, static files are served by online servers like Nginx or apache
Mohit
Your local static won't load
Rajjix
man, when u run django with any server through wsgi instead of manage.py, by that i mean when u hook it to apache or nginx or any other server other than the development one provided, django stops servings static and media directories, it only links files to those directories to /static or /media respectively, the only thing that wsgi serves is ur main urls.py file and the settings, so in order for ur django apps to find and connect to ur static or media files, u need to serve them with any server on the /static uri to do that all you do is add a location in your nginx conf and link it to your static directory. It’s just like sharing any other folder online for someone to download files off of your server, only this time u have to specify the /static directory, so that when django template try to find their respective css and js they will find it on the /static/ uri
Rajjix
And don’t use that astrik, u only need the ip address of your host server there, the host server only, this is not a permission list for visitors.
Djasur
thanx
Anonymous
Hi
Mirco
Hi 😀
Anonymous
When I try to generate a pdf report it throws an exception called connection refused when I deploy the code into server but pdf report is successfully generated when I run the same code in local system
Anonymous
Please give me any idea regards this
Mirco
Share your code 😀
Anonymous
Ok
Mirco
Anyway connection refused could be due to your db connection fails for example
Ghorz
404 handle will mess up you code. Remove all 404, 500 handler
Ghorz
Instead make 404.HTML, 500.html. Place them in templates directory
Ghorz
Django will auto detect them when debug is false
Mirco
But it works fine with localhost
Maybe you have something different set on your remote
Anonymous
I am hosted in pythonanywhere web hosting
Mirco
Double check your pythonanywhere settings
Anonymous
I already chk the code many times but not able to get the soln
Anonymous
Need help
Mirco
Without your code or a traceback is hard to help ya
Anonymous
Views function
Anonymous
Html
Anonymous
Please need your help
cj
Don't use Python2.7
Anonymous
But when i run in localhost pdf file is generated
Anonymous
What is the difference
cj
are you using python2.7 in your localhost?
gamer_boy
AttributeError: 'Settings' object has no attribute 'Debug'
gamer_boy
plz help
Mirco
guys pls , read the rules no screenshots! share your code with tool like pastebin, thanks!
George
I think its enough the error mesage. Do you have any debug property set? 😂
George
Put settings.py in pastebin
Rajjix
forgot to caps, he’ll figure it out soon, after searching google for a couple of hours
Mirco
😂
George
How can you fuckup default settings
George
😂
George
Why would anybody touch that
Rajjix
Why would anybody touch that
He didn’t it’s caps by default
gamer_boy
http://dpaste.com/26PB335
gamer_boy
here is the code
Mirco
look for debug in your settings.py
George
Your debug is quite smol :(
George
I meant, wtf, the settings file
George
Your debug attribute is inexistent
Mirco
u will understand what we're talkin' about and you won't see that error anymore swapnil
gamer_boy
Rajjix
Don’t mirco
Mirco
good, so why are u trying to call it with debug and not DEBUG ?
George
it says DEBUG = 'True'
And why didnt you paste it
George
Mirco
keep calm guys, he's trying to learn
Mirco
try settings.DEBUG and run again swapnil
gamer_boy
i am learning fiiefield
gamer_boy
k
Mirco
i am learning fiiefield
u need to study better basic things and python because that error is pretty clear
George
It should state this in your settings.py: # SECURITY WARNING: don't run with debug turned on in produc$ DEBUG = True
Mirco
no worries :D
George
Debug is a boolean, not a string
Anton
Hello. What is the simplest way to wrap django views with swagger documentation from scratch? No matter with drf or without.
Maz
Views function
😂 wow...so many screenshots. Simple use a paste site like dpaste.de Makes everyone's life much easier.
cj
you have to serve the staticfiles directly with the web server
ibrahim süren
can you explain more?
ibrahim süren
in the deployment tutorial videos, it works like a charm
cj
in the deployment tutorial videos, it works like a charm
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04#configure-nginx-to-proxy-pass-to-gunicorn read that part
Mirco
can you explain more?
We explained all you need to serve static files when debug is False yesterday Another thing very useful for you is this one
Mirco
And this one is for use it with Django
Mirco
If u wanna use nginx or Apache, read the article posted by cj
rmvillegas
hi everyone!
Mirco
Hi 👋