Mirco
https://dpaste.de/Jq4U
Set STATIC_ROOT as well
pino@mastrobirraio ~$
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ] Try to add this
Muflone
1) did you collected your static files? 2) is your web server serving the static files? this is not made by django
Mirco
1) did you collected your static files? 2) is your web server serving the static files? this is not made by django
His DEBUG is True so I think he's in dev stage No need to collectstatic or setup webserver But these are info that he could give us 😁
Mirco
highnes
def index(request): return render(request,'basic_app/user.html') def userd(request): return render(request,'basic_app/user.html')
highnes
In views.py it works fine with index but not userd
pino@mastrobirraio ~$
The problem is that you can't load files like css, js, images or you can't load html files?
highnes
it loads the html file
highnes
but my css is not working
pino@mastrobirraio ~$
How do you load them?
pino@mastrobirraio ~$
Show use the code
highnes
<link rel="stylesheet" href="static/basic_app/user_style.css">
pino@mastrobirraio ~$
It's wrong
pino@mastrobirraio ~$
In this your browser console should tell you
pino@mastrobirraio ~$
So
highnes
😕
pino@mastrobirraio ~$
Add {% load static %} at the beggining of the html code And the the file should be import in this way: <link rel="stylesheet" href="{% static 'basic_app/user_style.css' %}">
highnes
Its done.. thanks @il_mastrobirraio @pyflare
pino@mastrobirraio ~$
Of nothing 😊
darkshadows
Guys how would you rate Django course by Jose Portilla on Udemy ?
cj
Guys how would you rate Django course by Jose Portilla on Udemy ?
you can see its rate in the corresponding Udemy page, why do you ask here? (it has 17.149 reviews, here we are 2K people, you will have a better answer in the Udemy page itself) 🤷‍♂️
Doug
you can see its rate in the corresponding Udemy page, why do you ask here? (it has 17.149 reviews, here we are 2K people, you will have a better answer in the Udemy page itself) 🤷‍♂️
They're probably looking for a personal recommendation. A lot of people don't trust reviews. It's the same reason a lot of people ask questions on groups like this instead of googling the question.
cj
They're probably looking for a personal recommendation. A lot of people don't trust reviews. It's the same reason a lot of people ask questions on groups like this instead of googling the question.
what if a personal recomendation says it's bad course, but all reviews say it's good course... that person will think it's bad because the personal recomentation and lost a very good course?
cj
🤷‍♂️
Doug
👍
Luv
I am new to django
Luv
Is there anyone working as a professional who can explain some Django project
Anonymous
hey
Anonymous
someone can help me?
Anonymous
Is there anyone working as a professional who can explain some Django project
django girls tutorial is good enough to start with... then you can post specific questions. because its a vast concept to grasp.
dynamic
The URL params in Django are in the dictionary format if the do the following? params = request.query_params.copy()
Anonymous
its mutable querydict.
dynamic
thank you Divya
Сергей
Enyone nows how can add dynamic m2m field remark, was_created = Remark.objects.get_or_create(name=item['label'], value=item['value']) print("remark") print(remark)setattr(stacks, negative, (remark,)) it`s not work in this case negative dynamik many to many in stacks
Anonymous
When using rest framework you don't need csrf token to make for example a post request or Django rest takes care of it itself?
Anonymous
I followed a book (it was a good book) but not s single mention of csrf token
Alexander
Hello) if you use Starlette (https://www.starlette.io/) with Django (ex.: https://github.com/erm/charlette) or respect Starlette for one of the best benchmarks results, then join new group @python_starlette
Alexander
and one more promotion: if you speak russian, join @pydjango [hello from russian community!]
Artyom
Hello, devs!
Artyom
why my filter works incorrectly? https://stackoverflow.com/questions/55898999/objects-filter-by-user-filters-data-only-for-one-user
Artyom
maybe when I use filter like this, Django don't know that session is changed?
Anders (izzno / gooood) 🇳🇴
User_check is an object, not just the ID.
Anders (izzno / gooood) 🇳🇴
Most places where you want to filter by user in Django you pass the User object, not the ID. This is confusing in the beginning.
Mirco
User_check is an object, not just the ID.
+1 if u wanna filter by pk u should use user_check__pk
Anders (izzno / gooood) 🇳🇴
Oh nice... I did not think about the default related key 👍
Anders (izzno / gooood) 🇳🇴
Or related operater? __ what ever its named 😂
Mirco
Or related operater? __ what ever its named 😂
double dunder 😂 something like that found the right name on docs, I forgot it : Field Lookups
Coldplay
Hey can anyone suggest me a django project for beginners
N S
I don't see any pk
If i print formset.errors it says id field is required
Mirco
If i print formset.errors it says id field is required
you can always use hidden input to send pk without showing the input into template or work with forms' initial data
Anonymous
Hey can anyone suggest me a django project for beginners
why don't you try django tutorial ... there are steps by steps implementation of voting app.
jang
Many people seem to recommend voting app tutorials. However, after completing this tutorial, I was wondering: 'How do I get one person to vote once?' I did a search and found that I needed to implement an authentication feature, but I was reluctant to certify an anonymous person. So I try to use 'cookie', but this method seems to be a problem as visitors can vote many times if the browser clears the cookie value. Is there any other way to simplify than login and to ensure consistency over cookies?
Anonymous
probably we should maintain a flag in db .. if the person has voted already we should change the flag to false. con of this approach:- we have to always check from DB. any other solution, if somehow we could ditch DB query.??
saiprasad
Hi, I have question related to DRF. In one model serializer i have 4 fields like (id, username, email, address) at one scenario i want display 4 fields but in another scenario i want to display username and email, shall i use two different serializers or is there any way to override serializer which having 4 fields to display only 2 fields.
saiprasad
If any one having other idea please let me know
Mirco
If any one having other idea please let me know
you can always work at model level , so u can filter your queryset based on your view so for example the first case your qs will have all fields and in the other case your qs will have just email and pwd
Anonymous
Can u give me the link ?
Google is your best friend. 😳
Derrick
guys, i want to populate a form choicefield with data from the database. How do i do it?
Derrick
dynamic
Mirco
dynamic
ok, now explain what u wanna get so we can understand better your use case
Prinart
Please, am creating an account app and have created my password_change_form.html but when I click on the link it opens the admin form rather. How do I fix it.
Derrick
ok, now explain what u wanna get so we can understand better your use case
i have a column containing names of local areas... I want to populate those names in a choicefield... The model is called Area