Muflone
loadstatic?
Mirco
yeap, i did that
Are you sure "as" is supported for static ?
#
loadstatic?
i did that but it doesn't work. it works for css but it couldn't for img
{°_°}
{% load staticfiles %}
#
Are you sure "as" is supported for static ?
yeap it support. and also i try {% static 'img/logo.png'%}
Mirco
{% load staticfiles %}
Not on Django 2.x
#
{% load staticfiles %}
i did that one also
#
Not on Django 2.x
i am using django 2.2
Mirco
i am using django 2.2
So it's load static not staticfiles
{°_°}
Not on Django 2.x
It works man I just used it in project
Mirco
It works man I just used it in project
I'm sure it's deprecated in favor of load static in Django 2 😊
Mirco
It doesn't mean it won't work, but it's deprecated
#
It works man I just used it in project
i used it before but i don't know what happen now, it couldn't works
#
let me share u my setting code
#
STATICFILES_DIRS = [ ('img','working_files/img'), ('css', 'working_files/css') ] STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'storage', 'static_file/static') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'storage', 'filedir')
Mirco
😁ok
Maybe in Django 3.x will be totally removed so use load static 😊
Mirco
shall i change STATICFILES_DIRS setting?
Use a static directory instead of img , css Put img, css into a main directory
ابو
Best place to learn Django fast? Please website and books
Doragonsureiyā
Best place to learn Django fast? Please website and books
Check out PythonRes, a channel for Python resources (links to help you out).
Anonymous
https://youtu.be/JYPnO7tLZck
Rohith
i am getting folloeing error
Rohith
i am new to django please help me out
Viktor
Holly shit man,use pastbin or github to share your project
Yegor
Hi, ive got a problem with FileResponse, on my dev server I cant download files, when Im tryin to do It, some time later I get "failed to load pdf" or with as_attachment=True, when download finishes, I get the same. Heres the code https://dpaste.de/TxhZ and thats my uwsgi error log https://dpaste.de/rAgd I will be grateful for any help 😞
Yegor
PS: nginx client_max_body_size is 75mb, so I dont think this trouble causes nginx
Yegor
PPS: I have an idea to fuck this shit and recofigure it to gunicorn
#
how can i include svg icon to my django project?
Anonymous
Anonymous
hello everybody, any problemes if I learn Django V1 then V2 ??
Anonymous
hello everybody, any problemes if I learn Django V1 then V2 ??
I would start directly with v2 because if you start with v1 you will need to unlearn things when learning v2
Mirco
hello everybody, any problemes if I learn Django V1 then V2 ??
Why you wanna go into the past instead of into the future ?
Anonymous
Hello members i've been trying this but i decided to ask... Is it possible to use a condition in html templates so as to display 'say a url' if a model in the database meets the condition without involving the view.py ?
Doragonsureiyā
Thanks and i Got you 👍👍👍
You're welcome! 😊
Anonymous
Why you wanna go into the past instead of into the future ?
Because my native language is Arabic and my English is weak, especially the skill of lesiting,and in arabic found one course well but V1
Anonymous
So good reason to learn English 😊
Yes😅, I have been learning it for a long time but I need a lot of time to be able to follow courses in English
Anonymous
You can also suggest to add Arabic language to Django docs
excuse me ,Are the documents easy to learn ?
Anonymous
Yup
so I will follow the Arabic course and read the documents in order to distinguish the two versions?
Anonymous
excuse me ,Are the documents easy to learn ?
Yep and nop The nop part came bcos u don't get it for the first u read it .u have to read it again
Anonymous
Ya but read the docs bcos it is way more powerful than the tutorial on YouTube
Anonymous
Anonymous
Yes they are
thank you so much too
👍
How store list in django models ??
Mirco
List of what ?
ARUN
do anyone knows POS system using django
Mihail
Hi! Help me, please, how to stop evaluating of clean_field methods after raise ValidationError in one of them?
Maz
do anyone knows POS system using django
Not related, but use Odoo. Also written in Python...so you can parlay your skills.
👍
List of what ?
A list having multiple value
Anders (izzno / gooood) 🇳🇴
Do any of you serve your CSS (one) as templates? Using variables in CSS files would be more pleasant then ajax calls ...
Mirco
A list having multiple value
You can use JSONField e put the list as value of a key
👍
You can use JSONField e put the list as value of a key
can I use JSONField in while using dajgno+mysql
cj
can I use JSONField in while using dajgno+mysql
no, JSONField is exclusive to be used with PostgreSQL
cj
https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/#jsonfield
cj
There are many things that are built-in Django that are meant to be used exclusively with PostgreSQL only #PostgreSQL #Exclusive (hashtag for future reference/search) https://docs.djangoproject.com/en/dev/ref/contrib/postgres/
Rohan
https://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html
Rohan
I know it cuz I've seen it before and used it as well :p
Mirco
can I use JSONField in while using dajgno+mysql
It will come with Django 3.x I think or a bit earlier A good guy has extended the support to the other engines
👍
thanks
Mirco
thanks
That's why Postgres is the best engine for Django as suggested by official docs
#
hello everyone, how can i include static files like imgs in css in django? if i want to set background-image, what do i have to do? when i try to locate absolute postion, it couldn't work?
godmode
There un the base.html i put un the CSS, i did It one with the css property background and the url()
#
There un the base.html i put un the CSS, i did It one with the css property background and the url()
Tnx bro, i am trying to see. if u can, tell me the dir where u put it
godmode
Apps/blog