2
0
Эх сурвалжийг харах

Merge pull request #1109 from kaedroho/vanilla-project-template

Vanilla project template
Dan Braghis 9 жил өмнө
parent
commit
b13951b5cf
24 өөрчлөгдсөн 155 нэмэгдсэн , 193 устгасан
  1. 0 10
      wagtail/project_template/.gitignore
  2. 0 27
      wagtail/project_template/Vagrantfile
  3. 0 3
      wagtail/project_template/core/templatetags/core_tags.py
  4. 0 0
      wagtail/project_template/home/__init__.py
  5. 0 0
      wagtail/project_template/home/migrations/0001_initial.py
  6. 3 3
      wagtail/project_template/home/migrations/0002_create_homepage.py
  7. 0 0
      wagtail/project_template/home/migrations/__init__.py
  8. 0 0
      wagtail/project_template/home/models.py
  9. 0 2
      wagtail/project_template/home/templates/home/home_page.html
  10. 45 65
      wagtail/project_template/project_name/settings/base.py
  11. 5 0
      wagtail/project_template/project_name/settings/dev.py
  12. 0 24
      wagtail/project_template/project_name/settings/production.py
  13. 0 0
      wagtail/project_template/project_name/static/css/project_name.css
  14. 0 0
      wagtail/project_template/project_name/static/js/project_name.js
  15. 0 0
      wagtail/project_template/project_name/templates/404.html
  16. 0 0
      wagtail/project_template/project_name/templates/500.html
  17. 4 8
      wagtail/project_template/project_name/templates/base.html
  18. 6 6
      wagtail/project_template/project_name/urls.py
  19. 4 2
      wagtail/project_template/project_name/wsgi.py
  20. 0 10
      wagtail/project_template/requirements.txt
  21. 0 0
      wagtail/project_template/search/__init__.py
  22. 49 0
      wagtail/project_template/search/templates/search/search.html
  23. 39 0
      wagtail/project_template/search/views.py
  24. 0 33
      wagtail/project_template/vagrant/provision.sh

+ 0 - 10
wagtail/project_template/.gitignore

@@ -1,10 +0,0 @@
-*.pyc
-.DS_Store
-/.venv/
-/*/settings/local.py
-/static/
-/media/
-/.vagrant/
-Vagrantfile.local
-/docs/_build/
-/db.sqlite3

+ 0 - 27
wagtail/project_template/Vagrantfile

@@ -1,27 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant::Config.run do |config|
-    # Base box to build off, and download URL for when it doesn't exist on the user's system already
-    config.vm.box = "wagtail-base-v0.3"
-    config.vm.box_url = "http://downloads.torchbox.com/wagtail-base-v0.3.box"
-
-    # Forward a port from the guest to the host, which allows for outside
-    # computers to access the VM, whereas host only networking does not.
-    config.vm.forward_port 8000, 8000
-
-    # Share an additional folder to the guest VM. The first argument is
-    # an identifier, the second is the path on the guest to mount the
-    # folder, and the third is the path on the host to the actual folder.
-    config.vm.share_folder "project", "/home/vagrant/{{ project_name }}", "."
-
-    # Enable provisioning with a shell script.
-    config.vm.provision :shell, :path => "vagrant/provision.sh", :args => "{{ project_name }}"
-
-    # If a 'Vagrantfile.local' file exists, import any configuration settings
-    # defined there into here. Vagrantfile.local is ignored in version control,
-    # so this can be used to add configuration specific to this computer.
-    if File.exist? "Vagrantfile.local"
-        instance_eval File.read("Vagrantfile.local"), "Vagrantfile.local"
-    end
-end

+ 0 - 3
wagtail/project_template/core/templatetags/core_tags.py

@@ -1,3 +0,0 @@
-from django import template
-
-register = template.Library()

+ 0 - 0
wagtail/project_template/core/__init__.py → wagtail/project_template/home/__init__.py


+ 0 - 0
wagtail/project_template/core/migrations/0001_initial.py → wagtail/project_template/home/migrations/0001_initial.py


+ 3 - 3
wagtail/project_template/core/migrations/0002_create_homepage.py → wagtail/project_template/home/migrations/0002_create_homepage.py

@@ -9,14 +9,14 @@ def create_homepage(apps, schema_editor):
     ContentType = apps.get_model('contenttypes.ContentType')
     Page = apps.get_model('wagtailcore.Page')
     Site = apps.get_model('wagtailcore.Site')
-    HomePage = apps.get_model('core.HomePage')
+    HomePage = apps.get_model('home.HomePage')
 
     # Delete the default homepage
     Page.objects.get(id=2).delete()
 
     # Create content type for homepage model
     homepage_content_type, created = ContentType.objects.get_or_create(
-        model='homepage', app_label='core', defaults={'name': 'Homepage'})
+        model='homepage', app_label='home')
 
     # Create a new homepage
     homepage = HomePage.objects.create(
@@ -37,7 +37,7 @@ def create_homepage(apps, schema_editor):
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('core', '0001_initial'),
+        ('home', '0001_initial'),
     ]
 
     operations = [

+ 0 - 0
wagtail/project_template/core/migrations/__init__.py → wagtail/project_template/home/migrations/__init__.py


+ 0 - 0
wagtail/project_template/core/models.py → wagtail/project_template/home/models.py


+ 0 - 2
wagtail/project_template/core/templates/core/home_page.html → wagtail/project_template/home/templates/home/home_page.html

@@ -1,7 +1,5 @@
 {% templatetag openblock %} extends "base.html" {% templatetag closeblock %}
 
-{% templatetag openblock %} load static core_tags {% templatetag closeblock %}
-
 {% templatetag openblock %} block body_class {% templatetag closeblock %}template-{% templatetag openvariable %} self.get_verbose_name|slugify {% templatetag closevariable %}{% templatetag openblock %} endblock {% templatetag closeblock %}
 
 {% templatetag openblock %} block content {% templatetag closeblock %}

+ 45 - 65
wagtail/project_template/project_name/settings/base.py

@@ -1,6 +1,8 @@
 """
 Django settings for {{ project_name }} project.
 
+Generated by 'django-admin startproject' using Django {{ django_version }}.
+
 For more information on this file, see
 https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
 
@@ -8,30 +10,16 @@ For the full list of settings and their values, see
 https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
 """
 
-from os.path import abspath, dirname, join
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+import os
 
-# Absolute filesystem path to the Django project directory:
-PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__))))
+PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+BASE_DIR = os.path.dirname(PROJECT_DIR)
 
 
 # Quick-start development settings - unsuitable for production
 # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
 
-# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = '{{ secret_key }}'
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
-
-TEMPLATE_DEBUG = True
-
-ALLOWED_HOSTS = []
-
-
-# Base URL to use when referring to full URLs within the Wagtail admin backend -
-# e.g. in notification emails. Don't include '/admin' or a trailing slash
-BASE_URL = 'http://example.com'
-
 
 # Application definition
 
@@ -43,23 +31,24 @@ INSTALLED_APPS = (
     'django.contrib.messages',
     'django.contrib.staticfiles',
 
-    'compressor',
     'taggit',
+    'compressor',
     'modelcluster',
 
     'wagtail.wagtailcore',
     'wagtail.wagtailadmin',
+    'wagtail.wagtailsearch',
+    'wagtail.wagtailimages',
     'wagtail.wagtaildocs',
     'wagtail.wagtailsnippets',
     'wagtail.wagtailusers',
     'wagtail.wagtailsites',
-    'wagtail.wagtailimages',
     'wagtail.wagtailembeds',
-    'wagtail.wagtailsearch',
     'wagtail.wagtailredirects',
     'wagtail.wagtailforms',
 
-    'core',
+    'search',
+    'home',
 )
 
 MIDDLEWARE_CLASSES = (
@@ -67,92 +56,83 @@ MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    'django.middleware.security.SecurityMiddleware',
 
     'wagtail.wagtailcore.middleware.SiteMiddleware',
     'wagtail.wagtailredirects.middleware.RedirectMiddleware',
 )
 
 ROOT_URLCONF = '{{ project_name }}.urls'
+
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [
+            os.path.join(PROJECT_DIR, 'templates'),
+        ],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
 WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
 
 
 # Database
 # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
 
-# SQLite (simplest install)
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': join(PROJECT_ROOT, 'db.sqlite3'),
+        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
     }
 }
 
-# PostgreSQL (Recommended, but requires the psycopg2 library and Postgresql development headers)
-# DATABASES = {
-#     'default': {
-#         'ENGINE': 'django.db.backends.postgresql_psycopg2',
-#         'NAME': '{{ project_name }}',
-#         'USER': 'postgres',
-#         'PASSWORD': '',
-#         'HOST': '',  # Set to empty string for localhost.
-#         'PORT': '',  # Set to empty string for default.
-#         'CONN_MAX_AGE': 600,  # number of seconds database connections should persist for
-#     }
-# }
-
 
 # Internationalization
 # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
 
-LANGUAGE_CODE = 'en-gb'
+LANGUAGE_CODE = 'en-us'
+
 TIME_ZONE = 'UTC'
+
 USE_I18N = True
+
 USE_L10N = True
+
 USE_TZ = True
 
 
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
 
-STATIC_ROOT = join(PROJECT_ROOT, 'static')
-STATIC_URL = '/static/'
-
 STATICFILES_FINDERS = (
     'django.contrib.staticfiles.finders.FileSystemFinder',
     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
     'compressor.finders.CompressorFinder',
 )
 
-MEDIA_ROOT = join(PROJECT_ROOT, 'media')
-MEDIA_URL = '/media/'
-
-
-# Template configuration
+STATICFILES_DIRS = (
+    os.path.join(PROJECT_DIR, 'static'),
+)
 
-from django.conf import global_settings
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
+STATIC_URL = '/static/'
 
-TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
-    'django.core.context_processors.request',
-)
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
+MEDIA_URL = '/media/'
 
 
 # Wagtail settings
 
 WAGTAIL_SITE_NAME = "{{ project_name }}"
-
-# Use Elasticsearch as the search backend for extra performance and better search results:
-# http://wagtail.readthedocs.org/en/latest/howto/performance.html#search
-# http://wagtail.readthedocs.org/en/latest/core_components/search/backends.html#elasticsearch-backend
-#
-# WAGTAILSEARCH_BACKENDS = {
-#     'default': {
-#         'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
-#         'INDEX': '{{ project_name }}',
-#     },
-# }
-
-
-# Whether to use face/feature detection to improve image cropping - requires OpenCV
-WAGTAILIMAGES_FEATURE_DETECTION_ENABLED = False

+ 5 - 0
wagtail/project_template/project_name/settings/dev.py

@@ -1,9 +1,14 @@
 from .base import *
 
 
+# SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 TEMPLATE_DEBUG = True
 
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = '{{ secret_key }}'
+
+
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
 

+ 0 - 24
wagtail/project_template/project_name/settings/production.py

@@ -1,34 +1,10 @@
 from .base import *
 
 
-# Disable debug mode
-
 DEBUG = False
 TEMPLATE_DEBUG = False
 
 
-# Compress static files offline
-# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
-
-COMPRESS_OFFLINE = True
-
-
-# Use Redis as the cache backend for extra performance
-# (requires the django-redis-cache package):
-# http://wagtail.readthedocs.org/en/latest/howto/performance.html#cache
-
-# CACHES = {
-#     'default': {
-#         'BACKEND': 'redis_cache.cache.RedisCache',
-#         'LOCATION': '127.0.0.1:6379',
-#         'KEY_PREFIX': '{{ project_name }}',
-#         'OPTIONS': {
-#             'CLIENT_CLASS': 'redis_cache.client.DefaultClient',
-#         }
-#     }
-# }
-
-
 try:
     from .local import *
 except ImportError:

+ 0 - 0
wagtail/project_template/core/static/css/project_name.scss → wagtail/project_template/project_name/static/css/project_name.css


+ 0 - 0
wagtail/project_template/core/static/js/project_name.js → wagtail/project_template/project_name/static/js/project_name.js


+ 0 - 0
wagtail/project_template/core/templates/404.html → wagtail/project_template/project_name/templates/404.html


+ 0 - 0
wagtail/project_template/core/templates/500.html → wagtail/project_template/project_name/templates/500.html


+ 4 - 8
wagtail/project_template/core/templates/base.html → wagtail/project_template/project_name/templates/base.html

@@ -12,10 +12,8 @@
         <meta name="description" content="" />
         <meta name="viewport" content="width=device-width, initial-scale=1" />
 
-        {% templatetag openblock %} compress css {% templatetag closeblock %}
-            {# Global stylesheets #}
-            <link rel="stylesheet" type="text/css" href="{% templatetag openblock %} static 'css/{{ project_name }}.css' {% templatetag closeblock %}">
-        {% templatetag openblock %} endcompress {% templatetag closeblock %}
+        {# Global stylesheets #}
+        <link rel="stylesheet" type="text/css" href="{% templatetag openblock %} static 'css/{{ project_name }}.css' {% templatetag closeblock %}">
 
         {% templatetag openblock %} block extra_css {% templatetag closeblock %}
             {# Override this in templates to add extra stylesheets #}
@@ -27,10 +25,8 @@
 
         {% templatetag openblock %} block content {% templatetag closeblock %}{% templatetag openblock %} endblock {% templatetag closeblock %}
 
-        {% templatetag openblock %} compress js {% templatetag closeblock %}
-            {# Global javascript #}
-            <script type="text/javascript" src="{% templatetag openblock %} static 'js/{{ project_name }}.js' {% templatetag closeblock %}"></script>
-        {% templatetag openblock %} endcompress {% templatetag closeblock %}
+        {# Global javascript #}
+        <script type="text/javascript" src="{% templatetag openblock %} static 'js/{{ project_name }}.js' {% templatetag closeblock %}"></script>
 
         {% templatetag openblock %} block extra_js {% templatetag closeblock %}
             {# Override this in templates to add extra javascript #}

+ 6 - 6
wagtail/project_template/project_name/urls.py

@@ -1,12 +1,8 @@
-import os
-
 from django.conf.urls import include, url
-from django.conf.urls.static import static
 from django.conf import settings
 from django.contrib import admin
 
 from wagtail.wagtailadmin import urls as wagtailadmin_urls
-from wagtail.wagtailsearch import urls as wagtailsearch_urls
 from wagtail.wagtaildocs import urls as wagtaildocs_urls
 from wagtail.wagtailcore import urls as wagtail_urls
 
@@ -15,15 +11,19 @@ urlpatterns = [
     url(r'^django-admin/', include(admin.site.urls)),
 
     url(r'^admin/', include(wagtailadmin_urls)),
-    url(r'^search/', include(wagtailsearch_urls)),
     url(r'^documents/', include(wagtaildocs_urls)),
 
+    url(r'^search/$', 'search.views.search', name='search'),
+
     url(r'', include(wagtail_urls)),
 ]
 
 
 if settings.DEBUG:
+    from django.conf.urls.static import static
     from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+    from django.views.generic import TemplateView
 
+    # Serve static and media files from development server
     urlpatterns += staticfiles_urlpatterns()
-    urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images'))
+    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

+ 4 - 2
wagtail/project_template/project_name/wsgi.py

@@ -4,11 +4,13 @@ WSGI config for {{ project_name }} project.
 It exposes the WSGI callable as a module-level variable named ``application``.
 
 For more information on this file, see
-https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
+https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/
 """
 
 import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.production")
 
 from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
+
 application = get_wsgi_application()

+ 0 - 10
wagtail/project_template/requirements.txt

@@ -1,10 +0,0 @@
-# Minimal requirements
-Django>=1.7.1,<1.8
-wagtail==1.0b2
-
-# Recommended components (require additional setup):
-# psycopg2==2.5.2
-# elasticsearch==1.1.1
-
-# Recommended components to improve performance in production:
-# django-redis==3.8.2

+ 0 - 0
wagtail/project_template/core/templatetags/__init__.py → wagtail/project_template/search/__init__.py


+ 49 - 0
wagtail/project_template/search/templates/search/search.html

@@ -0,0 +1,49 @@
+{% templatetag openblock %} extends "base.html" {% templatetag closeblock %}
+{% templatetag openblock %} load static wagtailcore_tags {% templatetag closeblock %}
+
+{% templatetag openblock %} block body_class {% templatetag closeblock %}template-searchresults{% templatetag openblock %} endblock {% templatetag closeblock %}
+
+{% templatetag openblock %} block title {% templatetag closeblock %}Search{% templatetag openblock %} endblock {% templatetag closeblock %}
+
+{% templatetag openblock %} block content {% templatetag closeblock %}
+    <h1>Search</h1>
+
+    <form action="{% templatetag openblock %} url 'search' {% templatetag closeblock %}" method="get">
+        <input type="text" name="query"{% templatetag openblock %} if search_query {% templatetag closeblock %} value="{% templatetag openvariable %} search_query {% templatetag closevariable %}{% templatetag openblock %} endif {% templatetag closeblock %}">
+        <input type="submit" value="Search">
+    </form>
+
+    {% templatetag openblock %} if search_picks {% templatetag closeblock %}
+         <ul>
+            {% templatetag openblock %} for pick in search_picks {% templatetag closeblock %}
+                <li>
+                    <h2><a href="{% templatetag openvariable %} pick.page.url {% templatetag closevariable %}">{% templatetag openvariable %} pick.page {% templatetag closevariable %}</a></h2>
+                    <p>{% templatetag openvariable %} pick.description {% templatetag closevariable %}</p>
+                </li>
+             {% templatetag openblock %} endfor {% templatetag closeblock %}
+         </ul>
+    {% templatetag openblock %} endif {% templatetag closeblock %}
+
+    {% templatetag openblock %} if search_results {% templatetag closeblock %}
+        <ul>
+            {% templatetag openblock %} for result in search_results {% templatetag closeblock %}
+                <li>
+                    <h4><a href="{% templatetag openblock %} pageurl result {% templatetag closeblock %}">{% templatetag openvariable %} result {% templatetag closevariable %}</a></h4>
+                    {% templatetag openblock %} if result.search_description {% templatetag closeblock %}
+                        {% templatetag openvariable %} result.search_description|safe {% templatetag closevariable %}
+                    {% templatetag openblock %} endif {% templatetag closeblock %}
+                </li>
+            {% templatetag openblock %} endfor {% templatetag closeblock %}
+        </ul>
+
+        {% templatetag openblock %} if search_results.has_previous {% templatetag closeblock %}
+            <a href="{% templatetag openblock %} url 'search' {% templatetag closeblock %}?query={% templatetag openvariable %} search_query|urlencode {% templatetag closevariable %}&amp;page={% templatetag openvariable %} search_results.previous_page_number {% templatetag closevariable %}">Previous</a>
+        {% templatetag openblock %} endif {% templatetag closeblock %}
+
+        {% templatetag openblock %} if search_results.has_next {% templatetag closeblock %}
+            <a href="{% templatetag openblock %} url 'search' {% templatetag closeblock %}?query={% templatetag openvariable %} search_query|urlencode {% templatetag closevariable %}&amp;page={% templatetag openvariable %} search_results.next_page_number {% templatetag closevariable %}">Next</a>
+        {% templatetag openblock %} endif {% templatetag closeblock %}
+    {% templatetag openblock %} elif search_query {% templatetag closeblock %}
+        No results found
+    {% templatetag openblock %} endif {% templatetag closeblock %}
+{% templatetag openblock %} endblock {% templatetag closeblock %}

+ 39 - 0
wagtail/project_template/search/views.py

@@ -0,0 +1,39 @@
+from django.shortcuts import render
+from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
+
+from wagtail.wagtailcore.models import Page
+from wagtail.wagtailsearch.models import Query, EditorsPick
+
+
+def search(request):
+    search_query = request.GET.get('query', None)
+    page = request.GET.get('page', 1)
+
+    # Search
+    if search_query:
+        search_results = Page.objects.live().search(search_query)
+        query = Query.get(search_query)
+
+        # Record hit
+        query.add_hit()
+
+        # Get search picks
+        search_picks = query.editors_picks.all()
+    else:
+        search_results = Page.objects.none()
+        search_picks = EditorsPick.objects.none()
+
+    # Pagination
+    paginator = Paginator(search_results, 10)
+    try:
+        search_results = paginator.page(page)
+    except PageNotAnInteger:
+        search_results = paginator.page(1)
+    except EmptyPage:
+        search_results = paginator.page(paginator.num_pages)
+
+    return render(request, 'search/search.html', {
+        'search_query': search_query,
+        'search_results': search_results,
+        'search_picks': search_picks,
+    })

+ 0 - 33
wagtail/project_template/vagrant/provision.sh

@@ -1,33 +0,0 @@
-#!/bin/bash
-
-PROJECT_NAME=$1
-
-PROJECT_DIR=/home/vagrant/$PROJECT_NAME
-VIRTUALENV_DIR=/home/vagrant/.virtualenvs/$PROJECT_NAME
-
-PYTHON=$VIRTUALENV_DIR/bin/python
-PIP=$VIRTUALENV_DIR/bin/pip
-
-
-# Virtualenv setup for project
-su - vagrant -c "/usr/local/bin/virtualenv --system-site-packages $VIRTUALENV_DIR && \
-    echo $PROJECT_DIR > $VIRTUALENV_DIR/.project && \
-    PIP_DOWNLOAD_CACHE=/home/vagrant/.pip_download_cache $PIP install -r $PROJECT_DIR/requirements.txt"
-
-echo "workon $PROJECT_NAME" >> /home/vagrant/.bashrc
-
-
-# Set execute permissions on manage.py as they get lost if we build from a zip file
-chmod a+x $PROJECT_DIR/manage.py
-
-
-# Run syncdb/migrate/update_index
-su - vagrant -c "$PYTHON $PROJECT_DIR/manage.py migrate --noinput && \
-                 $PYTHON $PROJECT_DIR/manage.py update_index"
-
-
-# Add a couple of aliases to manage.py into .bashrc
-cat << EOF >> /home/vagrant/.bashrc
-alias dj="$PYTHON $PROJECT_DIR/manage.py"
-alias djrun="dj runserver 0.0.0.0:8000"
-EOF