Skip to content Skip to sidebar Skip to footer

Django Templates Urls Not Updating

I have been changing some of my views templates urls lately, and switched from: (r'^(?P[^\.]+)/view_post/$', 'view_post'), to : (r'^(?P[^\.]+)/post/$', 'p

Solution 1:

If this is running under Apache, you would have to force-reload or restart apache for your changes to be applied.

Also, you don't have to syncdb or migrate your app when changing your urls.py map (unless you are running a custom add-on I don't know about).

Solution 2:

How are you restarting Gunicorn? with -HUP? Sounds weird, but try killing it completely then restarting it. Also- you shouldn't need to restart Nginx, just gunicorn

#start command, stores pid in a file in /tmp
sudo python manage.py run_gunicorn -p /tmp/gunicorn.pid -b 127.0.0.1:8000 --daemon

#stop command
sudo kill `cat /tmp/gunicorn.pid` #note those aren't apostrophes, but the ~ key#restart commad
sudo kill -HUP `cat /tmp/gunicorn.pid`

I write these as little scripts so that I can just call ./start ./stop ./restart from my main folder, makes it easier

Solution 3:

Did you fix your urls from your template? In your template, I see two instances of:

<inputtype="hidden" name="next" value="{% url blog.views.view_post slug=post.slug %}" />

The above should be:

<inputtype="hidden" name="next" value="{% url blog.views.post slug=post.slug %}" />

Post a Comment for "Django Templates Urls Not Updating"