Muflone
do you have an application called employee?
Muflone
don't confuse models with applications
S Sidharth
aravind
I need to integrate a qr code scaner in web application and scanig should be done by mobike camera
Julio
Hi people, anyone knows how i can block a field in a model if another field is true?
Julio
or block the entire entry
Rajesh
Rajesh
I want to create employees module with crud operation
Rajesh
Like other framework like php we can define controller model and view for a module like employees
Muflone
I'm little confused with app and module
a django project is made of apps
each app has many models which are the tables for the data
migrations are created for each model but the command to create them is
python manage.py makemigrations (for all apps) or
python manage.py makemigrations appname (for only the app called appname)
Rajesh
Muflone
each app lives in a folder
Fedor
Hi there! I have some problems with urls in DRF.
I have two models: Dialog and Message. Message model has a ManyToOne relation to Dialog model.
And i'm trying to organize urls like this way:
api/dialogs/DIALOG_ID/messages/
api/dialogs/DIALOG_ID/messages/MESSAGE_ID
I want to get all messages associated with dialog.
How to do it?
Amen
Fedor
Viewsets
Amen
have you used routers
Amen
DRF DefaultRouter helps orgaize your endpoints
Fedor
I'm should check routers docs?
Amen
yea go through it
Amen
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'message', MessageModelViewSet, basename='message-api')
Anonymous
I'm using postgres sql for deploying on heroku its giving error ,I searched on web but no resourse ` Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?`
Mirco
Anonymous
the add on is automatically added
Anonymous
Mirco
the add on is automatically added
Really ? I've always added by myself 😁 I don't remember it's automatic
Anyway I think the real issue is about settings
Anonymous
cj
what is you website address again?
Mirco
😂
cj
Mirco
And change the postgres url accordingly
In Heroku is already set
Mirco
Anonymous
cj
think on it about a blocker, if you're not following good practices, you should be forbidden on deploying anything
Anonymous
Anonymous
cj
Its my first time,I'll take care next time
no no no, no next time, do it right here, right now
first fix your bad code, make sure to follow up good practices, then later we can talk about on helping you to deploy it (or not)
Anonymous
yess!! by next time I meant this
Anonymous
Ghorz
#tips
Django modelform is helpful but for better form experience, I'll advice using pure html5 and JS to handle form at the front end.
Ghorz
cj
cj
https://docs.djangoproject.com/en/3.0/topics/forms/formsets/
Ghorz
Ok
cj
Ok
didn't you know about them? 🤔
Ghorz
I do
Ghorz
I am more productive using JS at frontend
Ghorz
Especially when there is need to manipulate DOM by adding/deleting form input rows
cj
I am more productive using JS at frontend
if you're making a totally isolated front-end app (as a client) and Django for APIs, then yes... if you're using Django templates I don't see the point to rewrite and reinvent what Django gives you, just complementing it with some JS/CSS, no need to re-write everything 🤷🏻♂️
Mirco
Ghorz
Anonymous
Hey there! Can anyone help me with latex in sympy and rendering the value in template?
Vlad
I can't get my static files to come up. I've tried various settings and directory configurations and so on, but they just turn up as 404s.
Vlad
Anonymous
after using set config its giving more ? more ? ... cannot exit this
Eng. FoDy
hi, please I want to show image without used '/media/' , my code is
<img href="/media/{{user.photo}}">
Mirco
Eng. FoDy
Rainur
Hello! I am a student. I independently studied django, HTML, CSS, JS and now I want to take on orders for website development. Please tell me where to get orders?
Root
Hello i want to get 2 database data In html javascript
Root
How its possible
悪魔
Not Found: /news/Untitled.png
django is searching my pictures in wrong direction.
How can i fix it?
Template looks like this: <h1>{{ n.title }}</h1>
<h4>{{ n.date_published }}</h4>
<img src="{{ n.picture }}">
Anonymous
I'm running into this error while deploying on heroku
Anonymous
`OperationalError at /login/
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
`
Anonymous
I searched but nothing solved my problem
cj
Anonymous
Anonymous
Okok
Anonymous
Anonymous
Yes form its website