diff --git a/README b/README index ff0a7a5..db788df 100644 --- a/README +++ b/README @@ -11,22 +11,22 @@ Setup In order to make use of this application you will need: -* Django 1.4.x - tested with 1.4.1-1.4.10; newer versions may work, but - the application has not been tested with 1.5 or newer. +* Django 1.6.x - tested with 1.6.10; newer versions may work, but + the application has not been tested with 1.7 or newer. * For production usage, a web server set up to host Django applications (not needed for local-only testing) * A database supported by Django (SQLite, MySQL, etc.). Django takes care of creating the database itself, you just need to ensure that the database server (if not using SQLite) is configured and running. * The following third-party Django modules (tested versions listed): - * django-south (0.8.4) + * django-south (1.0.2) * django-registration (1.0) - * django-reversion (1.7.1) - * django-reversion-compare (0.3.5) - * django-simple-captcha (0.4.1) - * django-nvd3 (0.6.0) - * djangorestframework (2.3.14) - * django-cors-headers (0.12) + * django-reversion (1.8.7) + * django-reversion-compare (0.4.0) + * django-simple-captcha (0.4.6) + * django-nvd3 (0.9.7) + * djangorestframework (3.2.5) + * django-cors-headers (1.1.0) * On the machine that will run the backend update script (which does not have to be the same machine as the web server, however it does still have to have Django installed, have the same or similar configuration diff --git a/layerindex/forms.py b/layerindex/forms.py index 60653cf..e15dbeb 100644 --- a/layerindex/forms.py +++ b/layerindex/forms.py @@ -6,7 +6,7 @@ from layerindex.models import LayerItem, LayerBranch, LayerMaintainer, LayerNote, RecipeChangeset, RecipeChange, ClassicRecipe from django import forms -from django.core.validators import URLValidator, RegexValidator, email_re +from django.core.validators import URLValidator, RegexValidator, EmailValidator from django.forms.models import inlineformset_factory, modelformset_factory from captcha.fields import CaptchaField from django.contrib.auth.models import User @@ -29,9 +29,8 @@ class LayerMaintainerForm(forms.ModelForm): if email: if len(email) < 7: raise forms.ValidationError('%s is not a valid email address' % email) - reg = re.compile(email_re) - if not reg.match(email): - raise forms.ValidationError('%s is not a valid email address' % email) + val = EmailValidator() + val(email) return email @@ -115,21 +114,21 @@ class EditLayerForm(forms.ModelForm): def clean_vcs_web_tree_base_url(self): url = self.cleaned_data['vcs_web_tree_base_url'].strip() if url: - val = URLValidator(verify_exists=False) + val = URLValidator() val(url) return url def clean_vcs_web_file_base_url(self): url = self.cleaned_data['vcs_web_file_base_url'].strip() if url: - val = URLValidator(verify_exists=False) + val = URLValidator() val(url) return url def clean_usage_url(self): usage = self.cleaned_data['usage_url'].strip() if usage.startswith('http'): - val = URLValidator(verify_exists=False) + val = URLValidator() val(usage) return usage diff --git a/layerindex/restviews.py b/layerindex/restviews.py index 61698a9..b33d3d1 100644 --- a/layerindex/restviews.py +++ b/layerindex/restviews.py @@ -1,6 +1,6 @@ -from models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine +from layerindex.models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine from rest_framework import viewsets, serializers -from querysethelper import params_to_queryset, get_search_tuple +from layerindex.querysethelper import params_to_queryset, get_search_tuple class ParametricSearchableModelViewSet(viewsets.ModelViewSet): def get_queryset(self): diff --git a/layerindex/urls.py b/layerindex/urls.py index 1bd4f0b..e7808e6 100644 --- a/layerindex/urls.py +++ b/layerindex/urls.py @@ -4,9 +4,8 @@ # # Licensed under the MIT license, see COPYING.MIT for details -from django.conf.urls.defaults import * -from django.views.generic import TemplateView, DetailView, ListView -from django.views.generic.simple import redirect_to +from django.conf.urls import * +from django.views.generic import TemplateView, DetailView, ListView, RedirectView from django.views.defaults import page_not_found from django.core.urlresolvers import reverse_lazy from layerindex.views import LayerListView, LayerReviewListView, LayerReviewDetailView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, HistoryListView, EditProfileFormView, AdvancedRecipeSearchView, BulkChangeView, BulkChangeSearchView, bulk_change_edit_view, bulk_change_patch_view, BulkChangeDeleteView, RecipeDetailView, RedirectParamsView, ClassicRecipeSearchView, ClassicRecipeDetailView, ClassicRecipeStatsView @@ -24,19 +23,20 @@ router.register(r'recipes', restviews.RecipeViewSet) router.register(r'machines', restviews.MachineViewSet) urlpatterns = patterns('', - url(r'^$', redirect_to, {'url' : reverse_lazy('layer_list', args=('master',))}, + url(r'^$', + RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',))), name='frontpage'), url(r'^api/', include(router.urls)), url(r'^layers/$', - redirect_to, {'url' : reverse_lazy('layer_list', args=('master',))}), + RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',)))), url(r'^layer/(?P[-\w]+)/$', RedirectParamsView.as_view(), {'redirect_name': 'layer_item', 'branch':'master'}), url(r'^recipes/$', - redirect_to, {'url' : reverse_lazy('recipe_search', args=('master',))}), + RedirectView.as_view(url=reverse_lazy('recipe_search', args=('master',)))), url(r'^machines/$', - redirect_to, {'url' : reverse_lazy('machine_search', args=('master',))}), + RedirectView.as_view(url=reverse_lazy('machine_search', args=('master',)))), url(r'^submit/$', edit_layer_view, {'template_name': 'layerindex/submitlayer.html'}, name="submit_layer"), url(r'^submit/thanks$', @@ -107,7 +107,7 @@ urlpatterns = patterns('', template_name='layerindex/about.html'), name="about"), url(r'^oe-classic/$', - redirect_to, {'url' : reverse_lazy('classic_recipe_search')}, + RedirectView.as_view(url=reverse_lazy('classic_recipe_search')), name='classic'), url(r'^oe-classic/recipes/$', ClassicRecipeSearchView.as_view( diff --git a/layerindex/urls_branch.py b/layerindex/urls_branch.py index b0f577c..ab5e2d5 100644 --- a/layerindex/urls_branch.py +++ b/layerindex/urls_branch.py @@ -4,8 +4,7 @@ # # Licensed under the MIT license, see COPYING.MIT for details -from django.conf.urls.defaults import * -from django.views.generic.simple import redirect_to +from django.conf.urls import * from django.views.defaults import page_not_found from django.core.urlresolvers import reverse_lazy from layerindex.views import LayerListView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, RedirectParamsView, DuplicatesView diff --git a/layerindex/utils.py b/layerindex/utils.py index 440cc88..ebb89d3 100644 --- a/layerindex/utils.py +++ b/layerindex/utils.py @@ -57,12 +57,6 @@ def setup_django(): sys.path.append(newpath) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' - from django.core.management import setup_environ - from django.conf import settings - import settings - - setup_environ(settings) - def logger_create(name): logger = logging.getLogger(name) loggerhandler = logging.StreamHandler() diff --git a/manage.py b/manage.py index 0b219fb..0a64562 100644 --- a/manage.py +++ b/manage.py @@ -6,20 +6,14 @@ # # Copyright (c) Django Software Foundation and individual contributors. # All rights reserved. - +#!/usr/bin/env python import os - -from django.core.management import execute_manager -import imp -try: - imp.find_module('settings') # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) - sys.exit(1) - -import settings +import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") - execute_manager(settings) + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) + diff --git a/requirements.txt b/requirements.txt index cde88a0..ea5beee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,20 @@ -Django>=1.4,<1.5 -GitPython>=0.3.7 -Jinja2==2.7.3 +Django==1.6.11 +django-cors-headers==1.1.0 +django-nvd3==0.9.7 +django-registration==1.0 +django-reversion==1.8.7 +django-reversion-compare==0.4.0 +django-simple-captcha==0.4.6 +djangorestframework==3.2.5 +gitdb==0.6.4 +GitPython==2.0.5 +Jinja2==2.8 MarkupSafe==0.23 -Pillow>=2.4.0 -South==0.8.4 -Unidecode==0.04.16 -argparse==1.2.1 -awesome-slugify==1.5 -django-cors-headers==0.12 -django-nvd3==0.7.4 -django-registration==0.8 -django-reversion==1.6.6 -django-reversion-compare==0.3.5 -django-simple-captcha==0.4.2 -djangorestframework==2.3.14 -python-nvd3==0.12.2 -regex==2014.06.28 -six==1.7.3 -wsgiref==0.1.2 +mysqlclient==1.3.7 +Pillow==3.2.0 +python-nvd3==0.14.2 +python-slugify==1.1.4 +six==1.10.0 +smmap==0.9.0 +South==1.0.2 +Unidecode==0.4.19 diff --git a/settings.py b/settings.py index b21a5b4..b731a6b 100644 --- a/settings.py +++ b/settings.py @@ -131,7 +131,7 @@ TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - BASE_DIR + "/templates" + BASE_DIR + "/templates", ) INSTALLED_APPS = ( diff --git a/templates/404.html b/templates/404.html index 843d5bc..5bd5f75 100644 --- a/templates/404.html +++ b/templates/404.html @@ -22,7 +22,7 @@

The page you requested was not found.

-

Return to the front page

+

Return to the front page

{% endautoescape %} {% endblock %} diff --git a/templates/base.html b/templates/base.html index c872383..fedcfe2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -28,13 +28,13 @@ {% endif %} diff --git a/templates/layerindex/classic_base.html b/templates/layerindex/classic_base.html index eab56f2..7ba63f5 100644 --- a/templates/layerindex/classic_base.html +++ b/templates/layerindex/classic_base.html @@ -24,7 +24,7 @@ {% endautoescape %} @@ -48,9 +48,9 @@

OpenEmbedded-Classic (OE-Classic) is the name for the old monolithic version of OpenEmbedded. It contained a number of recipes some of which have not yet been migrated on top of OE-Core. To help people to find and migrate these recipes we provide an index here as well as some statistics to get an idea of the migration.

- Recipes - Unmigrated Recipes - Stats + Recipes + Unmigrated Recipes + Stats diff --git a/templates/layerindex/classicrecipedetail.html b/templates/layerindex/classicrecipedetail.html index 9df9a84..45d845f 100644 --- a/templates/layerindex/classicrecipedetail.html +++ b/templates/layerindex/classicrecipedetail.html @@ -21,7 +21,7 @@ {% autoescape on %} diff --git a/templates/layerindex/classicrecipes.html b/templates/layerindex/classicrecipes.html index 7fb62be..799dbb4 100644 --- a/templates/layerindex/classicrecipes.html +++ b/templates/layerindex/classicrecipes.html @@ -17,8 +17,8 @@ {% block navs %} {% autoescape on %} -
  • Recipes
  • -
  • Stats
  • +
  • Recipes
  • +
  • Stats
  • {% endautoescape %} {% endblock %} @@ -31,7 +31,7 @@

    OE-Classic recipes

    - NOTE: This is the recipe search for OE-Classic, the older monolithic version of OpenEmbedded which is no longer actively developed. Click here to search current recipes. + NOTE: This is the recipe search for OE-Classic, the older monolithic version of OpenEmbedded which is no longer actively developed. Click here to search current recipes.
    @@ -72,13 +72,13 @@ {% for recipe in recipe_list %} 0 %}class="muted"{% endif %}> - {{ recipe.name }} + {{ recipe.name }} {{ recipe.pv }} {{ recipe.short_desc }} {{ recipe.get_cover_desc }} {{ recipe.classic_category }} {% if multi_classic_layers %} - {{ recipe.layerbranch.layer.name }} + {{ recipe.layerbranch.layer.name }} {% endif %} {% endfor %} diff --git a/templates/layerindex/classicstats.html b/templates/layerindex/classicstats.html index 2fde01b..63d0b43 100644 --- a/templates/layerindex/classicstats.html +++ b/templates/layerindex/classicstats.html @@ -19,8 +19,8 @@ {% block navs %} {% autoescape on %} -
  • Recipes
  • -
  • Stats
  • +
  • Recipes
  • +
  • Stats
  • {% endautoescape %} {% endblock %} diff --git a/templates/layerindex/detail.html b/templates/layerindex/detail.html index feb2c6c..d0d11c0 100644 --- a/templates/layerindex/detail.html +++ b/templates/layerindex/detail.html @@ -22,7 +22,7 @@ {% autoescape on %} @@ -36,9 +36,9 @@ {% if user.is_authenticated %} {% if perms.layerindex.publish_layer or useredit %} - Edit layer + Edit layer {% if layeritem.layernote_set.count = 0 %} - Add note + Add note {% endif %} {% endif %} @@ -63,8 +63,8 @@ {% if perms.layerindex.publish_layer or useredit %}

    - Edit note - Delete note + Edit note + Delete note

    {% endif %}
    @@ -144,7 +144,7 @@

    The {{ layeritem.name }} layer depends upon:

    @@ -198,7 +198,7 @@ {% for recipe in layerbranch.sorted_recipes %} - {{ recipe.name }}{% if 'image' in recipe.inherits.split %}{% endif %}{% if recipe.blacklisted %}blacklisted{% endif %} + {{ recipe.name }}{% if 'image' in recipe.inherits.split %}{% endif %}{% if recipe.blacklisted %}blacklisted{% endif %} {{ recipe.pv }} {{ recipe.short_desc }} diff --git a/templates/layerindex/duplicates.html b/templates/layerindex/duplicates.html index 116aab9..0ebfe11 100644 --- a/templates/layerindex/duplicates.html +++ b/templates/layerindex/duplicates.html @@ -1,6 +1,5 @@ {% extends "base_toplevel.html" %} {% load i18n %} -{% load url from future %} {% comment %} diff --git a/templates/layerindex/editlayernote.html b/templates/layerindex/editlayernote.html index 1c7693c..abf8299 100644 --- a/templates/layerindex/editlayernote.html +++ b/templates/layerindex/editlayernote.html @@ -25,7 +25,7 @@ {% csrf_token %} {{ form.as_p }} -Cancel +Cancel {% endautoescape %} diff --git a/templates/layerindex/layers.html b/templates/layerindex/layers.html index 4ca43fc..cfc4ebd 100644 --- a/templates/layerindex/layers.html +++ b/templates/layerindex/layers.html @@ -18,9 +18,9 @@ {% block navs %} {% autoescape on %} -
  • Layers
  • -
  • Recipes
  • -
  • Machines
  • +
  • Layers
  • +
  • Recipes
  • +
  • Machines
  • {% endautoescape %} {% endblock %} @@ -71,7 +71,7 @@ {% for layerbranch in layerbranch_list %} - {{ layerbranch.layer.name }} + {{ layerbranch.layer.name }} {{ layerbranch.layer.summary }} {{ layerbranch.layer.get_layer_type_display }} diff --git a/templates/layerindex/machines.html b/templates/layerindex/machines.html index 1851937..e31433c 100644 --- a/templates/layerindex/machines.html +++ b/templates/layerindex/machines.html @@ -17,9 +17,9 @@ {% block navs %} {% autoescape on %} -
  • Layers
  • -
  • Recipes
  • -
  • Machines
  • +
  • Layers
  • +
  • Recipes
  • +
  • Machines
  • {% endautoescape %} {% endblock %} @@ -30,7 +30,7 @@
    -
    +
    @@ -52,7 +52,7 @@ {{ machine.name }} {{ machine.description }} - {{ machine.layerbranch.layer.name }} + {{ machine.layerbranch.layer.name }} {% endfor %} diff --git a/templates/layerindex/profile.html b/templates/layerindex/profile.html index 8edc451..d6d25ce 100644 --- a/templates/layerindex/profile.html +++ b/templates/layerindex/profile.html @@ -42,7 +42,7 @@ {% endfor %} - {% trans 'Cancel' %} + {% trans 'Cancel' %} {% csrf_token %} diff --git a/templates/layerindex/recipedetail.html b/templates/layerindex/recipedetail.html index 7dbb362..c0199a1 100644 --- a/templates/layerindex/recipedetail.html +++ b/templates/layerindex/recipedetail.html @@ -21,8 +21,8 @@ {% autoescape on %} @@ -36,7 +36,7 @@ {% if recipe.blacklisted %}
    -

    This recipe is blacklisted by the {{ recipe.layerbranch.layer.name }} layer. The reason provided is:

    +

    This recipe is blacklisted by the {{ recipe.layerbranch.layer.name }} layer. The reason provided is:

    {{ recipe.blacklisted }}

    @@ -92,7 +92,7 @@ Layer - {{ recipe.layerbranch.layer.name }} ({{ recipe.layerbranch.branch.name}} branch) + {{ recipe.layerbranch.layer.name }} ({{ recipe.layerbranch.branch.name}} branch) Inherits @@ -116,7 +116,7 @@ {% for append in verappends %} - {{ append.layerbranch.layer.name }} + {{ append.layerbranch.layer.name }} {{ append.filename }} @@ -127,7 +127,7 @@ {% if not append in verappends %} - {{ append.layerbranch.layer.name }} + {{ append.layerbranch.layer.name }} {{ append.filename }} diff --git a/templates/layerindex/recipes.html b/templates/layerindex/recipes.html index c2141a4..74f3bb4 100644 --- a/templates/layerindex/recipes.html +++ b/templates/layerindex/recipes.html @@ -17,9 +17,9 @@ {% block navs %} {% autoescape on %} -
  • Layers
  • -
  • Recipes
  • -
  • Machines
  • +
  • Layers
  • +
  • Recipes
  • +
  • Machines
  • {% endautoescape %} {% endblock %} @@ -31,7 +31,7 @@
    -
    +
    @@ -52,10 +52,10 @@ {% for recipe in recipe_list %} 0 %}class="muted"{% endif %}> - {{ recipe.name }}{% if 'image' in recipe.inherits.split %}{% endif %}{% if recipe.blacklisted %}blacklisted{% endif %} + {{ recipe.name }}{% if 'image' in recipe.inherits.split %}{% endif %}{% if recipe.blacklisted %}blacklisted{% endif %} {{ recipe.pv }} {{ recipe.short_desc }} - {{ recipe.layerbranch.layer.name }} + {{ recipe.layerbranch.layer.name }} {% endfor %} diff --git a/templates/layerindex/reviewdetail.html b/templates/layerindex/reviewdetail.html index 5840e25..cff1731 100644 --- a/templates/layerindex/reviewdetail.html +++ b/templates/layerindex/reviewdetail.html @@ -35,14 +35,14 @@ {% if user.is_authenticated %} {% if perms.layerindex.publish_layer or useredit %} - Edit layer + Edit layer {% if layeritem.layernote_set.count = 0 %} - Add note + Add note {% endif %} {% endif %} {% if layeritem.status = "N" and perms.layerindex.publish_layer %} - Delete layer - Publish layer + Delete layer + Publish layer {% endif %} {% endif %} @@ -58,8 +58,8 @@

    {{ note.text }}

    {% if perms.layerindex.publish_layer or useredit %}

    - Edit note - Delete note + Edit note + Delete note

    {% endif %}
    @@ -163,7 +163,7 @@ diff --git a/templates/layerindex/reviewlist.html b/templates/layerindex/reviewlist.html index d20001a..eaa24e4 100644 --- a/templates/layerindex/reviewlist.html +++ b/templates/layerindex/reviewlist.html @@ -36,7 +36,7 @@ {% for layerbranch in layerbranch_list %} - {{ layerbranch.layer.name }} + {{ layerbranch.layer.name }} {{ layerbranch.layer.summary }} {{ layerbranch.layer.get_layer_type_display }} diff --git a/templates/registration/activate.html b/templates/registration/activate.html index e85121e..6e24890 100644 --- a/templates/registration/activate.html +++ b/templates/registration/activate.html @@ -7,7 +7,7 @@

    {% trans "Account successfully activated" %}

    -

    {% trans "Log in" %}

    +

    {% trans "Log in" %}

    {% else %} diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt index 0820fce..736ea8a 100644 --- a/templates/registration/activation_email.txt +++ b/templates/registration/activation_email.txt @@ -7,7 +7,7 @@ link is valid for {{ expiration_days }} days. {% endblocktrans %} -http://{{ site.domain }}{% url registration_activate activation_key %} +http://{{ site.domain }}{% url "registration_activate" activation_key %} {% blocktrans %} If you did not make this request, please ignore this message. diff --git a/templates/registration/login.html b/templates/registration/login.html index 7e3d615..7f8a153 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -10,8 +10,8 @@ {% csrf_token %} -

    {% trans "Forgot password" %}? {% trans "Reset it" %}!

    -

    {% trans "Don't have an account" %}? {% trans "Create one now" %}!

    +

    {% trans "Forgot password" %}? {% trans "Reset it" %}!

    +

    {% trans "Don't have an account" %}? {% trans "Create one now" %}!

    {% endblock %} diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html index ef3637c..d9f3879 100644 --- a/templates/registration/password_reset_complete.html +++ b/templates/registration/password_reset_complete.html @@ -5,6 +5,6 @@

    {% trans "Password reset successfully" %}

    -

    {% trans "Log in" %}

    +

    {% trans "Log in" %}

    {% endblock %} diff --git a/templates/registration/password_reset_email.html b/templates/registration/password_reset_email.html index a55c869..f219c68 100644 --- a/templates/registration/password_reset_email.html +++ b/templates/registration/password_reset_email.html @@ -1,5 +1,5 @@ {% load i18n %} {% blocktrans %}Reset password at {{ site_name }}{% endblocktrans %}: {% block reset_link %} -{{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uidb36=uid, token=token %} +{{ protocol }}://{{ domain }}{% url "auth_password_reset_confirm" uidb36=uid, token=token %} {% endblock %} diff --git a/urls.py b/urls.py index aa4f8c5..98fc734 100644 --- a/urls.py +++ b/urls.py @@ -5,8 +5,8 @@ # Copyright (c) Django Software Foundation and individual contributors. # All rights reserved. -from django.conf.urls.defaults import patterns, include, url -from django.views.generic.simple import redirect_to +from django.conf.urls import patterns, include, url +from django.views.generic import RedirectView from django.contrib import admin admin.autodiscover() @@ -16,6 +16,6 @@ urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^captcha/', include('captcha.urls')), - url(r'.*', redirect_to, {'url' : '/layerindex/'}) + url(r'.*', RedirectView.as_view(url='/layerindex/')), )