I have been cha开发者_运维问答nging some of my views templates urls lately, and switched from:
(r'^(?P<slug>[^\.]+)/view_post/$', 'view_post'),
to :
(r'^(?P<slug>[^\.]+)/post/$', 'post'),
in my blog application urls.py
. And, though I did a syncdb
and migrated
my blog application with south, the new url doesn't seem to be considered
by my sitemaps or the admin interface which redirects me on the
old url when I'm clicking on view this article.
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).
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
Did you fix your urls from your template? In your template, I see two instances of:
<input type="hidden" name="next" value="{% url blog.views.view_post slug=post.slug %}" />
The above should be:
<input type="hidden" name="next" value="{% url blog.views.post slug=post.slug %}" />
精彩评论