Browse Source

Move "vpn" app to toplevel directory

This conforms to the "new" Django organisation: Django apps live outside
of the Django project.  Also, it is more logical because the VPN
application should be optional in Coin.

This change is necessary to be able to use Django's application features
https://docs.djangoproject.com/en/1.7/ref/applications/

(see #57 for details)
Baptiste Jonglez 8 years ago
parent
commit
ffd046c779

+ 1 - 1
coin/settings.py

@@ -162,7 +162,7 @@ INSTALLED_APPS = (
     'coin.resources',
     'coin.resources',
     'coin.reverse_dns',
     'coin.reverse_dns',
     'coin.configuration',
     'coin.configuration',
-    'coin.vpn',
+    'vpn',
     'coin.isp_database',
     'coin.isp_database',
     'simple_dsl'
     'simple_dsl'
 )
 )

+ 1 - 1
coin/urls.py

@@ -25,7 +25,7 @@ urlpatterns = patterns(
     url(r'^members/', include('coin.members.urls', namespace='members')),
     url(r'^members/', include('coin.members.urls', namespace='members')),
     url(r'^billing/', include('coin.billing.urls', namespace='billing')),
     url(r'^billing/', include('coin.billing.urls', namespace='billing')),
     url(r'^subscription/', include('coin.offers.urls', namespace='subscription')),
     url(r'^subscription/', include('coin.offers.urls', namespace='subscription')),
-    url(r'^vpn/', include('coin.vpn.urls', namespace='vpn')),
+    url(r'^vpn/', include('vpn.urls', namespace='vpn')),
 
 
     url(r'^admin/', include(admin.site.urls)),
     url(r'^admin/', include(admin.site.urls)),
 
 

coin/vpn/__init__.py → vpn/__init__.py


+ 2 - 1
coin/vpn/admin.py

@@ -4,10 +4,11 @@ from __future__ import unicode_literals
 from django.contrib import admin
 from django.contrib import admin
 from polymorphic.admin import PolymorphicChildModelAdmin
 from polymorphic.admin import PolymorphicChildModelAdmin
 
 
-from coin.vpn.models import VPNConfiguration
 from coin.configuration.admin import ConfigurationAdminFormMixin
 from coin.configuration.admin import ConfigurationAdminFormMixin
 from coin.utils import delete_selected
 from coin.utils import delete_selected
 
 
+from .models import VPNConfiguration
+
 
 
 class VPNConfigurationInline(admin.StackedInline):
 class VPNConfigurationInline(admin.StackedInline):
     model = VPNConfiguration
     model = VPNConfiguration

coin/vpn/migrations/0001_initial.py → vpn/migrations/0001_initial.py


coin/vpn/migrations/0002_remove_vpnconfiguration_comment.py → vpn/migrations/0002_remove_vpnconfiguration_comment.py


coin/vpn/migrations/__init__.py → vpn/migrations/__init__.py


coin/vpn/models.py → vpn/models.py


coin/vpn/templates/vpn/fragments/password.html → vpn/templates/vpn/fragments/password.html


coin/vpn/templates/vpn/vpn.html → vpn/templates/vpn/vpn.html


+ 2 - 1
coin/vpn/tests.py

@@ -4,11 +4,12 @@ from __future__ import unicode_literals
 from django.test import TestCase
 from django.test import TestCase
 
 
 from coin.offers.models import Offer, OfferSubscription
 from coin.offers.models import Offer, OfferSubscription
-from coin.vpn.models import VPNConfiguration
 from coin.resources.models import IPPool, IPSubnet
 from coin.resources.models import IPPool, IPSubnet
 from coin.members.models import Member
 from coin.members.models import Member
 from coin.members.tests import MemberTestsUtils
 from coin.members.tests import MemberTestsUtils
 
 
+from .models import VPNConfiguration
+
 
 
 class VPNTestCase(TestCase):
 class VPNTestCase(TestCase):
     fixtures = ['example_pools.json', 'offers.json']
     fixtures = ['example_pools.json', 'offers.json']

+ 2 - 1
coin/vpn/urls.py

@@ -2,7 +2,8 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
 from django.conf.urls import patterns, url
 from django.conf.urls import patterns, url
-from coin.vpn.views import VPNView, VPNGeneratePasswordView, get_graph
+
+from .views import VPNView, VPNGeneratePasswordView, get_graph
 
 
 urlpatterns = patterns(
 urlpatterns = patterns(
     '',
     '',

+ 2 - 1
coin/vpn/views.py

@@ -14,7 +14,8 @@ from django.contrib.auth.decorators import login_required
 from django.utils.decorators import method_decorator
 from django.utils.decorators import method_decorator
 
 
 from coin.members.models import Member
 from coin.members.models import Member
-from coin.vpn.models import VPNConfiguration
+
+from .models import VPNConfiguration
 
 
 
 
 class VPNView(SuccessMessageMixin, UpdateView):
 class VPNView(SuccessMessageMixin, UpdateView):