Tuesday, September 26, 2017

Re: Adding data via admin not visible on html template until restart server (python manage.py runserver)

Any update on this?

I have the similar issue - I login to my demo Django http://127.0.0.1:8000/admin/, and update a field name 'name' in 'demo'. The field 'name' is still showing the old data by using url (restful api) http://127.0.0.1:8000/demo. I have to use http://127.0.0.1:8000/admin/demo (notice the 'admin') in order to see the updated 'name'.



On Tuesday, September 19, 2017 at 9:42:59 AM UTC-4, avtar sandhu wrote:

Please can anyone help me


I have a Django Model

class Event(models.Model): scheduled_event = models.BooleanField(default=True) category = models.CharField("category ", max_length = 30)

registered in admin

class PostEvent(admin.ModelAdmin): admin.site.register(Event, PostEvent)

I can add delete etc ok in Admin

However the data is not refreshed in my html template until i restart the server

python manage.py runserver


How can i make the changes dynamic.  dont want to restart the server anytime a user makes some content change 


All help would be appreciated 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77e49697-ac2f-4552-9128-cde8ea603e54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment