aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-05-26 19:03:30 -0400
committerMike Crute <mcrute@gmail.com>2010-05-26 19:03:30 -0400
commit3332a4da8d3ebfbda6dca7934d01061c0132a039 (patch)
tree0e2dcfe1e6cb47df0fdef2a3555bebb9d60c4f4f
parent55dfbc79f01fedee9ef3f4a7c09bcb4ff2a5bf74 (diff)
downloadchishop-3332a4da8d3ebfbda6dca7934d01061c0132a039.tar.bz2
chishop-3332a4da8d3ebfbda6dca7934d01061c0132a039.tar.xz
chishop-3332a4da8d3ebfbda6dca7934d01061c0132a039.zip
Adding devserver convenience command.
-rw-r--r--README12
-rwxr-xr-x[-rw-r--r--]setup.py30
2 files changed, 32 insertions, 10 deletions
diff --git a/README b/README
index bb30a5d..0414c56 100644
--- a/README
+++ b/README
@@ -10,19 +10,13 @@ Install dependencies::
10 10
11 $ python setup.py install 11 $ python setup.py install
12 12
13Initial configuration 13Initial configuration::
14---------------------
15::
16 14
17 $ $EDITOR chishop/settings.py 15 $ $EDITOR chishop/settings.py
18 $ export DJANGO_SETTINGS_FILE="chishop.settings"
19 $ django-admin.py syncdb
20 16
21Run the PyPI server 17Run the PyPI server::
22-------------------
23::
24 18
25 $ django-admin.py runserver 19 $ python setup.py devserver
26 20
27Please note that ``chishop/media/dists`` has to be writable by the 21Please note that ``chishop/media/dists`` has to be writable by the
28user the web-server is running as. 22user the web-server is running as.
diff --git a/setup.py b/setup.py
index cb03934..626484e 100644..100755
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,35 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# -*- coding: utf-8 -*- 2# -*- coding: utf-8 -*-
3 3
4import os
4import codecs 5import codecs
5import djangopypi 6import djangopypi
6from setuptools import setup, find_packages 7from setuptools import setup, find_packages
8from distutils.core import Command
9from subprocess import call
10
11
12class devserver(Command):
13 """
14 Convenience command to sync the database and run a
15 development server.
16
17 $ python setup.py runserver
18 """
19
20 description = "run the django development server"
21
22 # Must be overridden even though we don't need them
23 user_options = []
24 initialize_options = finalize_options = lambda self: None
25
26 def run(self):
27 environ = os.environ.copy()
28 environ['DJANGO_SETTINGS_MODULE'] = 'chishop.settings'
29
30 call(['django-admin.py', 'syncdb'], env=environ)
31 call(['django-admin.py', 'runserver'], env=environ)
32
7 33
8setup( 34setup(
9 name='chishop', 35 name='chishop',
@@ -13,7 +39,6 @@ setup(
13 author='Ask Solem', 39 author='Ask Solem',
14 author_email='askh@opera.com', 40 author_email='askh@opera.com',
15 url="http://ask.github.com/chishop", 41 url="http://ask.github.com/chishop",
16 zip_safe=False,
17 install_requires=[ 42 install_requires=[
18 'django>=1.0', 43 'django>=1.0',
19 'docutils', 44 'docutils',
@@ -22,6 +47,9 @@ setup(
22 dependency_links=[ 47 dependency_links=[
23 'http://bitbucket.org/ubernostrum/django-registration/downloads', 48 'http://bitbucket.org/ubernostrum/django-registration/downloads',
24 ], 49 ],
50 cmdclass={
51 'devserver': devserver,
52 },
25 classifiers=[ 53 classifiers=[
26 "Development Status :: 3 - Alpha", 54 "Development Status :: 3 - Alpha",
27 "Environment :: Web Environment", 55 "Environment :: Web Environment",