Anders (izzno / gooood) πŸ‡³πŸ‡΄
right ?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
I've been in flask for a month 🙃
Anders (izzno / gooood) πŸ‡³πŸ‡΄
and some function to handle routes if I am not mistaken.
cj
You still need setup options
Yes( ), No(βœ…), Maybe( )
Anders (izzno / gooood) πŸ‡³πŸ‡΄
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] ?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
The url option i was thinking about was for media files ;)
cj
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] ?
just store your statics in a static folder and you're done
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
now I'm affraid that your server is running without any kind of security ... but that's anoooother story
😢😢😢 ohhhhhhhhhh another point, should implement with ngnix with gunicorn or uWSGI
cj
😢😢😢 ohhhhhhhhhh another point, should implement with ngnix with gunicorn or uWSGI
that's another story... deploying to production... but it's not as hard as it looks like
licensed
hello. i am new with django and I'm having trouble with template paths: TemplateDoesNotExist at / core/student_list.html i am using default template settings: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, The correct template path is project/app/templates/student_list.html, right? This file exists but my project is searching at project/core/templates/core/student_list.html
licensed
dirs is an emty list
yeah, because APP_DIRS is set to True. what i have to put on dirs?
licensed
i already tried dirs=['/templates/'] and same error
Anders (izzno / gooood) πŸ‡³πŸ‡΄
app/templates/app/
Anders (izzno / gooood) πŸ‡³πŸ‡΄
unless your app is going to be huge I find adding [os.path.join(BASE_DIR, "templates")] to the list and putting my templates in /templates/whateversreasonably
licensed
app/templates/app/
really?? this is very repetitive.. can't I use app/templates/ only? i think this is correct
Anders (izzno / gooood) πŸ‡³πŸ‡΄
no
Anders (izzno / gooood) πŸ‡³πŸ‡΄
This has to do with namespacing.
Shaun
I mean. They could just use app/templates/ only. Assuming the aren’t adding other stuff.
Shaun
They can change the template directory config to be name spaced when they grow. (As an option)
Shaun
You’re both correct
licensed
They can change the template directory config to be name spaced when they grow. (As an option)
how can i do for my django search in this path? app/templates/? If i have app2, I would like to use app2/templates/ i don't know how to configure for this
licensed
unless your app is going to be huge I find adding [os.path.join(BASE_DIR, "templates")] to the list and putting my templates in /templates/whateversreasonably
this way i will have project/templates/app/ instead project/app/templates/ right? i would like 2nd option. but i will follow django standards
licensed
what is django standards? /project/app/templates/app/ right?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
what is django standards? /project/app/templates/app/ right?
https://wsvincent.com/django-tips-template-structure/
licensed
https://wsvincent.com/django-tips-template-structure/
amazing article!! omg!! ty very much! i will read carefully and try again
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
cj
for handle the security, we can use nginx, right?
yes and no... it's only a reverse proxy/web server... but if you flush your firewall rules, you will have another attack vectors in your server 🤷🏻‍♂️
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
anyway thanks for your maximum effort to this question, its really really helpful 😍😍😍 @c0x6A and @izznogooood 😍😍😍
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
Shubham
it's acceptable if you really need to do raw query, it's not bad
Can you please still able to make orm for that SQL query?
cj
Can you please still able to make orm for that SQL query?
there are querys that can be done by the ORM, that's why you have the raw_query option
Mirco
and some function to handle routes if I am not mistaken.
There's a way to handle route via classes if I well remember 💪
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
you have to configure SeLinux again
anyway I have to answer my boss's question about flushing all the ip rules 😔😔😔
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
@c0x6A did you work with django-channels?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
anyway thanks for your maximum effort to this question, its really really helpful 😍😍😍 @c0x6A and @izznogooood 😍😍😍
All i did was google it, I have not used default template paths since my first tuto, so I dont deserve any credit for this. Googling is half your programming... Unless you work on the same issues, building the same skelletons
Anders (izzno / gooood) πŸ‡³πŸ‡΄
just don't let him notice it 🤫🤫🤫🤫
I would ask my boss why he uses ContOS
Anders (izzno / gooood) πŸ‡³πŸ‡΄
(dont do that) ...
Anders (izzno / gooood) πŸ‡³πŸ‡΄
;)
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
not yet
I did some basic things in channels. I handle the file upload using http request and need to pass that file url to the real time chat, I mean pass into the django-channels class 😢😢😢
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
just don't let him notice it 🤫🤫🤫🤫
but he will 😂😂😂 untill that I'm free
β“¦β“β“’β““β“šβ“˜β“›β“›β“”β“‘
Anders (izzno / gooood) πŸ‡³πŸ‡΄
I have a lot of experiance with linux (I use it daily, on every machine in the house/ work servers) but not alot with SElinux, and there's a reason for that.
Anders (izzno / gooood) πŸ‡³πŸ‡΄
My only regret is starting with computer science (programming) late in life (my life :) ) ...
Anonymous
I have 4 class each class reletion with another via foreign keys, but now i am not able to serialise the data
Anonymous
Anyone can help me onit
Sebuhi
return redirect('sendErc865')
first you need to import redirect after render in the up, like from django.shortcuts import render, redirect then the if the condition if fuch is False, it has redirect a template. what I see you dont have any condition,
Sebuhi
Should i need always if condition?
no need if you dont have any if statements, I mean it is up to you, it depends what function you are writng
Nizzle
Anyway redirect it is not working in my case
Sebuhi
Anyway redirect it is not working in my case
you havenot mentioned proper template to redirect may be?
Nithin
I am deploying django with docker. while building the image I am running collectstatic. But django throws error saying it cant find the secrect_key env variable (I only take it from env variable and use diff values for dev and prod). what is the best way to solve this ? i dont want to put a secrect value in setting, neither do i want to remove collectstatic (as logically it should run during building image). How do you guys do it?
Nithin
So while building set env variables for each?
ΚšΙžΓ‡herry Łoveʚɞ
Sorry, I misunderstood.
ΚšΙžΓ‡herry Łoveʚɞ
i think this will work in your case.
Anonymous
I would like create an app for quiz.
Anonymous
Simple quiz.. Like object oriented questions.
Anonymous
Any one have done it ??
Corn
I’m what’s the best way to show real-time data on a webpage with out refreshing? For example sensor readings
ManJain
hey guys, I am trying to make a site which allows the users to upload and download. The uploaf part us done. But I couldn't get how to implement download functionality. I am string the files in FileStorageSystem
Mirco
Your post instance is None , fix that
Bhupesh
Your post instance is None , fix that
Can you please elaborate 😶
George
Image of screen yay
Ghorz
Reactifying Django seem to be beautiful. All you do is DRF your project then write the views functionalities in pure JavaScript React.
Mirco
Can you please elaborate 😶
what does it mean in python ( not django ) "Nonetype has not attribute "id" ?
Mirco
sounds like u have urlspattern bad defined
Gio
hello guys, any Django developer interested in working on a project?