Browse Source

Move sites/sandbox/ to the root directory.

Since there is no demo or us site anymore we can simplify the structure
somewhat by moving the sandbox one directory up
master
Michael van Tellingen 8 years ago
parent
commit
a846c41ee3
47 changed files with 33 additions and 97 deletions
  1. 6
    15
      .gitignore
  2. 3
    3
      Dockerfile
  3. 15
    15
      Makefile
  4. 1
    1
      docs/source/internals/sandbox.rst
  5. 1
    1
      docs/source/topics/deploying.rst
  6. 7
    7
      sandbox/README.rst
  7. 0
    0
      sandbox/__init__.py
  8. 0
    0
      sandbox/apps/__init__.py
  9. 0
    0
      sandbox/apps/gateway/__init__.py
  10. 0
    0
      sandbox/apps/gateway/forms.py
  11. 0
    0
      sandbox/apps/gateway/models.py
  12. 0
    0
      sandbox/apps/gateway/urls.py
  13. 0
    0
      sandbox/apps/gateway/views.py
  14. 0
    0
      sandbox/apps/offers.py
  15. 0
    0
      sandbox/apps/sitemaps.py
  16. 0
    0
      sandbox/apps/user/__init__.py
  17. 0
    0
      sandbox/apps/user/models.py
  18. 0
    0
      sandbox/fixtures/auth.json
  19. 0
    0
      sandbox/fixtures/books.computers-in-fiction.csv
  20. 0
    0
      sandbox/fixtures/books.essential.csv
  21. 0
    0
      sandbox/fixtures/books.hacking.csv
  22. 0
    0
      sandbox/fixtures/child_products.json
  23. 0
    0
      sandbox/fixtures/comms.json
  24. 0
    0
      sandbox/fixtures/images.tar.gz
  25. 0
    0
      sandbox/fixtures/multi-stockrecord-product.json
  26. 0
    0
      sandbox/fixtures/offers.json
  27. 0
    0
      sandbox/fixtures/order-events.json
  28. 0
    0
      sandbox/fixtures/orders.json
  29. 0
    0
      sandbox/fixtures/pages.json
  30. 0
    0
      sandbox/fixtures/promotions.json
  31. 0
    0
      sandbox/fixtures/range-products.csv
  32. 0
    0
      sandbox/fixtures/ranges.json
  33. 0
    0
      sandbox/manage.py
  34. 0
    0
      sandbox/settings.py
  35. 0
    0
      sandbox/settings_mysql.py
  36. 0
    0
      sandbox/settings_postgres.py
  37. 0
    0
      sandbox/settings_sphinx.py
  38. 0
    0
      sandbox/static/.gitignore
  39. 0
    0
      sandbox/static/robots.txt
  40. 0
    0
      sandbox/templates/gateway/email.txt
  41. 0
    0
      sandbox/templates/gateway/form.html
  42. 0
    0
      sandbox/test_migrations.sh
  43. 0
    0
      sandbox/urls.py
  44. 0
    0
      sandbox/uwsgi.ini
  45. 0
    0
      sandbox/wsgi.py
  46. 0
    14
      sites/sandbox/README.rst
  47. 0
    41
      sites/sandbox/update_latest.sh

+ 6
- 15
.gitignore View File

@@ -38,19 +38,10 @@ nosetests.xml
38 38
 /htmlcov/*
39 39
 /.tox/*
40 40
 
41
-# Example sites
41
+# Sandbox content
42 42
 settings_local.py
43
-/sites/sandbox/*.sqlite
44
-/sites/sandbox/assets/
45
-/sites/sandbox/public/
46
-/sites/sandbox/whoosh_index/
47
-/sites/sandbox/logs/
48
-/sites/demo/*.sqlite
49
-/sites/demo/assets/
50
-/sites/demo/public/
51
-/sites/demo/whoosh_index/
52
-/sites/demo/logs/
53
-/sites/us/*.sqlite
54
-/sites/us/public/
55
-/sites/us/logs/
56
-sites/puppet/modules/
43
+/sandbox/*.sqlite
44
+/sandbox/assets/
45
+/sandbox/public/
46
+/sandbox/whoosh_index/
47
+/sandbox/logs/

+ 3
- 3
Dockerfile View File

@@ -2,7 +2,7 @@ FROM python:3.5
2 2
 ENV PYTHONUNBUFFERED 1
3 3
 
4 4
 COPY ./requirements.txt /requirements.txt
5
-RUN pip3 install -r /requirements.txt psycopg2 raven==5.23.0
5
+RUN pip3 install -r /requirements.txt psycopg2 raven==5.32.0
6 6
 
7 7
 RUN groupadd -r django && useradd -r -g django django
8 8
 COPY . /app
@@ -17,6 +17,6 @@ USER django
17 17
 
18 18
 RUN make build_sandbox
19 19
 
20
-RUN cp --remove-destination /app/src/oscar/static/oscar/img/image_not_found.jpg /app/sites/sandbox/public/media/
20
+RUN cp --remove-destination /app/src/oscar/static/oscar/img/image_not_found.jpg /app/sandbox/public/media/
21 21
 
22
-CMD uwsgi --ini /app/sites/sandbox/uwsgi.ini
22
+CMD uwsgi --ini /app/sandbox/uwsgi.ini

+ 15
- 15
Makefile View File

@@ -7,22 +7,22 @@ install:
7 7
 
8 8
 build_sandbox:
9 9
 	# Remove media
10
-	-rm -rf sites/sandbox/public/media/images
11
-	-rm -rf sites/sandbox/public/media/cache
12
-	-rm -rf sites/sandbox/public/static
13
-	-rm -f sites/sandbox/db.sqlite
10
+	-rm -rf sandbox/public/media/images
11
+	-rm -rf sandbox/public/media/cache
12
+	-rm -rf sandbox/public/static
13
+	-rm -f sandbox/db.sqlite
14 14
 	# Create database
15
-	sites/sandbox/manage.py migrate
15
+	sandbox/manage.py migrate
16 16
 	# Import some fixtures. Order is important as JSON fixtures include primary keys
17
-	sites/sandbox/manage.py loaddata sites/sandbox/fixtures/child_products.json
18
-	sites/sandbox/manage.py oscar_import_catalogue sites/sandbox/fixtures/*.csv
19
-	sites/sandbox/manage.py oscar_import_catalogue_images sites/sandbox/fixtures/images.tar.gz
20
-	sites/sandbox/manage.py oscar_populate_countries --initial-only
21
-	sites/sandbox/manage.py loaddata sites/_fixtures/pages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json
22
-	sites/sandbox/manage.py loaddata sites/sandbox/fixtures/orders.json
23
-	sites/sandbox/manage.py clear_index --noinput
24
-	sites/sandbox/manage.py update_index catalogue
25
-	sites/sandbox/manage.py thumbnail cleanup
17
+	sandbox/manage.py loaddata sandbox/fixtures/child_products.json
18
+	sandbox/manage.py oscar_import_catalogue sandbox/fixtures/*.csv
19
+	sandbox/manage.py oscar_import_catalogue_images sandbox/fixtures/images.tar.gz
20
+	sandbox/manage.py oscar_populate_countries --initial-only
21
+	sandbox/manage.py loaddata sandbox/fixtures/pages.json sandbox/fixtures/auth.json sandbox/fixtures/ranges.json sandbox/fixtures/offers.json
22
+	sandbox/manage.py loaddata sandbox/fixtures/orders.json
23
+	sandbox/manage.py clear_index --noinput
24
+	sandbox/manage.py update_index catalogue
25
+	sandbox/manage.py thumbnail cleanup
26 26
 
27 27
 sandbox: install build_sandbox
28 28
 
@@ -44,7 +44,7 @@ lint:
44 44
 
45 45
 testmigrations:
46 46
 	pip install -r requirements_migrations.txt
47
-	cd sites/sandbox && ./test_migrations.sh
47
+	cd sandbox && ./test_migrations.sh
48 48
 
49 49
 messages:
50 50
 	# Create the .po files used for i18n

+ 1
- 1
docs/source/internals/sandbox.rst View File

@@ -60,7 +60,7 @@ Install Oscar and its dependencies within a virtualenv:
60 60
     $ cd django-oscar
61 61
     $ mkvirtualenv oscar  # needs virtualenvwrapper
62 62
     (oscar) $ make sandbox
63
-    (oscar) $ sites/sandbox/manage.py runserver
63
+    (oscar) $ sandbox/manage.py runserver
64 64
 
65 65
 .. warning::
66 66
     

+ 1
- 1
docs/source/topics/deploying.rst View File

@@ -44,7 +44,7 @@ Search Engine Optimisation
44 44
 --------------------------
45 45
 
46 46
 A basic example of what a sitemap for Oscar could look like has been added
47
-to the sandbox site. Have a look at ``sites/sandbox/urls.py`` for inspiration.
47
+to the sandbox site. Have a look at ``sandbox/urls.py`` for inspiration.
48 48
 
49 49
 .. _deployment: https://docs.djangoproject.com/en/dev/howto/deployment/
50 50
 .. _`Django's guidelines for security`: https://docs.djangoproject.com/en/dev/topics/security/

sites/README.rst → sandbox/README.rst View File

@@ -1,11 +1,11 @@
1
-===========
2
-Oscar sites
3
-===========
1
+============
2
+Sandbox site
3
+============
4 4
 
5
-Oscar ships with two working Django projects that use Oscar:
5
+This site is deployed there:
6 6
 
7
-Sandbox
8
--------
7
+http://latest.oscarcommerce.com
8
+-------------------------------
9 9
 
10 10
 This is a vanilla install of Oscar with as little customisation as possible to
11 11
 get a basic site working.  It's really intended for local development and QA.
@@ -17,4 +17,4 @@ It does have a few customisations:
17 17
 * A profile model with a few fields, designed to test Oscar's account section
18 18
   which should automatically allow the profile fields to be edited.
19 19
 
20
-It is deployed hourly to: http://latest.oscarcommerce.com
20
+It is deployed automatically to: http://latest.oscarcommerce.com

sites/sandbox/__init__.py → sandbox/__init__.py View File


sites/sandbox/apps/__init__.py → sandbox/apps/__init__.py View File


sites/sandbox/apps/gateway/__init__.py → sandbox/apps/gateway/__init__.py View File


sites/sandbox/apps/gateway/forms.py → sandbox/apps/gateway/forms.py View File


sites/sandbox/apps/gateway/models.py → sandbox/apps/gateway/models.py View File


sites/sandbox/apps/gateway/urls.py → sandbox/apps/gateway/urls.py View File


sites/sandbox/apps/gateway/views.py → sandbox/apps/gateway/views.py View File


sites/sandbox/apps/offers.py → sandbox/apps/offers.py View File


sites/sandbox/apps/sitemaps.py → sandbox/apps/sitemaps.py View File


sites/sandbox/apps/user/__init__.py → sandbox/apps/user/__init__.py View File


sites/sandbox/apps/user/models.py → sandbox/apps/user/models.py View File


sites/_fixtures/auth.json → sandbox/fixtures/auth.json View File


sites/sandbox/fixtures/books.computers-in-fiction.csv → sandbox/fixtures/books.computers-in-fiction.csv View File


sites/sandbox/fixtures/books.essential.csv → sandbox/fixtures/books.essential.csv View File


sites/sandbox/fixtures/books.hacking.csv → sandbox/fixtures/books.hacking.csv View File


sites/sandbox/fixtures/child_products.json → sandbox/fixtures/child_products.json View File


sites/_fixtures/comms.json → sandbox/fixtures/comms.json View File


sites/sandbox/fixtures/images.tar.gz → sandbox/fixtures/images.tar.gz View File


sites/sandbox/fixtures/multi-stockrecord-product.json → sandbox/fixtures/multi-stockrecord-product.json View File


sites/_fixtures/offers.json → sandbox/fixtures/offers.json View File


sites/_fixtures/order-events.json → sandbox/fixtures/order-events.json View File


sites/sandbox/fixtures/orders.json → sandbox/fixtures/orders.json View File


sites/_fixtures/pages.json → sandbox/fixtures/pages.json View File


sites/_fixtures/promotions.json → sandbox/fixtures/promotions.json View File


sites/_fixtures/range-products.csv → sandbox/fixtures/range-products.csv View File


sites/_fixtures/ranges.json → sandbox/fixtures/ranges.json View File


sites/sandbox/manage.py → sandbox/manage.py View File


sites/sandbox/settings.py → sandbox/settings.py View File


sites/sandbox/settings_mysql.py → sandbox/settings_mysql.py View File


sites/sandbox/settings_postgres.py → sandbox/settings_postgres.py View File


sites/sandbox/settings_sphinx.py → sandbox/settings_sphinx.py View File


sites/sandbox/static/.gitignore → sandbox/static/.gitignore View File


sites/sandbox/static/robots.txt → sandbox/static/robots.txt View File


sites/sandbox/templates/gateway/email.txt → sandbox/templates/gateway/email.txt View File


sites/sandbox/templates/gateway/form.html → sandbox/templates/gateway/form.html View File


sites/sandbox/test_migrations.sh → sandbox/test_migrations.sh View File


sites/sandbox/urls.py → sandbox/urls.py View File


sites/sandbox/uwsgi.ini → sandbox/uwsgi.ini View File


sites/sandbox/wsgi.py → sandbox/wsgi.py View File


+ 0
- 14
sites/sandbox/README.rst View File

@@ -1,14 +0,0 @@
1
-============
2
-Sandbox site
3
-============
4
-
5
-This site is deployed there:
6
-
7
-http://latest.oscarcommerce.com
8
--------------------------------
9
-
10
-This site is used for testing the vanilla Oscar functionality, that is, Oscar
11
-without any customisation.  It is not a demo site for clients or potential Oscar
12
-users.  It is built automatically from the HEAD of the master branch every 20
13
-minutes.
14
-

+ 0
- 41
sites/sandbox/update_latest.sh View File

@@ -1,41 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-# Update to latest commit
4
-cd /var/www/oscar/builds/latest
5
-git pull --ff-only 2> /dev/null
6
-[ $? -gt 0 ] && echo "Git pull failed" >&2 && exit 1
7
-
8
-# Remove existing pyc files
9
-find . -type f -name "*.pyc" -delete
10
-
11
-# Update any dependencies
12
-source ../../virtualenvs/latest/bin/activate
13
-python setup.py develop
14
-pip install -r requirements.txt
15
-
16
-# Update sandbox database
17
-cd sites/sandbox
18
-./manage.py migrate
19
-
20
-# Rebuild statics
21
-./manage.py collectstatic --noinput
22
-./manage.py thumbnail clear
23
-
24
-# Load standard fixtures
25
-./manage.py loaddata ../_fixtures/promotions.json
26
-
27
-# Restart Tomcat (to pick up any Solr schema changes)
28
-/etc/init.d/tomcat7 restart
29
-
30
-# Re-compile python code
31
-touch deploy/wsgi/latest.wsgi
32
-
33
-# Copy down server config files
34
-cp deploy/nginx/latest.conf /etc/nginx/sites-enabled/latest.oscarcommerce.com
35
-/etc/init.d/nginx configtest 2> /dev/null && /etc/init.d/nginx force-reload 2> /dev/null
36
-
37
-cp deploy/supervisord/latest.conf /etc/supervisor/conf.d/latest.conf
38
-supervisorctl reread && supervisorctl reload
39
-
40
-# Copy down cronjob file
41
-cp deploy/cron.d/oscar /etc/cron.d/oscar-latest

Loading…
Cancel
Save