Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Make the project self-contained

Patryk Zawadzki087f362e086d
diff --git a/cart/urls.py b/cart/urls.py
deleted file mode 100644
index 5342435410..0000000000
--- a/cart/urls.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns('cart.views',
- url(r'^$', 'index', name='index'),
-)
diff --git a/checkout/urls.py b/checkout/urls.py
deleted file mode 100644
index 9eabdc99a3..0000000000
--- a/checkout/urls.py
+++ /dev/null
@@ -1,7 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns('checkout.views',
- url(r'^$', 'details', kwargs={'step': None}, name='index'),
- url(r'^(?P<step>[a-z0-9-]+)/$', 'details', name='details')
-)
diff --git a/manage.py b/manage.py
index de46e4e0a3..32f2695e25 100755
--- a/manage.py
+++ b/manage.py
@@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings")
from django.core.management import execute_from_command_line
diff --git a/order/urls.py b/order/urls.py
deleted file mode 100644
index 50e84b25e4..0000000000
--- a/order/urls.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from django.conf.urls import patterns, url, include
-
-TOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'
- '-[0-9a-z]{12})')
-
-urlpatterns = patterns('order.views',
- url(r'^%s/$' % TOKEN_PATTERN, 'details', name='details'),
- url(r'^%s/success/$' % TOKEN_PATTERN, 'success', name='success'),
- url(r'^%s/' % TOKEN_PATTERN, include('payment.urls', namespace='payment'))
-)
diff --git a/payment/urls.py b/payment/urls.py
deleted file mode 100644
index 009e9ba029..0000000000
--- a/payment/urls.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns('payment.views',
- url(r'^payment/$', 'index', name='index'),
- url(r'^remove/$', 'delete', name='delete'),
- url(r'^(?P<variant>[a-z-]+)/$', 'details', name='details')
-)
diff --git a/product/urls.py b/product/urls.py
deleted file mode 100644
index 78285969f3..0000000000
--- a/product/urls.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns('product.views',
- url(r'^(?P<slug>[a-z0-9-]+?)-(?P<product_id>[0-9]+)/$', 'product_details',
- name='details'),
- url(r'^category/(?P<slug>[a-z0-9-]+?)/$', 'category_index',
- name='category')
-)
diff --git a/registration/urls.py b/registration/urls.py
deleted file mode 100644
index 2f6be6d6a7..0000000000
--- a/registration/urls.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns(
- '',
- url(r'^login/$', 'registration.views.login', name='login'),
- url(r'^logout/$', 'registration.views.logout', name='logout'),
- url(r'^oauth_callback/(?P<service>\w+)/$',
- 'registration.views.oauth_callback',
- name='oauth_callback'),
- url(r'^change_password/$',
- 'registration.views.change_password',
- name='change_password'),
- url(r'^request_email_confirmation/$',
- 'registration.views.request_email_confirmation',
- name='request_email_confirmation'),
- url(r'^confirm_email/(?P<token>\w+)/$',
- 'registration.views.confirm_email',
- name='confirm_email'),
- url(r'^request_email_change/$',
- 'registration.views.request_email_change',
- name='request_email_change'),
- url(r'^change_email/(?P<token>\w+)/$',
- 'registration.views.change_email',
- name='change_email'))
diff --git a/saleor/migrations/0001_initial.py b/saleor/migrations/0001_initial.py
deleted file mode 100644
index b482396cf1..0000000000
--- a/saleor/migrations/0001_initial.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'User'
- db.create_table(u'saleor_user', (
- (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('password', self.gf('django.db.models.fields.CharField')(max_length=128)),
- ('last_login', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
- ('is_superuser', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('email', self.gf('django.db.models.fields.EmailField')(unique=True, max_length=75)),
- ('is_staff', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
- ('date_joined', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
- ))
- db.send_create_signal(u'saleor', ['User'])
-
- # Adding M2M table for field groups on 'User'
- db.create_table(u'saleor_user_groups', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('user', models.ForeignKey(orm[u'saleor.user'], null=False)),
- ('group', models.ForeignKey(orm[u'auth.group'], null=False))
- ))
- db.create_unique(u'saleor_user_groups', ['user_id', 'group_id'])
-
- # Adding M2M table for field user_permissions on 'User'
- db.create_table(u'saleor_user_user_permissions', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('user', models.ForeignKey(orm[u'saleor.user'], null=False)),
- ('permission', models.ForeignKey(orm[u'auth.permission'], null=False))
- ))
- db.create_unique(u'saleor_user_user_permissions', ['user_id', 'permission_id'])
-
- def backwards(self, orm):
- # Deleting model 'User'
- db.delete_table(u'saleor_user')
-
- # Removing M2M table for field groups on 'User'
- db.delete_table('saleor_user_groups')
-
- # Removing M2M table for field user_permissions on 'User'
- db.delete_table('saleor_user_user_permissions')
-
- models = {
- u'auth.group': {
- 'Meta': {'object_name': 'Group'},
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
- 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
- },
- u'auth.permission': {
- 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
- 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- u'contenttypes.contenttype': {
- 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
- 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
- },
- u'saleor.user': {
- 'Meta': {'object_name': 'User'},
- 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}),
- 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
- 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
- }
- }
-
- complete_apps = ['saleor']
diff --git a/saleor/migrations/0002_auto__del_field_user_is_superuser.py b/saleor/migrations/0002_auto__del_field_user_is_superuser.py
deleted file mode 100644
index 07ac6b3eb8..0000000000
--- a/saleor/migrations/0002_auto__del_field_user_is_superuser.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Deleting field 'User.is_superuser'
- db.delete_column(u'saleor_user', 'is_superuser')
-
- # Removing M2M table for field groups on 'User'
- db.delete_table('saleor_user_groups')
-
- # Removing M2M table for field user_permissions on 'User'
- db.delete_table('saleor_user_user_permissions')
-
-
- def backwards(self, orm):
- # Adding field 'User.is_superuser'
- db.add_column(u'saleor_user', 'is_superuser',
- self.gf('django.db.models.fields.BooleanField')(default=False),
- keep_default=False)
-
- # Adding M2M table for field groups on 'User'
- db.create_table(u'saleor_user_groups', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('user', models.ForeignKey(orm[u'saleor.user'], null=False)),
- ('group', models.ForeignKey(orm[u'auth.group'], null=False))
- ))
- db.create_unique(u'saleor_user_groups', ['user_id', 'group_id'])
-
- # Adding M2M table for field user_permissions on 'User'
- db.create_table(u'saleor_user_user_permissions', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('user', models.ForeignKey(orm[u'saleor.user'], null=False)),
- ('permission', models.ForeignKey(orm[u'auth.permission'], null=False))
- ))
- db.create_unique(u'saleor_user_user_permissions', ['user_id', 'permission_id'])
-
-
- models = {
- u'saleor.user': {
- 'Meta': {'object_name': 'User'},
- 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}),
- u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
- 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'})
- }
- }
-
- complete_apps = ['saleor']
\ No newline at end of file
diff --git a/saleor/migrations/0003_auto__del_user.py b/saleor/migrations/0003_auto__del_user.py
deleted file mode 100644
index 9d5948e33f..0000000000
--- a/saleor/migrations/0003_auto__del_user.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Deleting model 'User'
- db.delete_table(u'saleor_user')
-
-
- def backwards(self, orm):
- # Adding model 'User'
- db.create_table(u'saleor_user', (
- ('is_staff', self.gf('django.db.models.fields.BooleanField')(default=False)),
- (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('last_login', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
- ('password', self.gf('django.db.models.fields.CharField')(max_length=128)),
- ('is_active', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, unique=True)),
- ('date_joined', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
- ))
- db.send_create_signal(u'saleor', ['User'])
-
-
- models = {
-
- }
-
- complete_apps = ['saleor']
\ No newline at end of file
diff --git a/saleor/urls.py b/saleor/urls.py
deleted file mode 100644
index 05d3855fe0..0000000000
--- a/saleor/urls.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from django.conf import settings
-from django.conf.urls import patterns, url, include
-from django.contrib import admin
-
-
-admin.autodiscover()
-
-urlpatterns = patterns(
- '',
- url(r'^$', 'saleor.views.home', name='home'),
- url(r'^account/', include('registration.urls', namespace='registration')),
- url(r'^admin/', include(admin.site.urls)),
- url(r'^cart/', include('cart.urls', namespace='cart')),
- url(r'^checkout/', include('checkout.urls', namespace='checkout')),
- url(r'^images/', include('django_images.urls')),
- url(r'^order/', include('order.urls', namespace='order')),
- url(r'^products/', include('product.urls', namespace='product')),
- url(r'^profile/', include('userprofile.urls', namespace='profile')),
- url(r'^', include('payments.urls'))
-)
-
-if settings.DEBUG:
- # static files (images, css, javascript, etc.)
- urlpatterns += patterns(
- '',
- url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT}))
diff --git a/setup.py b/setup.py
index e122d2bc99..9fe5c07e41 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
from setuptools import setup, find_packages, Command
import os
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'saleor.settings')
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shop.settings')
class Command(Command):
@@ -33,7 +33,7 @@ setup(
'requests>=1.2.0',
'unidecode'],
entry_points={
- 'console_scripts': ['saleor = saleor:manage']},
+ 'console_scripts': ['saleor = shop:manage']},
tests_require=[
'mock==1.0.1',
'purl>=0.4.1',
diff --git a/saleor/__init__.py b/shop/__init__.py
similarity index 70%
rename from saleor/__init__.py
rename to shop/__init__.py
index 4fe58bb95c..33f8e739b5 100644
--- a/saleor/__init__.py
+++ b/shop/__init__.py
@@ -6,5 +6,5 @@ def manage():
import sys
from django.core.management import execute_from_command_line
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings")
execute_from_command_line(sys.argv)
diff --git a/cart/__init__.py b/shop/cart/__init__.py
similarity index 97%
rename from cart/__init__.py
rename to shop/cart/__init__.py
index cf0b7b4917..0c9a6e8694 100755
--- a/cart/__init__.py
+++ b/shop/cart/__init__.py
@@ -2,8 +2,8 @@ from django.utils.translation import pgettext
from satchless import cart
from satchless.item import ItemSet, ClassifyingPartitioner
-from delivery import DummyShipping, DigitalDelivery
-from product.models import DigitalShip
+from ..delivery import DummyShipping, DigitalDelivery
+from ..product.models import DigitalShip
class BaseGroup(list, ItemSet):
diff --git a/cart/forms.py b/shop/cart/forms.py
similarity index 100%
rename from cart/forms.py
rename to shop/cart/forms.py
diff --git a/cart/middleware.py b/shop/cart/middleware.py
similarity index 96%
rename from cart/middleware.py
rename to shop/cart/middleware.py
index ec846b9cd1..44705fd239 100644
--- a/cart/middleware.py
+++ b/shop/cart/middleware.py
@@ -1,4 +1,4 @@
-from cart import Cart
+from . import Cart
class CartMiddleware(object):
diff --git a/cart/migrations/0001_initial.py b/shop/cart/migrations/0001_initial.py
similarity index 100%
rename from cart/migrations/0001_initial.py
rename to shop/cart/migrations/0001_initial.py
diff --git a/cart/migrations/__init__.py b/shop/cart/migrations/__init__.py
similarity index 100%
rename from cart/migrations/__init__.py
rename to shop/cart/migrations/__init__.py
diff --git a/cart/models.py b/shop/cart/models.py
similarity index 100%
rename from cart/models.py
rename to shop/cart/models.py
diff --git a/cart/templates/cart/index.html b/shop/cart/templates/cart/index.html
similarity index 100%
rename from cart/templates/cart/index.html
rename to shop/cart/templates/cart/index.html
diff --git a/cart/tests.py b/shop/cart/tests.py
similarity index 96%
rename from cart/tests.py
rename to shop/cart/tests.py
index 838eaff443..6f90aa24bd 100755
--- a/cart/tests.py
+++ b/shop/cart/tests.py
@@ -1,13 +1,14 @@
-from cart import Cart, BaseGroup
-from cart.forms import AddToCartForm, ReplaceCartLineForm, \
- ReplaceCartLineFormSet
-from delivery import BaseDelivery
from django.test import TestCase
from prices import Price
-from product.models import Product, StockedProduct, PhysicalProduct
from satchless.item import InsufficientStock
from satchless.cart import CartLine
+from . import Cart, BaseGroup
+from .forms import AddToCartForm, ReplaceCartLineForm, \
+ ReplaceCartLineFormSet
+from ..delivery import BaseDelivery
+from ..product.models import Product, StockedProduct, PhysicalProduct
+
__all__ = ['CartTest', 'GroupTest', 'AddToCartFormTest']
diff --git a/shop/cart/urls.py b/shop/cart/urls.py
new file mode 100644
index 0000000000..a84079e4e9
--- /dev/null
+++ b/shop/cart/urls.py
@@ -0,0 +1,9 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^$', views.index, name='index')
+)
diff --git a/cart/views.py b/shop/cart/views.py
similarity index 100%
rename from cart/views.py
rename to shop/cart/views.py
diff --git a/checkout/__init__.py b/shop/checkout/__init__.py
similarity index 96%
rename from checkout/__init__.py
rename to shop/checkout/__init__.py
index 6b5fb0e2c8..7ffaa2d2a8 100644
--- a/checkout/__init__.py
+++ b/shop/checkout/__init__.py
@@ -1,10 +1,12 @@
-from .steps import (BillingAddressStep, ShippingStep, DigitalDeliveryStep,
- SummaryStep)
-from cart import CartPartitioner, DigitalGroup, remove_cart_from_request
from collections import defaultdict
-from order.models import Order
+
from satchless.process import ProcessManager
+from .steps import (BillingAddressStep, ShippingStep, DigitalDeliveryStep,
+ SummaryStep)
+from ..cart import CartPartitioner, DigitalGroup, remove_cart_from_request
+from ..order.models import Order
+
STORAGE_SESSION_KEY = 'checkout_storage'
diff --git a/checkout/forms.py b/shop/checkout/forms.py
similarity index 94%
rename from checkout/forms.py
rename to shop/checkout/forms.py
index 3c19864fe0..120ca7e642 100644
--- a/checkout/forms.py
+++ b/shop/checkout/forms.py
@@ -2,8 +2,9 @@ from django import forms
from django.contrib.auth.models import AnonymousUser
from django.core import validators
from django.core.exceptions import ValidationError
-from order.models import DigitalDeliveryGroup
-from userprofile.forms import AddressForm
+
+from ..order.models import DigitalDeliveryGroup
+from ..userprofile.forms import AddressForm
class ShippingForm(AddressForm):
diff --git a/checkout/models.py b/shop/checkout/models.py
similarity index 100%
rename from checkout/models.py
rename to shop/checkout/models.py
diff --git a/checkout/steps.py b/shop/checkout/steps.py
similarity index 96%
rename from checkout/steps.py
rename to shop/checkout/steps.py
index 36980d6781..67a18d5581 100644
--- a/checkout/steps.py
+++ b/shop/checkout/steps.py
@@ -1,15 +1,15 @@
from django.forms.models import model_to_dict
-from checkout.forms import AnonymousEmailForm
from django.core.exceptions import ValidationError
from django.db import models
from django.shortcuts import redirect
-from order.models import DigitalDeliveryGroup, ShippedDeliveryGroup
-from saleor.utils import BaseStep
from satchless.process import InvalidData
-from userprofile.forms import AddressForm, UserAddressesForm
-from userprofile.models import Address
from .forms import DigitalDeliveryForm, DeliveryForm
+from ..checkout.forms import AnonymousEmailForm
+from ..core.utils import BaseStep
+from ..order.models import DigitalDeliveryGroup, ShippedDeliveryGroup
+from ..userprofile.forms import AddressForm, UserAddressesForm
+from ..userprofile.models import Address
class BaseCheckoutStep(BaseStep):
diff --git a/checkout/templates/checkout/address.html b/shop/checkout/templates/checkout/address.html
similarity index 100%
rename from checkout/templates/checkout/address.html
rename to shop/checkout/templates/checkout/address.html
diff --git a/checkout/templates/checkout/billing.html b/shop/checkout/templates/checkout/billing.html
similarity index 100%
rename from checkout/templates/checkout/billing.html
rename to shop/checkout/templates/checkout/billing.html
diff --git a/checkout/templates/checkout/details.html b/shop/checkout/templates/checkout/details.html
similarity index 100%
rename from checkout/templates/checkout/details.html
rename to shop/checkout/templates/checkout/details.html
diff --git a/checkout/templates/checkout/digitaldelivery.html b/shop/checkout/templates/checkout/digitaldelivery.html
similarity index 100%
rename from checkout/templates/checkout/digitaldelivery.html
rename to shop/checkout/templates/checkout/digitaldelivery.html
diff --git a/checkout/templates/checkout/shipping.html b/shop/checkout/templates/checkout/shipping.html
similarity index 100%
rename from checkout/templates/checkout/shipping.html
rename to shop/checkout/templates/checkout/shipping.html
diff --git a/checkout/templates/checkout/summary.html b/shop/checkout/templates/checkout/summary.html
similarity index 100%
rename from checkout/templates/checkout/summary.html
rename to shop/checkout/templates/checkout/summary.html
diff --git a/checkout/tests.py b/shop/checkout/tests.py
similarity index 97%
rename from checkout/tests.py
rename to shop/checkout/tests.py
index a78dad7b1d..c4af16859e 100644
--- a/checkout/tests.py
+++ b/shop/checkout/tests.py
@@ -1,11 +1,11 @@
-from checkout import Checkout
-from checkout.steps import BaseAddressStep
-from delivery import DummyShipping
from django.test import TestCase
from mock import MagicMock, patch
-from userprofile.models import Address
from . import BillingAddressStep, ShippingStep
+from ..checkout import Checkout
+from ..checkout.steps import BaseAddressStep
+from ..delivery import DummyShipping
+from ..userprofile.models import Address
NEW_ADDRESS = {
'first_name': 'Test',
diff --git a/shop/checkout/urls.py b/shop/checkout/urls.py
new file mode 100644
index 0000000000..7d3df24519
--- /dev/null
+++ b/shop/checkout/urls.py
@@ -0,0 +1,10 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^$', views.details, kwargs={'step': None}, name='index'),
+ url(r'^(?P<step>[a-z0-9-]+)/$', views.details, name='details')
+)
diff --git a/checkout/views.py b/shop/checkout/views.py
similarity index 93%
rename from checkout/views.py
rename to shop/checkout/views.py
index c9f508dde1..90c69b92f2 100644
--- a/checkout/views.py
+++ b/shop/checkout/views.py
@@ -1,7 +1,8 @@
-from checkout import Checkout
from django.http.response import Http404
from django.shortcuts import redirect
+from . import Checkout
+
def details(request, step):
if not request.cart:
diff --git a/communication/__init__.py b/shop/communication/__init__.py
similarity index 100%
rename from communication/__init__.py
rename to shop/communication/__init__.py
diff --git a/communication/mail.py b/shop/communication/mail.py
similarity index 100%
rename from communication/mail.py
rename to shop/communication/mail.py
diff --git a/communication/tests.py b/shop/communication/tests.py
similarity index 88%
rename from communication/tests.py
rename to shop/communication/tests.py
index 24ba0894b4..3c8b4430a6 100644
--- a/communication/tests.py
+++ b/shop/communication/tests.py
@@ -1,19 +1,18 @@
-from communication.mail import SUBJECT, TEXT, HTML, send_email, render_blocks
-
+from django.template.loader_tags import BlockNode
from mock import Mock, patch, sentinel
from unittest2 import TestCase
-from django.template.loader_tags import BlockNode
+from .mail import SUBJECT, TEXT, HTML, send_email, render_blocks
class SendEmailTestCase(TestCase):
def setUp(self):
- patcher = patch('communication.mail.settings')
+ patcher = patch('shop.communication.mail.settings')
self.settings_mock = patcher.start()
- patcher = patch('communication.mail.render_blocks')
+ patcher = patch('shop.communication.mail.render_blocks')
self.render_mock = patcher.start()
- patcher = patch('communication.mail.EmailMultiAlternatives')
+ patcher = patch('shop.communication.mail.EmailMultiAlternatives')
self.email_mock = patcher.start()
self.settings_mock.DEFAULT_FROM_EMAIL = sentinel.from_email
@@ -54,8 +53,8 @@ class SendEmailTestCase(TestCase):
class RenderBlocksTestCase(TestCase):
- @patch('communication.mail.get_template')
- @patch('communication.mail.Context')
+ @patch('shop.communication.mail.get_template')
+ @patch('shop.communication.mail.Context')
def test_block_rendering(self, context_mock, get_template_mock):
"""Template blocks are rendered with proper context"""
html_block = Mock(spec=BlockNode)
diff --git a/order/migrations/__init__.py b/shop/core/__init__.py
similarity index 100%
rename from order/migrations/__init__.py
rename to shop/core/__init__.py
diff --git a/saleor/context_processors.py b/shop/core/context_processors.py
similarity index 100%
rename from saleor/context_processors.py
rename to shop/core/context_processors.py
diff --git a/saleor/countries.py b/shop/core/countries.py
similarity index 100%
rename from saleor/countries.py
rename to shop/core/countries.py
diff --git a/saleor/middleware.py b/shop/core/middleware.py
similarity index 100%
rename from saleor/middleware.py
rename to shop/core/middleware.py
diff --git a/saleor/models.py b/shop/core/models.py
similarity index 100%
rename from saleor/models.py
rename to shop/core/models.py
diff --git a/saleor/templates/bootstrap/_field_horizontal.html b/shop/core/templates/bootstrap/_field_horizontal.html
similarity index 100%
rename from saleor/templates/bootstrap/_field_horizontal.html
rename to shop/core/templates/bootstrap/_field_horizontal.html
diff --git a/saleor/templates/bootstrap/_field_vertical.html b/shop/core/templates/bootstrap/_field_vertical.html
similarity index 100%
rename from saleor/templates/bootstrap/_field_vertical.html
rename to shop/core/templates/bootstrap/_field_vertical.html
diff --git a/saleor/templates/bootstrap/_non_field_errors.html b/shop/core/templates/bootstrap/_non_field_errors.html
similarity index 100%
rename from saleor/templates/bootstrap/_non_field_errors.html
rename to shop/core/templates/bootstrap/_non_field_errors.html
diff --git a/payment/migrations/__init__.py b/shop/core/templatetags/__init__.py
similarity index 100%
rename from payment/migrations/__init__.py
rename to shop/core/templatetags/__init__.py
diff --git a/saleor/templatetags/bootstrap.py b/shop/core/templatetags/bootstrap.py
similarity index 100%
rename from saleor/templatetags/bootstrap.py
rename to shop/core/templatetags/bootstrap.py
diff --git a/saleor/templatetags/saleor.py b/shop/core/templatetags/saleor.py
similarity index 100%
rename from saleor/templatetags/saleor.py
rename to shop/core/templatetags/saleor.py
diff --git a/saleor/tests/__init__.py b/shop/core/tests/__init__.py
similarity index 100%
rename from saleor/tests/__init__.py
rename to shop/core/tests/__init__.py
diff --git a/shop/core/urls.py b/shop/core/urls.py
new file mode 100644
index 0000000000..616c8f41b4
--- /dev/null
+++ b/shop/core/urls.py
@@ -0,0 +1,9 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^$', views.home, name='home')
+)
diff --git a/saleor/utils.py b/shop/core/utils/__init__.py
similarity index 96%
rename from saleor/utils.py
rename to shop/core/utils/__init__.py
index 4a50eb1d87..f72790b6be 100644
--- a/saleor/utils.py
+++ b/shop/core/utils/__init__.py
@@ -15,7 +15,8 @@ __all__ = ['BaseStep', 'CategoryChoiceField', 'build_absolute_uri']
class CategoryChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
- level = getattr(obj, obj._mptt_meta.level_attr) # pylint: disable=W0212
+ # pylint: disable=W0212
+ level = getattr(obj, obj._mptt_meta.level_attr)
indent = max(0, level - 1) * u'│'
if obj.parent:
last = ((obj.parent.rght - obj.rght == 1)
diff --git a/utils/models.py b/shop/core/utils/models.py
similarity index 100%
rename from utils/models.py
rename to shop/core/utils/models.py
diff --git a/saleor/views.py b/shop/core/views.py
similarity index 100%
rename from saleor/views.py
rename to shop/core/views.py
diff --git a/delivery/__init__.py b/shop/delivery/__init__.py
similarity index 100%
rename from delivery/__init__.py
rename to shop/delivery/__init__.py
diff --git a/order/__init__.py b/shop/order/__init__.py
similarity index 93%
rename from order/__init__.py
rename to shop/order/__init__.py
index 45fb28ece2..5b081928d3 100644
--- a/order/__init__.py
+++ b/shop/order/__init__.py
@@ -1,7 +1,8 @@
from django.shortcuts import get_object_or_404, redirect
-from order.models import Order
from functools import wraps
+from .models import Order
+
def check_order_status(func):
diff --git a/order/admin.py b/shop/order/admin.py
similarity index 98%
rename from order/admin.py
rename to shop/order/admin.py
index 472ef45c48..3e822a7d5e 100644
--- a/order/admin.py
+++ b/shop/order/admin.py
@@ -1,9 +1,10 @@
-from .models import Order, OrderedItem
from django import forms
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from django.forms.models import model_to_dict, BaseInlineFormSet
-from payment.models import Payment
+
+from .models import Order, OrderedItem
+from ..payment.models import Payment
class OrderModelAdmin(ModelAdmin):
diff --git a/order/migrations/0001_initial.py b/shop/order/migrations/0001_initial.py
similarity index 100%
rename from order/migrations/0001_initial.py
rename to shop/order/migrations/0001_initial.py
diff --git a/order/migrations/0002_auto__del_field_order_billing_last_name__del_field_order_billing_count.py b/shop/order/migrations/0002_auto__del_field_order_billing_last_name__del_field_order_billing_count.py
similarity index 100%
rename from order/migrations/0002_auto__del_field_order_billing_last_name__del_field_order_billing_count.py
rename to shop/order/migrations/0002_auto__del_field_order_billing_last_name__del_field_order_billing_count.py
diff --git a/order/migrations/0003_auto__add_digitaldeliverygroup__add_shippeddeliverygroup__del_field_de.py b/shop/order/migrations/0003_auto__add_digitaldeliverygroup__add_shippeddeliverygroup__del_field_de.py
similarity index 100%
rename from order/migrations/0003_auto__add_digitaldeliverygroup__add_shippeddeliverygroup__del_field_de.py
rename to shop/order/migrations/0003_auto__add_digitaldeliverygroup__add_shippeddeliverygroup__del_field_de.py
diff --git a/order/migrations/0004_auto__chg_field_shippeddeliverygroup_address.py b/shop/order/migrations/0004_auto__chg_field_shippeddeliverygroup_address.py
similarity index 100%
rename from order/migrations/0004_auto__chg_field_shippeddeliverygroup_address.py
rename to shop/order/migrations/0004_auto__chg_field_shippeddeliverygroup_address.py
diff --git a/order/migrations/0005_auto__chg_field_shippeddeliverygroup_address__chg_field_order_billing_.py b/shop/order/migrations/0005_auto__chg_field_shippeddeliverygroup_address__chg_field_order_billing_.py
similarity index 100%
rename from order/migrations/0005_auto__chg_field_shippeddeliverygroup_address__chg_field_order_billing_.py
rename to shop/order/migrations/0005_auto__chg_field_shippeddeliverygroup_address__chg_field_order_billing_.py
diff --git a/order/migrations/0006_auto__del_field_order_payment_price__del_field_order_payment_type_desc.py b/shop/order/migrations/0006_auto__del_field_order_payment_price__del_field_order_payment_type_desc.py
similarity index 100%
rename from order/migrations/0006_auto__del_field_order_payment_price__del_field_order_payment_type_desc.py
rename to shop/order/migrations/0006_auto__del_field_order_payment_price__del_field_order_payment_type_desc.py
diff --git a/order/migrations/0007_auto.py b/shop/order/migrations/0007_auto.py
similarity index 100%
rename from order/migrations/0007_auto.py
rename to shop/order/migrations/0007_auto.py
diff --git a/order/migrations/0008_auto.py b/shop/order/migrations/0008_auto.py
similarity index 100%
rename from order/migrations/0008_auto.py
rename to shop/order/migrations/0008_auto.py
diff --git a/order/migrations/0009_auto__add_field_order_anonymous_user_email.py b/shop/order/migrations/0009_auto__add_field_order_anonymous_user_email.py
similarity index 100%
rename from order/migrations/0009_auto__add_field_order_anonymous_user_email.py
rename to shop/order/migrations/0009_auto__add_field_order_anonymous_user_email.py
diff --git a/order/migrations/0009_auto__del_field_order_payment_status.py b/shop/order/migrations/0009_auto__del_field_order_payment_status.py
similarity index 100%
rename from order/migrations/0009_auto__del_field_order_payment_status.py
rename to shop/order/migrations/0009_auto__del_field_order_payment_status.py
diff --git a/order/migrations/0010_auto__add_field_order_anonymous_user_email__add_field_deliverygroup_st.py b/shop/order/migrations/0010_auto__add_field_order_anonymous_user_email__add_field_deliverygroup_st.py
similarity index 100%
rename from order/migrations/0010_auto__add_field_order_anonymous_user_email__add_field_deliverygroup_st.py
rename to shop/order/migrations/0010_auto__add_field_order_anonymous_user_email__add_field_deliverygroup_st.py
diff --git a/product/__init__.py b/shop/order/migrations/__init__.py
similarity index 100%
rename from product/__init__.py
rename to shop/order/migrations/__init__.py
diff --git a/order/models.py b/shop/order/models.py
similarity index 97%
rename from order/models.py
rename to shop/order/models.py
index 2a5132b6bd..9d9c91de90 100644
--- a/order/models.py
+++ b/shop/order/models.py
@@ -1,20 +1,20 @@
import datetime
from decimal import Decimal
-from communication.mail import send_email
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import pgettext_lazy
from django_prices.models import PriceField
from prices import Price
-from saleor.utils import build_absolute_uri
from satchless.item import ItemSet, ItemLine
-from userprofile.models import Address
from uuid import uuid4
-from product.models import Product
-from utils.models import Subtyped
+from ..communication.mail import send_email
+from ..core.utils import build_absolute_uri
+from ..core.utils.models import Subtyped
+from ..product.models import Product
+from ..userprofile.models import Address
class Order(models.Model, ItemSet):
diff --git a/order/static/js/order_details.js b/shop/order/static/js/order_details.js
similarity index 100%
rename from order/static/js/order_details.js
rename to shop/order/static/js/order_details.js
diff --git a/order/templates/order/details.html b/shop/order/templates/order/details.html
similarity index 100%
rename from order/templates/order/details.html
rename to shop/order/templates/order/details.html
diff --git a/order/templates/order/emails/confirm_email.txt b/shop/order/templates/order/emails/confirm_email.txt
similarity index 100%
rename from order/templates/order/emails/confirm_email.txt
rename to shop/order/templates/order/emails/confirm_email.txt
diff --git a/order/templates/order/success.html b/shop/order/templates/order/success.html
similarity index 100%
rename from order/templates/order/success.html
rename to shop/order/templates/order/success.html
diff --git a/order/tests.py b/shop/order/tests.py
similarity index 100%
rename from order/tests.py
rename to shop/order/tests.py
diff --git a/shop/order/urls.py b/shop/order/urls.py
new file mode 100644
index 0000000000..2d1a877cd5
--- /dev/null
+++ b/shop/order/urls.py
@@ -0,0 +1,15 @@
+from django.conf.urls import patterns, url, include
+
+from . import views
+from ..payment.urls import urlpatterns as payment_urls
+
+
+TOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'
+ '-[0-9a-z]{12})')
+
+urlpatterns = patterns(
+ '',
+ url(r'^%s/$' % TOKEN_PATTERN, views.details, name='details'),
+ url(r'^%s/success/$' % TOKEN_PATTERN, views.success, name='success'),
+ url(r'^%s/' % TOKEN_PATTERN, include(payment_urls, namespace='payment'))
+)
diff --git a/order/views.py b/shop/order/views.py
similarity index 95%
rename from order/views.py
rename to shop/order/views.py
index 63c3608b9a..755df3ec64 100644
--- a/order/views.py
+++ b/shop/order/views.py
@@ -1,6 +1,7 @@
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
-from order.models import Order
+
+from .models import Order
def success(request, token):
diff --git a/payment/__init__.py b/shop/payment/__init__.py
similarity index 100%
rename from payment/__init__.py
rename to shop/payment/__init__.py
diff --git a/payment/forms.py b/shop/payment/forms.py
similarity index 100%
rename from payment/forms.py
rename to shop/payment/forms.py
diff --git a/payment/migrations/0001_initial.py b/shop/payment/migrations/0001_initial.py
similarity index 100%
rename from payment/migrations/0001_initial.py
rename to shop/payment/migrations/0001_initial.py
diff --git a/payment/migrations/0002_auto__del_field_payment_cancel_url__del_field_payment_success_url.py b/shop/payment/migrations/0002_auto__del_field_payment_cancel_url__del_field_payment_success_url.py
similarity index 100%
rename from payment/migrations/0002_auto__del_field_payment_cancel_url__del_field_payment_success_url.py
rename to shop/payment/migrations/0002_auto__del_field_payment_cancel_url__del_field_payment_success_url.py
diff --git a/payment/migrations/0003_auto__del_field_payment_city__del_field_payment_first_name__del_field_.py b/shop/payment/migrations/0003_auto__del_field_payment_city__del_field_payment_first_name__del_field_.py
similarity index 100%
rename from payment/migrations/0003_auto__del_field_payment_city__del_field_payment_first_name__del_field_.py
rename to shop/payment/migrations/0003_auto__del_field_payment_city__del_field_payment_first_name__del_field_.py
diff --git a/product/migrations/__init__.py b/shop/payment/migrations/__init__.py
similarity index 100%
rename from product/migrations/__init__.py
rename to shop/payment/migrations/__init__.py
diff --git a/payment/models.py b/shop/payment/models.py
similarity index 90%
rename from payment/models.py
rename to shop/payment/models.py
index 8a14c7c5a3..2b2da04ae8 100644
--- a/payment/models.py
+++ b/shop/payment/models.py
@@ -1,11 +1,12 @@
-from communication.mail import send_email
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
-from order.models import Order
-from payments.models import BasePayment
-from saleor.utils import build_absolute_uri
from payments import PurchasedItem
+from payments.models import BasePayment
+
+from ..communication.mail import send_email
+from ..core.utils import build_absolute_uri
+from ..order.models import Order
class Payment(BasePayment):
diff --git a/payment/templates/payment/default.html b/shop/payment/templates/payment/default.html
similarity index 100%
rename from payment/templates/payment/default.html
rename to shop/payment/templates/payment/default.html
diff --git a/payment/templates/payment/details.html b/shop/payment/templates/payment/details.html
similarity index 100%
rename from payment/templates/payment/details.html
rename to shop/payment/templates/payment/details.html
diff --git a/payment/templates/payment/emails/confirm_email.txt b/shop/payment/templates/payment/emails/confirm_email.txt
similarity index 100%
rename from payment/templates/payment/emails/confirm_email.txt
rename to shop/payment/templates/payment/emails/confirm_email.txt
diff --git a/payment/templates/payment/index.html b/shop/payment/templates/payment/index.html
similarity index 100%
rename from payment/templates/payment/index.html
rename to shop/payment/templates/payment/index.html
diff --git a/payment/templates/payment/paypal-card.html b/shop/payment/templates/payment/paypal-card.html
similarity index 100%
rename from payment/templates/payment/paypal-card.html
rename to shop/payment/templates/payment/paypal-card.html
diff --git a/shop/payment/urls.py b/shop/payment/urls.py
new file mode 100644
index 0000000000..3f7246aff3
--- /dev/null
+++ b/shop/payment/urls.py
@@ -0,0 +1,11 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^payment/$', views.index, name='index'),
+ url(r'^remove/$', views.delete, name='delete'),
+ url(r'^(?P<variant>[a-z-]+)/$', views.details, name='details')
+)
diff --git a/payment/views.py b/shop/payment/views.py
similarity index 96%
rename from payment/views.py
rename to shop/payment/views.py
index 3568b89228..18236a213c 100644
--- a/payment/views.py
+++ b/shop/payment/views.py
@@ -1,10 +1,11 @@
from django.http.response import Http404, HttpResponseForbidden
from django.shortcuts import redirect
from django.template.response import TemplateResponse
-from order import check_order_status
-from payment.forms import PaymentMethodsForm, PaymentDeledeForm
from payments import RedirectNeeded, get_payment_model
+from .forms import PaymentMethodsForm, PaymentDeledeForm
+from ..order import check_order_status
+
Payment = get_payment_model()
diff --git a/product/templatetags/__init__.py b/shop/product/__init__.py
similarity index 100%
rename from product/templatetags/__init__.py
rename to shop/product/__init__.py
diff --git a/product/admin.py b/shop/product/admin.py
similarity index 100%
rename from product/admin.py
rename to shop/product/admin.py
diff --git a/product/forms.py b/shop/product/forms.py
similarity index 54%
rename from product/forms.py
rename to shop/product/forms.py
index 40bd41698b..66410c8f0d 100644
--- a/product/forms.py
+++ b/shop/product/forms.py
@@ -1,4 +1,4 @@
-from cart.forms import AddToCartForm
+from ..cart.forms import AddToCartForm
class ProductForm(AddToCartForm):
diff --git a/product/migrations/0001_initial.py b/shop/product/migrations/0001_initial.py
similarity index 100%
rename from product/migrations/0001_initial.py
rename to shop/product/migrations/0001_initial.py
diff --git a/product/migrations/0002_auto__add_field_product_stock.py b/shop/product/migrations/0002_auto__add_field_product_stock.py
similarity index 100%
rename from product/migrations/0002_auto__add_field_product_stock.py
rename to shop/product/migrations/0002_auto__add_field_product_stock.py
diff --git a/product/migrations/0003_auto__del_field_product_subtype_attr.py b/shop/product/migrations/0003_auto__del_field_product_subtype_attr.py
similarity index 100%
rename from product/migrations/0003_auto__del_field_product_subtype_attr.py
rename to shop/product/migrations/0003_auto__del_field_product_subtype_attr.py
diff --git a/product/migrations/0004_auto__add_digitalship__add_ship__del_field_product_stock.py b/shop/product/migrations/0004_auto__add_digitalship__add_ship__del_field_product_stock.py
similarity index 100%
rename from product/migrations/0004_auto__add_digitalship__add_ship__del_field_product_stock.py
rename to shop/product/migrations/0004_auto__add_digitalship__add_ship__del_field_product_stock.py
diff --git a/product/migrations/0005_auto__add_field_product_sku.py b/shop/product/migrations/0005_auto__add_field_product_sku.py
similarity index 100%
rename from product/migrations/0005_auto__add_field_product_sku.py
rename to shop/product/migrations/0005_auto__add_field_product_sku.py
diff --git a/product/migrations/0006_update_sku.py b/shop/product/migrations/0006_update_sku.py
similarity index 100%
rename from product/migrations/0006_update_sku.py
rename to shop/product/migrations/0006_update_sku.py
diff --git a/product/migrations/0007_auto__add_unique_product_sku.py b/shop/product/migrations/0007_auto__add_unique_product_sku.py
similarity index 100%
rename from product/migrations/0007_auto__add_unique_product_sku.py
rename to shop/product/migrations/0007_auto__add_unique_product_sku.py
diff --git a/product/migrations/0008_auto__add_fixedproductdiscount.py b/shop/product/migrations/0008_auto__add_fixedproductdiscount.py
similarity index 100%
rename from product/migrations/0008_auto__add_fixedproductdiscount.py
rename to shop/product/migrations/0008_auto__add_fixedproductdiscount.py
diff --git a/product/migrations/0009_auto__add_productimage.py b/shop/product/migrations/0009_auto__add_productimage.py
similarity index 100%
rename from product/migrations/0009_auto__add_productimage.py
rename to shop/product/migrations/0009_auto__add_productimage.py
diff --git a/registration/__init__.py b/shop/product/migrations/__init__.py
similarity index 100%
rename from registration/__init__.py
rename to shop/product/migrations/__init__.py
diff --git a/product/models.py b/shop/product/models.py
similarity index 100%
rename from product/models.py
rename to shop/product/models.py
diff --git a/product/templates/category/_list.html b/shop/product/templates/category/_list.html
similarity index 100%
rename from product/templates/category/_list.html
rename to shop/product/templates/category/_list.html
diff --git a/product/templates/category/index.html b/shop/product/templates/category/index.html
similarity index 100%
rename from product/templates/category/index.html
rename to shop/product/templates/category/index.html
diff --git a/product/templates/product/details.html b/shop/product/templates/product/details.html
similarity index 100%
rename from product/templates/product/details.html
rename to shop/product/templates/product/details.html
diff --git a/registration/migrations/__init__.py b/shop/product/templatetags/__init__.py
similarity index 100%
rename from registration/migrations/__init__.py
rename to shop/product/templatetags/__init__.py
diff --git a/product/templatetags/category.py b/shop/product/templatetags/category.py
similarity index 83%
rename from product/templatetags/category.py
rename to shop/product/templatetags/category.py
index 999c0ae2ef..aefec0da77 100644
--- a/product/templatetags/category.py
+++ b/shop/product/templatetags/category.py
@@ -1,5 +1,5 @@
from django import template
-from product.models import Category
+from ..models import Category
register = template.Library()
diff --git a/product/templatetags/discount.py b/shop/product/templatetags/discount.py
similarity index 100%
rename from product/templatetags/discount.py
rename to shop/product/templatetags/discount.py
diff --git a/shop/product/urls.py b/shop/product/urls.py
new file mode 100644
index 0000000000..31b0337735
--- /dev/null
+++ b/shop/product/urls.py
@@ -0,0 +1,12 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^(?P<slug>[a-z0-9-]+?)-(?P<product_id>[0-9]+)/$',
+ views.product_details, name='details'),
+ url(r'^category/(?P<slug>[a-z0-9-]+?)/$', views.category_index,
+ name='category')
+)
diff --git a/product/views.py b/shop/product/views.py
similarity index 100%
rename from product/views.py
rename to shop/product/views.py
diff --git a/saleor/migrations/__init__.py b/shop/registration/__init__.py
similarity index 100%
rename from saleor/migrations/__init__.py
rename to shop/registration/__init__.py
diff --git a/registration/backends.py b/shop/registration/backends.py
similarity index 96%
rename from registration/backends.py
rename to shop/registration/backends.py
index 279ba9bc29..441dbd3168 100644
--- a/registration/backends.py
+++ b/shop/registration/backends.py
@@ -1,5 +1,6 @@
from django.contrib.auth import get_user_model
-from registration.models import ExternalUserData
+
+from .models import ExternalUserData
User = get_user_model()
diff --git a/registration/forms.py b/shop/registration/forms.py
similarity index 97%
rename from registration/forms.py
rename to shop/registration/forms.py
index c4b8747d60..63ae4fc3c3 100644
--- a/registration/forms.py
+++ b/shop/registration/forms.py
@@ -8,15 +8,15 @@ from .models import (
EmailChangeRequest,
ExternalUserData)
from .utils import get_client_class_for_service
-
-from communication.mail import send_email
+from ..communication.mail import send_email
User = get_user_model()
class LoginForm(AuthenticationForm):
- username = forms.EmailField(label=pgettext_lazy(u"Form field", u"Email"), max_length=75)
+ username = forms.EmailField(label=pgettext_lazy(u"Form field", u"Email"),
+ max_length=75)
def __init__(self, request=None, *args, **kwargs):
super(LoginForm, self).__init__(request=request, *args, **kwargs)
diff --git a/registration/migrations/0001_initial.py b/shop/registration/migrations/0001_initial.py
similarity index 100%
rename from registration/migrations/0001_initial.py
rename to shop/registration/migrations/0001_initial.py
diff --git a/registration/migrations/0002_auto__add_field_emailconfirmation_valid_until.py b/shop/registration/migrations/0002_auto__add_field_emailconfirmation_valid_until.py
similarity index 100%
rename from registration/migrations/0002_auto__add_field_emailconfirmation_valid_until.py
rename to shop/registration/migrations/0002_auto__add_field_emailconfirmation_valid_until.py
diff --git a/registration/migrations/0003_auto__del_emailconfirmation__add_emailconfirmationrequest__del_field_e.py b/shop/registration/migrations/0003_auto__del_emailconfirmation__add_emailconfirmationrequest__del_field_e.py
similarity index 100%
rename from registration/migrations/0003_auto__del_emailconfirmation__add_emailconfirmationrequest__del_field_e.py
rename to shop/registration/migrations/0003_auto__del_emailconfirmation__add_emailconfirmationrequest__del_field_e.py
diff --git a/registration/migrations/0004_auto__add_emailchangerequest.py b/shop/registration/migrations/0004_auto__add_emailchangerequest.py
similarity index 100%
rename from registration/migrations/0004_auto__add_emailchangerequest.py
rename to shop/registration/migrations/0004_auto__add_emailchangerequest.py
diff --git a/registration/migrations/0005_auto__del_field_emailchangerequest_emailconfirmationrequest_ptr__add_f.py b/shop/registration/migrations/0005_auto__del_field_emailchangerequest_emailconfirmationrequest_ptr__add_f.py
similarity index 100%
rename from registration/migrations/0005_auto__del_field_emailchangerequest_emailconfirmationrequest_ptr__add_f.py
rename to shop/registration/migrations/0005_auto__del_field_emailchangerequest_emailconfirmationrequest_ptr__add_f.py
diff --git a/saleor/templatetags/__init__.py b/shop/registration/migrations/__init__.py
similarity index 100%
rename from saleor/templatetags/__init__.py
rename to shop/registration/migrations/__init__.py
diff --git a/registration/models.py b/shop/registration/models.py
similarity index 100%
rename from registration/models.py
rename to shop/registration/models.py
diff --git a/registration/templates/registration/change_password.html b/shop/registration/templates/registration/change_password.html
similarity index 100%
rename from registration/templates/registration/change_password.html
rename to shop/registration/templates/registration/change_password.html
diff --git a/registration/templates/registration/emails/change_email.txt b/shop/registration/templates/registration/emails/change_email.txt
similarity index 100%
rename from registration/templates/registration/emails/change_email.txt
rename to shop/registration/templates/registration/emails/change_email.txt
diff --git a/registration/templates/registration/emails/confirm_email.txt b/shop/registration/templates/registration/emails/confirm_email.txt
similarity index 100%
rename from registration/templates/registration/emails/confirm_email.txt
rename to shop/registration/templates/registration/emails/confirm_email.txt
diff --git a/registration/templates/registration/invalid_token.html b/shop/registration/templates/registration/invalid_token.html
similarity index 100%
rename from registration/templates/registration/invalid_token.html
rename to shop/registration/templates/registration/invalid_token.html
diff --git a/registration/templates/registration/login.html b/shop/registration/templates/registration/login.html
similarity index 100%
rename from registration/templates/registration/login.html
rename to shop/registration/templates/registration/login.html
diff --git a/registration/templates/registration/logout.html b/shop/registration/templates/registration/logout.html
similarity index 100%
rename from registration/templates/registration/logout.html
rename to shop/registration/templates/registration/logout.html
diff --git a/registration/templates/registration/request_email_confirmation.html b/shop/registration/templates/registration/request_email_confirmation.html
similarity index 100%
rename from registration/templates/registration/request_email_confirmation.html
rename to shop/registration/templates/registration/request_email_confirmation.html
diff --git a/registration/templates/registration/set_password.html b/shop/registration/templates/registration/set_password.html
similarity index 100%
rename from registration/templates/registration/set_password.html
rename to shop/registration/templates/registration/set_password.html
diff --git a/registration/tests.py b/shop/registration/tests.py
similarity index 93%
rename from registration/tests.py
rename to shop/registration/tests.py
index 2a6e24cb84..642b9b63ed 100644
--- a/registration/tests.py
+++ b/shop/registration/tests.py
@@ -94,9 +94,9 @@ class TestClient(OAuth2Client):
class BaseCommunicationTestCase(TestCase):
def setUp(self):
- self.parse_mock = patch('registration.utils.parse_response').start()
-
- self.requests_mock = patch('registration.utils.requests').start()
+ self.parse_mock = patch(
+ 'shop.registration.utils.parse_response').start()
+ self.requests_mock = patch('shop.registration.utils.requests').start()
self.requests_mock.codes.ok = sentinel.ok
def tearDown(self):
@@ -194,9 +194,9 @@ class AuthorizerTestCase(TestCase):
class CallbackTestCase(TestCase):
def setUp(self):
- patcher = patch('registration.forms.get_client_class_for_service')
+ patcher = patch('shop.registration.forms.get_client_class_for_service')
self.getter_mock = patcher.start()
- patcher = patch('registration.forms.authenticate')
+ patcher = patch('shop.registration.forms.authenticate')
self.authenticate_mock = patcher.start()
self.client_class = self.getter_mock()
@@ -209,8 +209,8 @@ class CallbackTestCase(TestCase):
data={'code': 'test_code'})
self.assertTrue(self.form.is_valid(), self.form.errors)
- @patch('registration.forms.ExternalUserData')
- @patch('registration.forms.User')
+ @patch('shop.registration.forms.ExternalUserData')
+ @patch('shop.registration.forms.User')
def test_new_user(self, user_mock, external_data_mock):
"""OAuth2 callback creates a new user with proper external data"""
user_mock.objects.get_or_create.return_value = sentinel.user, None
@@ -221,7 +221,7 @@ class CallbackTestCase(TestCase):
self.assertEquals(self.authenticate_mock.mock_calls,
[call(service=sentinel.service,
username=sentinel.id),
- call(user=sentinel.user)])
+ call(user=sentinel.user)])
external_data_mock.objects.create.assert_called_once_with(
service=sentinel.service, username=sentinel.id, user=sentinel.user)
self.assertEquals(user, sentinel.authed_user)
@@ -242,7 +242,7 @@ class CallbackTestCase(TestCase):
class EmailConfirmationTestCase(TestCase):
- @patch('registration.forms.authenticate')
+ @patch('shop.registration.forms.authenticate')
def test_password_set(self, authenticate_mock):
"""Email confirmation sets new password and logs the user"""
user = Mock()
@@ -258,7 +258,7 @@ class EmailConfirmationTestCase(TestCase):
user.set_password.assert_called_once_with('pass')
authenticate_mock.assert_called_once_with(user=user)
- @patch('registration.forms.authenticate')
+ @patch('shop.registration.forms.authenticate')
def test_password_unset(self, authenticate_mock):
"""Email confirmation unsets a password and logs the user"""
user = Mock()
@@ -277,8 +277,8 @@ class EmailConfirmationTestCase(TestCase):
class EmailChangeTestCase(TestCase):
- @patch('registration.views.now')
- @patch('registration.views.EmailChangeRequest.objects.get')
+ @patch('shop.registration.views.now')
+ @patch('shop.registration.views.EmailChangeRequest.objects.get')
def test_another_user_logged_out(self, get, now):
# user requests email change
@@ -301,8 +301,8 @@ class EmailChangeTestCase(TestCase):
self.assertFalse(request.user.is_authenticated())
token_object.delete.assert_not_called()
- @patch('registration.views.now')
- @patch('registration.views.EmailChangeRequest.objects.get')
+ @patch('shop.registration.views.now')
+ @patch('shop.registration.views.EmailChangeRequest.objects.get')
def test_user_logged_in(self, get, now):
# user requests email change
diff --git a/shop/registration/urls.py b/shop/registration/urls.py
new file mode 100644
index 0000000000..930412a7f8
--- /dev/null
+++ b/shop/registration/urls.py
@@ -0,0 +1,21 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^login/$', views.login, name='login'),
+ url(r'^logout/$', views.logout, name='logout'),
+ url(r'^oauth_callback/(?P<service>\w+)/$', views.oauth_callback,
+ name='oauth_callback'),
+ url(r'^change_password/$', views.change_password,
+ name='change_password'),
+ url(r'^request_email_confirmation/$', views.request_email_confirmation,
+ name='request_email_confirmation'),
+ url(r'^confirm_email/(?P<token>\w+)/$', views.confirm_email,
+ name='confirm_email'),
+ url(r'^request_email_change/$', views.request_email_change,
+ name='request_email_change'),
+ url(r'^change_email/(?P<token>\w+)/$', views.change_email,
+ name='change_email'))
diff --git a/registration/utils.py b/shop/registration/utils.py
similarity index 98%
rename from registration/utils.py
rename to shop/registration/utils.py
index a28bcd64f3..467efe6786 100644
--- a/registration/utils.py
+++ b/shop/registration/utils.py
@@ -72,7 +72,8 @@ class OAuth2Client(object):
self.local_host = local_host
if code:
access_token = self.get_access_token(code)
- self.authorizer = OAuth2RequestAuthorizer(access_token=access_token)
+ self.authorizer = OAuth2RequestAuthorizer(
+ access_token=access_token)
else:
self.authorizer = None
diff --git a/registration/views.py b/shop/registration/views.py
similarity index 100%
rename from registration/views.py
rename to shop/registration/views.py
diff --git a/saleor/settings.py b/shop/settings.py
similarity index 80%
rename from saleor/settings.py
rename to shop/settings.py
index 03e80a6562..05fbcbb0be 100644
--- a/saleor/settings.py
+++ b/shop/settings.py
@@ -7,9 +7,9 @@ SITE_ID = 1
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
-ROOT_URLCONF = 'saleor.urls'
+ROOT_URLCONF = 'shop.urls'
-WSGI_APPLICATION = 'saleor.wsgi.application'
+WSGI_APPLICATION = 'shop.wsgi.application'
ADMINS = (
# ('Your Name', '[email protected]'),
@@ -20,7 +20,7 @@ INTERNAL_IPS = ['127.0.0.1']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': 'dev.sqlite',
+ 'NAME': 'dev.sqlite'
}
}
@@ -36,21 +36,21 @@ MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
- os.path.join(PROJECT_ROOT, 'saleor', 'static'),
+ os.path.join(PROJECT_ROOT, 'shop', 'static')
]
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
- 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
- # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder'
]
TEMPLATE_DIRS = [
- os.path.join(PROJECT_ROOT, 'saleor', 'templates'),
+ os.path.join(PROJECT_ROOT, 'templates')
]
TEMPLATE_LOADERS = [
+ 'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# TODO: this one is slow, but for now need for mptt?
- 'django.template.loaders.eggs.Loader',
+ 'django.template.loaders.eggs.Loader'
]
# Make this unique, and don't share it with anybody.
@@ -62,8 +62,8 @@ MIDDLEWARE_CLASSES = [
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- 'cart.middleware.CartMiddleware',
- 'saleor.middleware.CheckHTML',
+ 'shop.cart.middleware.CartMiddleware',
+ 'shop.core.middleware.CheckHTML'
]
TEMPLATE_CONTEXT_PROCESSORS = [
@@ -75,9 +75,9 @@ TEMPLATE_CONTEXT_PROCESSORS = [
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
- 'saleor.context_processors.googe_analytics',
- 'saleor.context_processors.canonical_hostname',
- 'saleor.context_processors.default_currency',
+ 'shop.core.context_processors.googe_analytics',
+ 'shop.core.context_processors.canonical_hostname',
+ 'shop.core.context_processors.default_currency'
]
INSTALLED_APPS = [
@@ -99,14 +99,14 @@ INSTALLED_APPS = [
'south',
# Local apps
- 'cart',
- 'checkout',
- 'order',
- 'payment',
- 'product',
- 'registration',
- 'saleor',
- 'userprofile',
+ 'shop.cart',
+ 'shop.checkout',
+ 'shop.core',
+ 'shop.order',
+ 'shop.payment',
+ 'shop.product',
+ 'shop.registration',
+ 'shop.userprofile'
]
LOGGING = {
@@ -146,20 +146,20 @@ LOGGING = {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
- 'propagate': True,
+ 'propagate': True
},
- 'saleor': {
+ 'shop': {
'handlers': ['console'],
'level': 'DEBUG',
- 'propagate': True,
- },
+ 'propagate': True
+ }
}
}
AUTHENTICATION_BACKENDS = (
- 'registration.backends.EmailPasswordBackend',
- 'registration.backends.ExternalLoginBackend',
- 'registration.backends.TrivialBackend',
+ 'shop.registration.backends.EmailPasswordBackend',
+ 'shop.registration.backends.ExternalLoginBackend',
+ 'shop.registration.backends.TrivialBackend'
)
AUTH_USER_MODEL = 'userprofile.User'
@@ -201,7 +201,7 @@ PAYMENT_BASE_URL = 'http://%s/' % CANONICAL_HOSTNAME
PAYMENT_MODEL = "payment.Payment"
PAYMENT_VARIANTS = {
- 'default': ('payments.dummy.DummyProvider', {'url': 'http://google.pl/'}),
+ 'default': ('payments.dummy.DummyProvider', {'url': 'http://google.pl/'})
}
CHECKOUT_PAYMENT_CHOICES = [
diff --git a/saleor/static/css/bootstrap-theme.css b/shop/static/css/bootstrap-theme.css
similarity index 100%
rename from saleor/static/css/bootstrap-theme.css
rename to shop/static/css/bootstrap-theme.css
diff --git a/saleor/static/css/bootstrap-theme.min.css b/shop/static/css/bootstrap-theme.min.css
similarity index 100%
rename from saleor/static/css/bootstrap-theme.min.css
rename to shop/static/css/bootstrap-theme.min.css
diff --git a/saleor/static/css/bootstrap.css b/shop/static/css/bootstrap.css
similarity index 100%
rename from saleor/static/css/bootstrap.css
rename to shop/static/css/bootstrap.css
diff --git a/saleor/static/css/bootstrap.min.css b/shop/static/css/bootstrap.min.css
similarity index 100%
rename from saleor/static/css/bootstrap.min.css
rename to shop/static/css/bootstrap.min.css
diff --git a/saleor/static/fonts/glyphicons-halflings-regular.eot b/shop/static/fonts/glyphicons-halflings-regular.eot
similarity index 100%
rename from saleor/static/fonts/glyphicons-halflings-regular.eot
rename to shop/static/fonts/glyphicons-halflings-regular.eot
diff --git a/saleor/static/fonts/glyphicons-halflings-regular.svg b/shop/static/fonts/glyphicons-halflings-regular.svg
similarity index 100%
rename from saleor/static/fonts/glyphicons-halflings-regular.svg
rename to shop/static/fonts/glyphicons-halflings-regular.svg
diff --git a/saleor/static/fonts/glyphicons-halflings-regular.ttf b/shop/static/fonts/glyphicons-halflings-regular.ttf
similarity index 100%
rename from saleor/static/fonts/glyphicons-halflings-regular.ttf
rename to shop/static/fonts/glyphicons-halflings-regular.ttf
diff --git a/saleor/static/fonts/glyphicons-halflings-regular.woff b/shop/static/fonts/glyphicons-halflings-regular.woff
similarity index 100%
rename from saleor/static/fonts/glyphicons-halflings-regular.woff
rename to shop/static/fonts/glyphicons-halflings-regular.woff
diff --git a/saleor/static/img/glyphicons-halflings-white.png b/shop/static/img/glyphicons-halflings-white.png
similarity index 100%
rename from saleor/static/img/glyphicons-halflings-white.png
rename to shop/static/img/glyphicons-halflings-white.png
diff --git a/saleor/static/img/glyphicons-halflings.png b/shop/static/img/glyphicons-halflings.png
similarity index 100%
rename from saleor/static/img/glyphicons-halflings.png
rename to shop/static/img/glyphicons-halflings.png
diff --git a/saleor/static/js/lib/bootstrap.js b/shop/static/js/lib/bootstrap.js
similarity index 100%
rename from saleor/static/js/lib/bootstrap.js
rename to shop/static/js/lib/bootstrap.js
diff --git a/saleor/static/js/lib/bootstrap.min.js b/shop/static/js/lib/bootstrap.min.js
similarity index 100%
rename from saleor/static/js/lib/bootstrap.min.js
rename to shop/static/js/lib/bootstrap.min.js
diff --git a/saleor/static/js/lib/less.js b/shop/static/js/lib/less.js
similarity index 100%
rename from saleor/static/js/lib/less.js
rename to shop/static/js/lib/less.js
diff --git a/saleor/static/less/style.less b/shop/static/less/style.less
similarity index 100%
rename from saleor/static/less/style.less
rename to shop/static/less/style.less
diff --git a/saleor/test_settings.py b/shop/test_settings.py
similarity index 100%
rename from saleor/test_settings.py
rename to shop/test_settings.py
diff --git a/shop/urls.py b/shop/urls.py
new file mode 100644
index 0000000000..9f55860d4b
--- /dev/null
+++ b/shop/urls.py
@@ -0,0 +1,36 @@
+from django.conf import settings
+from django.conf.urls import patterns, url, include
+from django.contrib import admin
+
+
+from .cart.urls import urlpatterns as cart_urls
+from .checkout.urls import urlpatterns as checkout_urls
+from .core.urls import urlpatterns as core_urls
+from .order.urls import urlpatterns as order_urls
+from .product.urls import urlpatterns as product_urls
+from .registration.urls import urlpatterns as registration_urls
+from .userprofile.urls import urlpatterns as userprofile_urls
+
+
+admin.autodiscover()
+
+urlpatterns = patterns(
+ '',
+ url(r'^$', include(core_urls), name='home'),
+ url(r'^account/', include(registration_urls, namespace='registration')),
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^cart/', include(cart_urls, namespace='cart')),
+ url(r'^checkout/', include(checkout_urls, namespace='checkout')),
+ url(r'^images/', include('django_images.urls')),
+ url(r'^order/', include(order_urls, namespace='order')),
+ url(r'^products/', include(product_urls, namespace='product')),
+ url(r'^profile/', include(userprofile_urls, namespace='profile')),
+ url(r'', include('payments.urls'))
+)
+
+if settings.DEBUG:
+ # static files (images, css, javascript, etc.)
+ urlpatterns += patterns(
+ '',
+ url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': settings.MEDIA_ROOT}))
diff --git a/userprofile/__init__.py b/shop/userprofile/__init__.py
similarity index 100%
rename from userprofile/__init__.py
rename to shop/userprofile/__init__.py
diff --git a/userprofile/admin.py b/shop/userprofile/admin.py
similarity index 100%
rename from userprofile/admin.py
rename to shop/userprofile/admin.py
diff --git a/userprofile/forms.py b/shop/userprofile/forms.py
similarity index 100%
rename from userprofile/forms.py
rename to shop/userprofile/forms.py
diff --git a/userprofile/management/__init__.py b/shop/userprofile/management/__init__.py
similarity index 100%
rename from userprofile/management/__init__.py
rename to shop/userprofile/management/__init__.py
diff --git a/userprofile/management/commands/__init__.py b/shop/userprofile/management/commands/__init__.py
similarity index 100%
rename from userprofile/management/commands/__init__.py
rename to shop/userprofile/management/commands/__init__.py
diff --git a/userprofile/management/commands/changepassword.py b/shop/userprofile/management/commands/changepassword.py
similarity index 100%
rename from userprofile/management/commands/changepassword.py
rename to shop/userprofile/management/commands/changepassword.py
diff --git a/userprofile/management/commands/createsuperuser.py b/shop/userprofile/management/commands/createsuperuser.py
similarity index 100%
rename from userprofile/management/commands/createsuperuser.py
rename to shop/userprofile/management/commands/createsuperuser.py
diff --git a/userprofile/migrations/0001_initial.py b/shop/userprofile/migrations/0001_initial.py
similarity index 100%
rename from userprofile/migrations/0001_initial.py
rename to shop/userprofile/migrations/0001_initial.py
diff --git a/userprofile/migrations/0002_auto__add_address__add_field_user_default_shipping_address__add_field_.py b/shop/userprofile/migrations/0002_auto__add_address__add_field_user_default_shipping_address__add_field_.py
similarity index 100%
rename from userprofile/migrations/0002_auto__add_address__add_field_user_default_shipping_address__add_field_.py
rename to shop/userprofile/migrations/0002_auto__add_address__add_field_user_default_shipping_address__add_field_.py
diff --git a/userprofile/migrations/0003_auto__add_unique_address_alias_user.py b/shop/userprofile/migrations/0003_auto__add_unique_address_alias_user.py
similarity index 100%
rename from userprofile/migrations/0003_auto__add_unique_address_alias_user.py
rename to shop/userprofile/migrations/0003_auto__add_unique_address_alias_user.py
diff --git a/userprofile/migrations/0004_auto__add_addressbook__add_unique_addressbook_user_alias__del_field_ad.py b/shop/userprofile/migrations/0004_auto__add_addressbook__add_unique_addressbook_user_alias__del_field_ad.py
similarity index 100%
rename from userprofile/migrations/0004_auto__add_addressbook__add_unique_addressbook_user_alias__del_field_ad.py
rename to shop/userprofile/migrations/0004_auto__add_addressbook__add_unique_addressbook_user_alias__del_field_ad.py
diff --git a/userprofile/migrations/0005_auto__chg_field_user_default_billing_address__chg_field_user_default_s.py b/shop/userprofile/migrations/0005_auto__chg_field_user_default_billing_address__chg_field_user_default_s.py
similarity index 100%
rename from userprofile/migrations/0005_auto__chg_field_user_default_billing_address__chg_field_user_default_s.py
rename to shop/userprofile/migrations/0005_auto__chg_field_user_default_billing_address__chg_field_user_default_s.py
diff --git a/userprofile/migrations/__init__.py b/shop/userprofile/migrations/__init__.py
similarity index 100%
rename from userprofile/migrations/__init__.py
rename to shop/userprofile/migrations/__init__.py
diff --git a/userprofile/models.py b/shop/userprofile/models.py
similarity index 99%
rename from userprofile/models.py
rename to shop/userprofile/models.py
index 7a318d083c..70b5e1221d 100644
--- a/userprofile/models.py
+++ b/shop/userprofile/models.py
@@ -9,7 +9,7 @@ from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy, pgettext_lazy
from unidecode import unidecode
-from saleor.countries import COUNTRY_CHOICES
+from ..core.countries import COUNTRY_CHOICES
class AddressBook(models.Model):
diff --git a/userprofile/templates/userprofile/address-delete.html b/shop/userprofile/templates/userprofile/address-delete.html
similarity index 100%
rename from userprofile/templates/userprofile/address-delete.html
rename to shop/userprofile/templates/userprofile/address-delete.html
diff --git a/userprofile/templates/userprofile/address-edit.html b/shop/userprofile/templates/userprofile/address-edit.html
similarity index 100%
rename from userprofile/templates/userprofile/address-edit.html
rename to shop/userprofile/templates/userprofile/address-edit.html
diff --git a/userprofile/templates/userprofile/details.html b/shop/userprofile/templates/userprofile/details.html
similarity index 100%
rename from userprofile/templates/userprofile/details.html
rename to shop/userprofile/templates/userprofile/details.html
diff --git a/userprofile/templates/userprofile/orders.html b/shop/userprofile/templates/userprofile/orders.html
similarity index 100%
rename from userprofile/templates/userprofile/orders.html
rename to shop/userprofile/templates/userprofile/orders.html
diff --git a/userprofile/tests.py b/shop/userprofile/tests.py
similarity index 100%
rename from userprofile/tests.py
rename to shop/userprofile/tests.py
diff --git a/shop/userprofile/urls.py b/shop/userprofile/urls.py
new file mode 100644
index 0000000000..860f1261eb
--- /dev/null
+++ b/shop/userprofile/urls.py
@@ -0,0 +1,19 @@
+from django.conf.urls import patterns, url
+
+from . import views
+
+
+urlpatterns = patterns(
+ '',
+ url(r'^$', views.details, name='details'),
+ url(r'^orders/$', views.orders, name='orders'),
+ url(r'^address/create/$', views.address_create,
+ name='address-create'),
+ url(r'^address/(?P<slug>[\w-]+)-(?P<pk>\d+)/edit/$', views.address_edit,
+ name='address-edit'),
+ url(r'^address/(?P<slug>[\w-]+)-(?P<pk>\d+)/delete/$',
+ views.address_delete, name='address-delete'),
+ url(r'^address/(?P<pk>\d+)/make-default-for-'
+ r'(?P<purpose>billing|shipping)/$', views.address_make_default,
+ name='address-make-default')
+)
diff --git a/userprofile/views.py b/shop/userprofile/views.py
similarity index 100%
rename from userprofile/views.py
rename to shop/userprofile/views.py
diff --git a/saleor/wsgi.py b/shop/wsgi.py
similarity index 100%
rename from saleor/wsgi.py
rename to shop/wsgi.py
diff --git a/saleor/templates/base.html b/templates/base.html
similarity index 100%
rename from saleor/templates/base.html
rename to templates/base.html
diff --git a/userprofile/urls.py b/userprofile/urls.py
deleted file mode 100644
index d3f2e81e73..0000000000
--- a/userprofile/urls.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from django.conf.urls import patterns, url
-
-
-urlpatterns = patterns(
- '',
- url(r'^$', 'userprofile.views.details', name='details'),
- url(r'^orders/$', 'userprofile.views.orders', name='orders'),
- url(r'^address/create/$',
- 'userprofile.views.address_create',
- name='address-create'),
- url(r'^address/(?P<slug>[\w-]+)-(?P<pk>\d+)/edit/$',
- 'userprofile.views.address_edit',
- name='address-edit'),
- url(r'^address/(?P<slug>[\w-]+)-(?P<pk>\d+)/delete/$',
- 'userprofile.views.address_delete',
- name='address-delete'),
- url(r'^address/(?P<pk>\d+)/make-default-for-'
- '(?P<purpose>billing|shipping)/$',
- 'userprofile.views.address_make_default',
- name='address-make-default'))