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

48 views
Skip to first unread message

avtar sandhu

unread,
Sep 19, 2017, 9:42:59 AM9/19/17
to Django users

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 

Manches spainspots

unread,
Sep 19, 2017, 12:39:13 PM9/19/17
to Django users
manage.py runserver should only need to be ran after making changes to your code. 

Make your data changes in admin on one tab.
load your html on another tab.
Make change B in admin.
On the second tab, hit refresh.

Make changes to your code.
manage.py runserver
Go to your admin tab of the browser, hit refresh
Go to your html tab, hit refresh

cnn.ma...@gmail.com

unread,
Sep 26, 2017, 9:32:51 PM9/26/17
to Django users
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'.

avtar sandhu

unread,
Nov 2, 2017, 10:50:12 AM11/2/17
to Django users
In the end I created a new app  and model and it worked correctly 
I never solved the original issue
Reply all
Reply to author
Forward
0 new messages