Permalink
Browse files

Squashed commit of the following: Added create-tendenci-project comma…

…nd with install instructions.

commit c9c13c9
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 16:59:29 2012 -0600

    Updated the install instructions with the new install script.

commit 9125cf7
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 15:53:57 2012 -0600

    Update writing out site settings and the initial site theme.

commit b7ff77a
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 15:28:24 2012 -0600

    Additional updates to the create-tendenci-project command line tool.

commit 62d2ebd
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 14:22:34 2012 -0600

    Geraldo update. Move over requirements.txt.

commit 8a7231f
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 10:33:32 2012 -0600

    Updating version numbers and removing some file patterns from the standard exclude.

commit b12064e
Author: jmoswalt <jmoswalt@gmail.com>
Date:   Tue Dec 4 09:55:25 2012 -0600

    Adding a console script to install the tendenci-site django project files
  • Loading branch information...
1 parent bb6e2c2 commit 8165a39579db14151b44eb26244e39a540e75edc @jmoswalt jmoswalt committed Dec 4, 2012
Showing with 2,993 additions and 13 deletions.
  1. +122 −2 INSTALL.md
  2. +15 −8 setup.py
  3. +3 −3 tendenci/apps/theme_editor/settings.json
  4. 0 tendenci/bin/__init__.py
  5. +66 −0 tendenci/bin/create_tendenci_project.py
  6. +43 −0 tendenci/project_template/.env_example
  7. +31 −0 tendenci/project_template/.gitignore
  8. +189 −0 tendenci/project_template/INSTALL.md
  9. +1 −0 tendenci/project_template/Procfile
  10. +37 −0 tendenci/project_template/README.md
  11. +4 −0 tendenci/project_template/addons/README.md
  12. +1 −0 tendenci/project_template/addons/__init__.py
  13. +2 −0 tendenci/project_template/addons/videos/__init__.py
  14. +54 −0 tendenci/project_template/addons/videos/admin.py
  15. +23 −0 tendenci/project_template/addons/videos/app_registry.py
  16. +105 −0 tendenci/project_template/addons/videos/embedly.py
  17. +39 −0 tendenci/project_template/addons/videos/feeds.py
  18. +56 −0 tendenci/project_template/addons/videos/forms.py
  19. +7 −0 tendenci/project_template/addons/videos/managers.py
  20. +242 −0 tendenci/project_template/addons/videos/migrations/0001_initial.py
  21. 0 tendenci/project_template/addons/videos/migrations/__init__.py
  22. +126 −0 tendenci/project_template/addons/videos/models.py
  23. +27 −0 tendenci/project_template/addons/videos/search_indexes.py
  24. +19 −0 tendenci/project_template/addons/videos/settings.json
  25. +6 −0 tendenci/project_template/addons/videos/signals.py
  26. +57 −0 tendenci/project_template/addons/videos/static/css/video.css
  27. +11 −0 tendenci/project_template/addons/videos/templates/search/indexes/videos/video_text.txt
  28. +47 −0 tendenci/project_template/addons/videos/templates/videos/base.html
  29. +37 −0 tendenci/project_template/addons/videos/templates/videos/details.html
  30. +14 −0 tendenci/project_template/addons/videos/templates/videos/list.html
  31. +68 −0 tendenci/project_template/addons/videos/templates/videos/meta.html
  32. +14 −0 tendenci/project_template/addons/videos/templates/videos/options.html
  33. +17 −0 tendenci/project_template/addons/videos/templates/videos/search-result.html
  34. 0 tendenci/project_template/addons/videos/templatetags/__init__.py
  35. +19 −0 tendenci/project_template/addons/videos/templatetags/video_filters.py
  36. +73 −0 tendenci/project_template/addons/videos/templatetags/video_tags.py
  37. +10 −0 tendenci/project_template/addons/videos/urls.py
  38. +79 −0 tendenci/project_template/addons/videos/views.py
  39. +54 −0 tendenci/project_template/conf/__init__.py
  40. +6 −0 tendenci/project_template/conf/s3utils.py
  41. +407 −0 tendenci/project_template/conf/settings.py
  42. +31 −0 tendenci/project_template/conf/urls.py
  43. +28 −0 tendenci/project_template/conf/wsgi.py
  44. +9 −0 tendenci/project_template/deploy.py
  45. +10 −0 tendenci/project_template/manage.py
  46. +12 −0 tendenci/project_template/requirements.txt
  47. +1 −0 tendenci/project_template/themes/install.md
  48. +274 −0 tendenci/project_template/themes/salonify/media/css/styles.less
  49. BIN tendenci/project_template/themes/salonify/media/images/apple-touch-icon.png
  50. BIN tendenci/project_template/themes/salonify/media/images/bg.jpg
  51. BIN tendenci/project_template/themes/salonify/media/images/bg.png
  52. BIN tendenci/project_template/themes/salonify/media/images/bg2.jpg
  53. BIN tendenci/project_template/themes/salonify/media/images/facebook.jpg
  54. BIN tendenci/project_template/themes/salonify/media/images/facebook.png
  55. BIN tendenci/project_template/themes/salonify/media/images/favicon.ico
  56. BIN tendenci/project_template/themes/salonify/media/images/flickr.jpg
  57. BIN tendenci/project_template/themes/salonify/media/images/heading-bg.png
  58. BIN tendenci/project_template/themes/salonify/media/images/jackalope-logo.png
  59. BIN tendenci/project_template/themes/salonify/media/images/linkedin.png
  60. BIN tendenci/project_template/themes/salonify/media/images/logo.jpg
  61. BIN tendenci/project_template/themes/salonify/media/images/rotator-tab-active-bg.png
  62. BIN tendenci/project_template/themes/salonify/media/images/rotator-tab-bg.png
  63. BIN tendenci/project_template/themes/salonify/media/images/twitter.jpg
  64. BIN tendenci/project_template/themes/salonify/media/images/twitter.png
  65. +27 −0 tendenci/project_template/themes/salonify/media/js/jquery.cycle.all.min.js
  66. +44 −0 tendenci/project_template/themes/salonify/media/js/jquery.hint.js
  67. +16 −0 tendenci/project_template/themes/salonify/media/js/less-1.1.3.min.js
  68. +30 −0 tendenci/project_template/themes/salonify/media/js/libs/modernizr-1.6.min.js
  69. BIN tendenci/project_template/themes/salonify/screenshot.png
  70. +114 −0 tendenci/project_template/themes/salonify/settings.json
  71. +51 −0 tendenci/project_template/themes/salonify/templates/default.html
  72. +9 −0 tendenci/project_template/themes/salonify/templates/footer.html
  73. +42 −0 tendenci/project_template/themes/salonify/templates/header.html
  74. +124 −0 tendenci/project_template/themes/salonify/templates/homepage.html
  75. +33 −0 tendenci/project_template/themes/salonify/templates/sidebar.html
  76. +7 −0 tendenci/project_template/themes/salonify/theme.info
View
@@ -1,5 +1,125 @@
# Tendenci Installation
-For information on how to install Tendenci, please see the related Django project at [https://github.com/tendenci/tendenci-site](https://github.com/tendenci/tendenci-site/blob/master/INSTALL.md).
+You can use the following installation instructions to install a local Tendenci site. This Django project is intended to help create a Tendenci site that you can deploy on a public hosting, but it's recommended that you install locally first in order to test your themes and designs.
-It has been updated to use a /conf/settings.py type configuration with .env files. See the deploy.asp file in the core product for dependencies.
+## Setting up the database
+
+Tendenci is designed for use with PostgreSQL. You will need to have a PostgreSQL server running locally. If you are on OS X, we recommend Postgres.app: [http://postgresapp.com/](http://postgresapp.com/) to get up and running fast.
+
+With Postgres.app installed, you can create a database from Terminal:
+
+ psql -h localhost -c "CREATE DATABASE tendenci"
+
+You can also create a database in your GUI of choice (recommended: [http://www.pgadmin.org/](http://www.pgadmin.org/)).
+
+For more on installing PostgreSQL for Django check the docs at: [https://docs.djangoproject.com/en/dev/ref/databases/#postgresql-notes](https://docs.djangoproject.com/en/dev/ref/databases/#postgresql-notes)
+
+## Downloading Tendenci
+
+Make a folder for your site and cd into it. Replace 'sitename' with the name of your site.
+
+ mkdir sitename
+ cd sitename
+
+You will need [virtualenv](http://www.virtualenv.org/) installed for the next step. If you don't have it, you can install it with `pip install virtualenv`. Make a virtual environment called 'venv' and activate it.
+
+ virtualenv venv
+ source venv/bin/activate
+
+Install Tendenci. This download and install step may take a few minutes.
+
+ pip install git+https://github.com/tendenci/tendenci
+
+Once this is done, you can setup django project with the following:
+
+ create-tendenci-project
+
+If you created a database with a name other than 'tendenci', you will need to edit the database name 'tendenci' inside the `.env` file that is created.
+
+**Optional:** You can add additional local environment variables to the `.env` file by defining them as `KEY='value'`. Settings that are sensitive (like passwords) or vary per environment should be added to this file. For example, to use Amazon's S3 service as a file storage backend, set the following key/value pairs in your `.env` file:
+
+ AWS_ACCESS_KEY_ID='MY_ACCESS_KEY'
+ AWS_SECRET_ACCESS_KEY='MY_SECRET_KEY'
+ AWS_STORAGE_BUCKET_NAME='bucket_name'
+ AWS_LOCATION='new-site-name'
+
+Next, we run our deploy script and setup our theme.
+
+ python deploy.py
+ python manage.py set_theme salonify
+
+To create your login, run the following command and fill in the prompts:
+
+ python manage.py createsuperuser
+
+Finally, we can use the runserver command so that we can view the site in our browser:
+
+ python manage.py runserver
+
+Open http://127.0.0.1:8000/ in your browser to see your tendenci site!
+
+# Deploying on Heroku
+
+You do not need to be able to run tendenci locally in order to deploy to Heroku. Simply follow the steps below if you do want to load your site on Heroku's server environment.
+
+## Prerequisites
+
+You need to have a Heroku account: [http://heroku.com](http://heroku.com), the heroku toolbelt: [https://toolbelt.heroku.com/](https://toolbelt.heroku.com/), and git: [http://git-scm.com/](http://git-scm.com/) installed. It is also recommended that you have your payment options configured, though all of the settings below allow your site to run for free.
+
+## Cloning and pushing to Heroku
+
+For the instructions below, please replace `sitename` with the name of your site. The name can contain dashes or underscores, but not spaces.
+
+You can now create a new git repo from this code that will be specific to your site. Go to your sitename folder from the terminal and run the following:
+
+ git init
+ heroku create sitename
+ git add .
+ git commit -am "initial commit"
+ git push heroku master
+
+Your site will now be created on Heroku. The first build may take up to 15 minutes due to the initial download of all of the dependencies. Additional updates will not take as long.
+
+## Configuring Heroku Addons
+
+Heroku offers several addons: [https://addons.heroku.com/](https://addons.heroku.com/) for apps that include Database connections, Memcached caching, email servers, and other useful addons. We will use the database and the Memcached addons in the instructions below.
+
+You can add on the free tier of the memcache addon: [https://addons.heroku.com/memcache](https://addons.heroku.com/memcache) by running the following command. This addon is free, but you need to have verified your account to add it:
+
+ heroku addons:add memcache:5mb
+
+To configure the database, we must add the database and then promote it as the main database. Database names from Heroku's Postgresql service: [https://postgres.heroku.com/](https://postgres.heroku.com/) follow the pattern `HEROKU_POSTGRESQL_COLOR` where `COLOR` is an actual color name like `TEAL` or `ORANGE`. This will vary per installation, but we can look this up by running `heroku config`. The second command below will find the default color name and use it.
+
+To create and configure the database, run the following commands:
+
+ heroku addons:add heroku-postgresql:dev
+ heroku pg:promote `heroku config | grep POSTGRES | cut -d : -f 1`
+
+## Setting up the database
+
+Next, we can run the deploy script to populate the database. The theme `salonify` is used below by default, but you may create a custom theme and set your theme to that themes.
+
+ heroku run python deploy.py
+ heroku run python manage.py set_theme salonify
+ heroku run python manage.py createsuperuser
+
+## Configuring static assets
+
+We have two options for static assets: serving them locally and loading from a remote location like Amazon S3: [http://aws.amazon.com/s3/](http://aws.amazon.com/s3/).
+
+**WARNING** - If you use the local storage, any uploaded files may be **deleted** when you update your site. This is not recommended for a live website. You should setup S3 instead.
+
+To configure S3, set the config options with the following command:
+
+ heroku config:set AWS_ACCESS_KEY_ID='MY_ACCESS_KEY'
+ heroku config:set AWS_SECRET_ACCESS_KEY='MY_SECRET_KEY'
+ heroku config:set AWS_STORAGE_BUCKET_NAME='bucket_name'
+ heroku config:set AWS_LOCATION='new-site-name'
+
+Now, run the following command:
+
+ heroku run python manage.py collectstatic --noinput
+
+Finally, you can open your site!
+
+ heroku open
View
@@ -13,7 +13,7 @@ def read(*path):
# Provided as an attribute, so you can append to these instead
# of replicating them:
-standard_exclude = ["*.py", "*.pyc", "*~", ".*", "*.bak"]
+standard_exclude = ["*.pyc", "*~", "*.bak"]
standard_exclude_directories = [
".*", "CVS", "_darcs", "./build",
"./dist", "EGG-INFO", "*.egg-info"
@@ -126,23 +126,23 @@ def find_package_data(where=".", package="", exclude=standard_exclude,
long_description=LONG_DESCRIPTION,
platforms=['any'],
classifiers=CLASSIFIERS,
+ entry_points="""
+ [console_scripts]
+ create-tendenci-project=tendenci.bin.create_tendenci_project:create_project
+ """,
include_package_data=True,
dependency_links=[
-# "http://github.com/tendenci/geraldo/tarball/master#egg=Geraldo-0.4.14",
"https://github.com/tendenci/django-model-report/tarball/master#egg=django-model-report-0.0.9",
"http://a.pypi.python.org/",
"http://g.pypi.python.org/",
],
- setup_requires=[
- "Reportlab==2.5",
- ],
install_requires=[
"Django==1.4.2",
"pisa",
"Reportlab==2.5",
"html5lib",
"PIL==1.1.7",
- "South==0.7.3",
+ "South==0.7.5",
"anyjson>=0.2.4",
"django-authority>=0.4",
"django-avatar>=1.0.4",
@@ -172,18 +172,25 @@ def find_package_data(where=".", package="", exclude=standard_exclude,
"django-celery==2.3.0",
"django-kombu>=0.9.4",
"mimeparse>=0.1.3",
- "python-dateutil>=1.5",
+ "python-dateutil==1.5",
"pdfminer==20110515",
"slate==0.3",
"stripe==1.7.2",
"pycrypto==2.6",
"boto==2.5.2",
"django-timezones==0.2",
"django-ses==0.4.1",
-# "Geraldo==0.4.14",
+ "Geraldo==0.4.16",
"django-tastypie",
"johnny-cache==1.4",
"docutils==0.9.1",
"django-model-report==0.0.9",
+ "dj-database-url==0.2.1",
+ "psycopg2==2.4.5",
+ "gunicorn==0.16.1",
+ "gevent==0.13.8",
+ "django-s3-folder-storage==0.1",
+ "django-storages==1.1.5",
+ "python-memcached==1.48",
],
)
@@ -1,15 +1,15 @@
[
{
- "default_value": "iceman",
+ "default_value": "salonify",
"description": "The current theme in use for the website.",
"data_type": "string",
"update_dt": "2011-08-04 12:38:23",
"input_type": "select",
"client_editable": true,
"name": "theme",
- "value": "thinksmart",
+ "value": "salonify",
"label": "Theme",
- "input_value": "default, iceman, thinksmart",
+ "input_value": "salonify",
"parent_id": 0,
"scope": "module",
"scope_category": "theme_editor",
No changes.
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+from __future__ import with_statement
+from distutils.dir_util import copy_tree
+from optparse import OptionParser
+import os
+from shutil import move
+from uuid import uuid4
+
+from django.utils.importlib import import_module
+
+
+def create_project():
+ """
+ Copies the contents of the project_template directory to the
+ current directory.
+
+ The logic for this type of project build out came from Mezzanine
+ https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/bin/mezzanine_project.py
+ """
+ parser = OptionParser(usage="usage: %prog")
+ project_path = os.path.join(os.getcwd())
+
+ # Create the list of packages to build from - at this stage it
+ # should only be one or two names, tendenci plus an alternate
+ # package.
+ packages = ["tendenci"]
+ for package_name in packages:
+ try:
+ __import__(package_name)
+ except ImportError:
+ parser.error("Could not import package '%s'" % package_name)
+
+ # Build the project up copying over the project_template from
+ # each of the packages.
+ for package_name in packages:
+ package_path = os.path.dirname(os.path.abspath(import_module(package_name).__file__))
+ copy_tree(os.path.join(package_path, "project_template"), project_path)
+ move(os.path.join(project_path, ".env_example"),
+ os.path.join(project_path, ".env"))
+
+ # Update the local environment file with custom KEYs
+ env_path = os.path.join(os.getcwd(), ".env")
+
+ # Generate a unique SECREY_KEY for the project's setttings module.
+ with open(env_path, "r") as f:
+ data = f.read()
+ with open(env_path, "w") as f:
+ secret_key = "%s%s" % (uuid4(), uuid4())
+ f.write(data.replace("your_unique_secret_key", secret_key))
+
+ # Generate a unique SITE_SETTINGS_KEY for the project's setttings module.
+ with open(env_path, "r") as f:
+ data = f.read()
+ with open(env_path, "w") as f:
+ setting_key = "%s%s" % (uuid4(), uuid4())
+ f.write(data.replace("your_tendenci_sites_settings_key", setting_key[:32]))
+
+ # Clean up pyc files.
+ for (root, dirs, files) in os.walk(project_path, False):
+ for f in files:
+ if f.endswith(".pyc"):
+ os.remove(os.path.join(root, f))
+
+if __name__ == "__main__":
+ create_project()
@@ -0,0 +1,43 @@
+# Copy this file and rename it .env to populate your local environment.
+# Lines beginning with # are comments. Be sure to uncomment your real variables.
+#
+# Key/values can be separated by : or = characters.
+# Values can be wrapped in '', "", or no wrapping characters.
+# Spaces can be in the middle or end of a line.
+# Here are some examples of keys and values:
+#
+# A_KEY: value
+# B_KEY = True
+# C_KEY : 'this value'
+# D_KEY="another-key-value"
+#
+# Values of False or True will be returned as booleans.
+
+
+# DATABASE
+DATABASE_URL='postgres://localhost/tendenci'
+
+# AWS/S3 usage depends on all 4 settings below being set.
+#AWS_ACCESS_KEY_ID='your_key_id'
+#AWS_SECRET_ACCESS_KEY='your_access_key_id'
+#AWS_STORAGE_BUCKET_NAME='bucket_name'
+#AWS_LOCATION='your_name'
+
+
+SECRET_KEY='your_unique_secret_key'
+# SITE_SETTINGS_KEY must be 32 characters
+SITE_SETTINGS_KEY='your_tendenci_sites_settings_key'
+
+
+# Some other settings below can be uncommented to be used.
+# They may be helpful in development situations.
+
+#DEBUG='True'
+#LOCAL_MEMCACHED_URL = '127.0.0.1:11211'
+
+# SITE_MODE of dev is used to read the theme locally
+# even if S3 settings are setup.
+# This setting is 'prod' by default, which will base the theme
+# path on whether or not S3 is configured
+
+#SITE_MODE='dev'
@@ -0,0 +1,31 @@
+# Ignore all local development files
+# local_settings.py
+django
+*.db
+
+# Ignore ephemeral directories
+# during local development
+/cache
+/media
+
+# Ignore all dotfiles...
+.*
+
+# Ignore all pyc file
+*.pyc
+
+# Ignore plugins json
+plugins_list.json
+addons_list.json
+
+# except for .gitignore and .env_example
+!/.gitignore
+!/.env_example
+
+venv/
+tendenci-site/local.py
+conf/local.py
+/static
+
+/schema.xml
+celeryd.pid
Oops, something went wrong.

0 comments on commit 8165a39

Please sign in to comment.