Muflone
client wants /static/your_image.jpg web server intercepts the /static path and serve you the static file directly without passing from the django web app
Muflone
this is the way to handle static files and the reason django doesn't serve them after you set debug=False
Anonymous
Hi guys I hope you all are doing well) Question: How to handle multi step form in django rest framework
Anonymous
Hi guys I hope you all are doing well) Question: How to handle multi step form in django rest framework
I have three step form they should be saved to db only after saving the last step of form
Deep Narayan
Gil
I have three step form they should be saved to db only after saving the last step of form
You need to play with params of get/ data post , like page=1, page=2 an filling and saving inputs, and the last page save model. If you find better solution, tell us!!
Anonymous
Django cms slide image plugin or app that work have try alot on google but none of them works
Anonymous
Thanks
Ayy
I am working on a shipments-management app. I want to show a Followup form to the user 30 mins after a new shipment is added. I don't want to include celery and redis etc if it can be done by django in a simple manner. Any suggestions?
Ayy
The user can be on any screen, but needs to see the followup popup (modal basically) for all the shipments added 30 mins before.
Anonymous
GeoIP path must be a valid file or directory.
Anonymous
how ı can fixed this problem ?
Anonymous
anyone know geoıp2 ?
Gil
The user can be on any screen, but needs to see the followup popup (modal basically) for all the shipments added 30 mins before.
Without any kind of socket established from server to client-browser, isn't possible to auto-popup a modal. Or you can ask every 1/5m from broser-client, with JavaScript+ Ajax if there's some shipment to see with modal. you need an auto message? Or the user can go to one view, and if there's a shippemnt, see a message like django.messages ?
Ayy
Without any kind of socket established from server to client-browser, isn't possible to auto-popup a modal. Or you can ask every 1/5m from broser-client, with JavaScript+ Ajax if there's some shipment to see with modal. you need an auto message? Or the user can go to one view, and if there's a shippemnt, see a message like django.messages ?
Okay so I'll need a background job on both frontend and backend to run every minute and check for pending popups? The popup would include a radio button. If there's an update on the shipment, user will update the shipment model through a form. If there's no update, user needs to set a time when he wants the next reminder popup for that shipment.
Gil
maybe a timmer from JS every X minutes, and from backend, api—to—function to verify the info and construct a response
Anonymous
I want to start a new project in Django (RESTful), along with my previous database of more than 60 table with a lot of relationships . What is the best architecture to implement it?
Anonymous
Implement exactly what?
Is it a good thing to make one APP and make one sub for each other table?
Eric
Is it a good thing to make one APP and make one sub for each other table?
No, the Django apps should be logical units, not necessarily one per table.
Eric
I want to start a new project in Django (RESTful), along with my previous database of more than 60 table with a lot of relationships . What is the best architecture to implement it?
And since you have an existing database you can use python manage.py inspectdb > models.py as a starting point. You will probably need to split up your models into different apps from that first models.py
Anonymous
I really need to understand cbv's I already know the attributes where am stuck at is how to overwrite their methods and which method to overwrite
Mirco
Post it into @python
R
Hello everyone, how can I fix that?I need to name my 'admin/' path but Django debugger always throw this error when I trying to give any string in 'name' attribute (not 'admin' only).
R
index.html : https://pastebin.com/7EJbqFA2 urls.py(exactly in project) : https://pastebin.com/NCMtngFX error : https://imgur.com/a/6lYm8AH
Gil
index.html : https://pastebin.com/7EJbqFA2 urls.py(exactly in project) : https://pastebin.com/NCMtngFX error : https://imgur.com/a/6lYm8AH
I think only "admin" isn't good reverse, doesn't exists. Try 'admin:login' instead ( or maybe admin:index )
R
Wow, both work, thank you!!!
R
I think only "admin" isn't good reverse, doesn't exists. Try 'admin:login' instead ( or maybe admin:index )
JZA
hi, I want to know in a nutshell what is fabric
Anonymous
How can change deffualt user model I Django?
JZA
How can change deffualt user model I Django?
meaning? you can either extend it or rewrite it. Just use the classes that you need and code-in the blanks.
JZA
right just extend them, by filling the new fieds that are not present on the object.
JZA
class UserForm(forms.ModelForm): class Meta: model = User fields = ('first_name', 'last_name', 'email')
JZA
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
Altaf
Getting 500 error on setting Debug=False
Altaf
Same error on heroku platform...
Altaf
Getting no problem in fresh django project but in my existing project when i set debug=False...500 error
Altaf
So how to fix it...any solution???
Mirco
We don't have a magic ball If you don't give us more details, it's impossible to help u
Altaf
Settings?
Mirco
Starting from sharing what you receive into logs / console ?
Altaf
Urls?
Mirco
The traceback, this is the first thing you need to check
Altaf
"Get /HTTP/1.1" 500 27
Altaf
Getting this error in console
Rahul
Tell some good resources to learn django
Altaf
And i have mentioned localhost in Allowed_Hosts
Rohan
I don't understand your question
Mirco
@pyflare
What are u using to run Django ? runserver ?
Mirco
gunicorn ?
Altaf
What are u using to run Django ? runserver ?
Now locally i had run... bt for heroku gunicorn
Mirco
Runserver
So runserver should show you more info and not only the endpoint called with the status code
Altaf
Also heroku configuration are also their in my project
Altaf
And if i removed heroku config then static files don't load...then no 500 error
Mirco
So what should i do now??
If you set up correctly the email settings, just put your email into the ADMINS tuple and you'll receive the full traceback via email 😁
Mirco
Or you need to change the logging settings or even better run Django with gunicorn or uwsgi and check the errors logs files
Mirco
https://docs.djangoproject.com/en/3.0/howto/error-reporting/ fyi
マクスイム • グセブ
Hello everyone 🙂
Anonymous
local variable 'user' referenced before assignment
Anonymous
hello good day
Anonymous
i need your help
Anonymous
def register(request): form = RegisterForm(request.POST or None) if request.method == 'POST' and form.is_valid(): username = form.cleaned_data.get('username') # diccionario email = form.cleanead_data.get('email') password = form.cleaned_data.get('password') user=User.objects.create_user(username,email,password) if user: login(request,user) messages.success(request,f'Felicidades {user.username}') return redirect('index')
Mirco
And use code sharing tools