diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-01 00:53:12 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-12-01 00:53:12 -0500 |
commit | ad54af54f3af11bad7b020527c11d18cf94c2ab3 (patch) | |
tree | 71c6fee45563c7a0d616325e1eca52f1742490b6 | |
parent | 474290795424774700867205f32dec0f2618b614 (diff) |
Update localsettings.py.example, README, etc for parabolaweb.
-rw-r--r-- | README | 85 | ||||
-rw-r--r-- | local_settings.py.example | 29 | ||||
l--------- | media/admin_media | 2 | ||||
-rw-r--r-- | requirements.txt | 1 |
4 files changed, 78 insertions, 39 deletions
@@ -1,4 +1,4 @@ -# Archweb README +# Parabolaweb README To get a pretty version of this document, run @@ -19,55 +19,84 @@ See AUTHORS file. # Python dependencies -More detail in `requirements.txt` and `requirements_prod.txt`; it is best to -use virtualenv and pip to handle these. But if you insist on (Arch Linux) -packages, you will probably want the following: - -- mysql-python or python-pysqlite -- django -- python-markdown -- python-south -- python-memcached - +We're going to use pip to handle python dependencies, m'kay? +Worry about that in step 3. + # Testing Installation +Throughout this, we assume that parabolaweb is installed in a +directory called `parabolaweb`. This is not nescessarily true. On the +main server, it's in `/srv/http/web'. Wherever you see this in a +command, know that you should just replace it with the correct path +for your install. + 1. Run `virtualenv2`. - $ cd /path/to/archweb && virtualenv2 ../archweb-env + $ cd /path/to/parabolaweb && virtualenv2 `pwd`-env + + Here I just had you use `pwd` to choose the environment + directory. You can use anything, but it is recomended that it not + be the same directory as the install. 2. Activate the virtualenv. - $ source ../archweb-env/bin/activate + $ source `pwd`-env/bin/activate + +3. Fix symlink to the environment + + (parabolaweb-env) $ ln -sf ../../parabolaweb-env/lib/python2.7/site-packages/django/contrib/admin/media media/admin_meda -2. Install dependencies through `pip`. + Of ourse change `../../parabolaweb-env` to the relative path to + your environment. Keep in mind that the path is relative from + inside the `media/` directory, not the current directory. - (archweb-env) $ pip install -r requirements.txt +4. Install dependencies through `pip`. -3. Copy `local_settings.py.example` to `local_settings.py` and modify. + To install base dependencies, run + (parabolweb-env) $ pip install -r requirements.txt + + After that you will need to install a database engine for python. + This means `MySQL-python==1.2.3`, `pysqlite` or whatever the + package is for PostgreSQL. Eg: + (parabolweb-env) $ pip install MySQL-python==1.2.3 + + You may also want to install memcached + (parabolweb-env) $ pip install python-memcached==1.47 + + Alternately, to have MySQL and memcached installed automatically, run + (parabolweb-env) $ pip install -r requirements_prod.txt + +5. Copy `local_settings.py.example` to `local_settings.py` and modify. Make sure to uncomment the appropriate db section (either sqlite or mysql). -4. Sync the database to create it. +6. Sync the database to create it. - (archweb-env) $ ./manage.py syncdb + (parabolaweb-env) $ ./manage.py syncdb -5. Migrate changes. +7. Migrate changes. - (archweb-env) $ ./manage.py migrate + (parabolaweb-env) $ ./manage.py migrate -6. Load the fixtures to prepopulate some data. If you don't want some of the +8. Load the fixtures to prepopulate some data. If you don't want some of the provided data, adjust the file glob accordingly. - (archweb-env) $ ./manage.py loaddata */fixtures/*.json + (parabolaweb-env) $ for file in */fixtures/*.json; do \ + ./manage.py loaddata $file; \ + done + + The reason we use a loop instead of just calling them with a glob + is that groups.json is expected to fail, and this way it won't + prevent others from loading. -7. Use the following commands to start a service instance +9. Use the following commands to start a service instance - (archweb-env) $ ./manage.py runserver + (parabolaweb-env) $ ./manage.py runserver -8. To optionally populate the database with real data: +10. To optionally populate the database with real data: - (archweb-env) $ wget ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz - (archweb-env) $ ./manage.py reporead i686 core.db.tar.gz - (archweb-env) $ ./manage.py syncisos + $ wget http://repo.parabolagnulinux.org/core/os/i686/core.db.tar.gz + $ ./manage.py reporead i686 core.db.tar.gz + $ ./manage.py syncisos Alter architecture and repo to get x86\_64 and packages from other repos if needed. diff --git a/local_settings.py.example b/local_settings.py.example index bad03921..4ad87a36 100644 --- a/local_settings.py.example +++ b/local_settings.py.example @@ -1,9 +1,9 @@ -### Django settings for archlinux project. +### Django settings for Parabola GNU/Linux-libre project. ## Debug settings -DEBUG = False -TEMPLATE_DEBUG = True -DEBUG_TOOLBAR = True +DEBUG = True # As far as I can tell, this must be True for /media/* URLs to work +TEMPLATE_DEBUG = True # More helpful this way +DEBUG_TOOLBAR = False # Must install package django-debug-toolbar to use ## For django debug toolbar INTERNAL_IPS = ('127.0.0.1',) @@ -17,15 +17,24 @@ ADMINS = ( DATABASES = { 'default': { 'ENGINE' : 'django.db.backends.mysql', - 'NAME' : 'archlinux', - 'USER' : 'archlinux', - 'PASSWORD': 'archlinux', + 'NAME' : 'parabola', + 'USER' : 'parabola', + 'PASSWORD': 'parabola', 'HOST' : '', 'PORT' : '', - 'OPTIONS' : {'init_command': 'SET storage_engine=InnoDB'}, + # InnoDB WILL NOT work + 'OPTIONS' : {'init_command': 'SET storage_engine=MyISAM'}, }, } +## sqlite3 Database settings +#DATABASES = { +# 'default': { +# 'ENGINE' : 'sqlite3', +# 'NAME' : '/srv/http/web/db.sqlite', +# }, +#} + ## Define cache settings CACHES = { 'default': { @@ -43,10 +52,10 @@ CACHE_MIDDLEWARE_SECONDS = 300 SESSION_COOKIE_SECURE = False ## location for saving dev pictures -MEDIA_ROOT = '/srv/example.com/img/' +MEDIA_ROOT = '/srv/http/media/devs/' ## web url for serving image files -MEDIA_URL = 'http://example.com/img/' +MEDIA_URL = '/media/' ## Make this unique, and don't share it with anybody. SECRET_KEY = '00000000000000000000000000000000000000000000000' diff --git a/media/admin_media b/media/admin_media index 585cf837..3d6781eb 120000 --- a/media/admin_media +++ b/media/admin_media @@ -1 +1 @@ -/usr/lib/python2.7/site-packages/django/contrib/admin/media
\ No newline at end of file +../../web-env/lib/python2.7/site-packages/django/contrib/admin/media/
\ No newline at end of file diff --git a/requirements.txt b/requirements.txt index fd58616e..5704435e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Django==1.3.1 Markdown==2.0.3 South==0.7.3 +pyinotify==0.9.2 pytz>=2011n |