Upgraded to Django 1.5. Fixed urls and paths

This commit is contained in:
Martin Mahner 2013-03-19 14:46:06 +01:00
parent e894fa7324
commit 4183c58cdd
6 changed files with 14 additions and 13 deletions

View file

@ -7,13 +7,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>dpaste.de: {% block title %}{% trans "New snippet" %}{% endblock %}</title>
<link rel="stylesheet" media="screen, projection" href="{{ STATIC_URL }}theme.css"/>
<link rel="stylesheet" media="screen, projection" href="{{ STATIC_URL }}dpaste/theme.css"/>
{% block extrahead %}{% endblock %}
</head>
<body>
<div id="header">
<span class="new_snippet"><a href="{% url snippet_new %}">{% trans "New snippet" %} &rarr;</a></span>
<span class="new_snippet"><a href="{% url "snippet_new" %}">{% trans "New snippet" %} &rarr;</a></span>
{% block headline %}{% endblock %}
</div>
@ -27,9 +27,9 @@
</div>
<div id="footer">
<a href="{% url snippet_userlist %}">{% trans "Recent snippets" %}</a>
<a href="{% url snippet_userprefs %}">{% trans "Settings" %}</a>
<a href="{% url about %}">{% trans "About" %}</a>
<a href="{% url "snippet_userlist" %}">{% trans "Recent snippets" %}</a>
<a href="{% url "snippet_userprefs" %}">{% trans "Settings" %}</a>
<a href="{% url "about" %}">{% trans "About" %}</a>
</div>
{% block script_footer %}

View file

@ -34,7 +34,7 @@
<abbr title="{% trans "Time to life" %}">TTL:</abbr> {{ snippet.expires|timeuntil }}
&mdash;
{% if snippet.pk|in_list:request.session.snippet_list %}
<a onclick="return confirm('{% trans "Really delete this snippet?" %}')" href="{% url snippet_delete snippet.secret_id %}">Delete now!</a>
<a onclick="return confirm('{% trans "Really delete this snippet?" %}')" href="{% url "snippet_delete" snippet.secret_id %}">Delete now!</a>
&mdash;
{% endif %}
<span id="toggleWordwrap"><input type="checkbox"/> <a href="#">{% trans "Wordwrap" %}</a></span>
@ -67,7 +67,7 @@
{% block sidebar %}
<h2>{% trans "History" %}</h2>
<form method="get" id="diffform" action="{% url snippet_diff %}">
<form method="get" id="diffform" action="{% url "snippet_diff" %}">
{% csrf_token %}
<div class="tree">
{% for tree_item,structure in tree|tree_info %}
@ -92,7 +92,7 @@
</form>
<h2>{% trans "Options" %}</h2>
<p><a href="{% url snippet_details_raw snippet.secret_id %}">{% trans "View raw" %}</a></p>
<p><a href="{% url "snippet_details_raw" snippet.secret_id %}">{% trans "View raw" %}</a></p>
{% endblock %}
{% block script_footer %}
@ -117,7 +117,7 @@ jQuery(document).ready(function(){
* Diff Ajax Call
*/
$("form#diffform").submit(function() {
$.get("{% url snippet_diff %}", {
$.get("{% url "snippet_diff" %}", {
a: $("input[name=a]:checked").val(),
b: $("input[name=b]:checked").val()
}, function(data){
@ -162,7 +162,7 @@ jQuery(document).ready(function(){
* Lexer Guessing
*/
$('#guess_lexer_btn').click(function(){
$.getJSON('{% url snippet_guess_lexer %}',
$.getJSON('{% url "snippet_guess_lexer" %}',
{'codestring': $('#id_content').val()},
function(data){
if(data.lexer == "unknown"){

View file

@ -21,7 +21,7 @@
jQuery(document).ready(function(){
{% if request.session.userprefs.display_all_lexer %}
$('#guess_lexer_btn').click(function(){
$.getJSON('{% url snippet_guess_lexer %}',
$.getJSON('{% url "snippet_guess_lexer" %}',
{'codestring': $('#id_content').val()},
function(data){
if(data.lexer == "unknown"){

View file

@ -1,11 +1,12 @@
from django.conf.urls.defaults import url, patterns, include
from django.contrib import admin
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^about/$', 'django.views.generic.simple.direct_to_template', {'template': 'about.html'}, name='about'),
url(r'^about/$', TemplateView.as_view(template_name='dpaste/about.html'), name='about'),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('dpaste.urls.dpaste_api')),
url(r'^', include('dpaste.urls.dpaste')),

View file

@ -1,4 +1,4 @@
django==1.3
django==1.5
django-mptt==0.4.2
django-piston==0.2.2
pygments==1.4