Various startproject fixes,
-# source <(curl -L pypi.nowoczesnapolska.org.pl/django)
+# source <(curl d.nowoczesnapolska.org.pl)
# Make it a function, so that it works with `source`
start_project() {
# Make it a function, so that it works with `source`
start_project() {
-DJANGO_REQ='Django>=1.5,<1.6'
+DJANGO_REQ='Django>=1.6,<1.7'
+
+PYPI='http://pypi.nowoczesnapolska.org.pl/simple'
PROJECT_TEMPLATE='http://git.nowoczesnapolska.org.pl/?p=fnpdjango.git;a=snapshot;h=64c636d1e3ff35a7a1d3394fd1d3ff0093f44aa2;sf=tgz'
PROJECT_TEMPLATE='http://git.nowoczesnapolska.org.pl/?p=fnpdjango.git;a=snapshot;h=64c636d1e3ff35a7a1d3394fd1d3ff0093f44aa2;sf=tgz'
VIRTUALENVWRAPPER_PATHS="
/etc/bash_completion.d/virtualenvwrapper
/usr/bin/virtualenvwrapper.sh
VIRTUALENVWRAPPER_PATHS="
/etc/bash_completion.d/virtualenvwrapper
/usr/bin/virtualenvwrapper.sh
echo -e "${strong}Creating virtualenv: $PROJECT...${normal}"
mkvirtualenv "$PROJECT"
echo -e "${strong}Installing Django...${normal}"
echo -e "${strong}Creating virtualenv: $PROJECT...${normal}"
mkvirtualenv "$PROJECT"
echo -e "${strong}Installing Django...${normal}"
-pip install "$DJANGO_REQ"
+pip install -i "$PYPI" "$DJANGO_REQ"
+pip install -i "$PYPI" --pre django-startproject-plus
echo -e "${strong}Starting the project...${normal}"
echo -e "${strong}Starting the project...${normal}"
-django-admin.py startproject \
+django-startproject.py \
--template "$PROJECT_TEMPLATE" \
--template "$PROJECT_TEMPLATE" \
+ --name NOTICE \
+ --extra_context='{"year": "`date +%Y`"}' \
-WRAPPER="`ls`"
-mv "$WRAPPER/"* "$WRAPPER/".gitignore .
-rmdir "$WRAPPER"
-
chmod +x "$DJANGO_ROOT"/manage.py
mv "$DJANGO_ROOT/$PROJECT/localsettings.py.dev" "$DJANGO_ROOT/$PROJECT/localsettings.py"
echo -e "${strong}Installing requirements...${normal}"
chmod +x "$DJANGO_ROOT"/manage.py
mv "$DJANGO_ROOT/$PROJECT/localsettings.py.dev" "$DJANGO_ROOT/$PROJECT/localsettings.py"
echo -e "${strong}Installing requirements...${normal}"
-pip install -r requirements.txt
+pip install -i "$PYPI" -r requirements.txt
echo -e "${strong}Installing developer requirements...${normal}"
echo -e "${strong}Installing developer requirements...${normal}"
-pip install -r requirements-dev.txt
+pip install -i "$PYPI" -r requirements-dev.txt
echo -e "${strong}Running syncdb...${normal}"
"$DJANGO_ROOT"/manage.py syncdb --noinput
echo -e "${strong}Running syncdb...${normal}"
"$DJANGO_ROOT"/manage.py syncdb --noinput
+
+# The following is just for displaying it as a webpage:<!--
+#--><style>body{white-space:pre;color:#ddd}</style><h1 style="color:#000;text-align:center;position:fixed;top:0;bottom:0;left:0;right:0;white-space:normal">source <(curl <span id="location"></span>)</h1><script>document.getElementById('location').innerHTML=window.location;</script>
+
def check_localsettings():
def check_localsettings():
- if not files.exists('%(app_path)s/localsettings.py' % env):
- abort('localsettings.py file missing.')
+ return files.exists('%(app_path)s/localsettings.py' % env)
env.release = time.strftime('%Y-%m-%dT%H%M')
setup()
env.release = time.strftime('%Y-%m-%dT%H%M')
setup()
+ if not check_localsettings():
+ abort('Setup is complete, but\n %(app_path)s/localsettings.py\n'
+ 'is needed for actual deployment.' % env)
upload_tar_from_git()
copy_localsettings()
install_requirements()
upload_tar_from_git()
copy_localsettings()
install_requirements()
for service in env.services:
service.upload_sample()
for service in env.services:
service.upload_sample()
-def upload_sample(name):
+def upload_sample(name, where="samples/"):
require('app_path', 'project_name')
require('app_path', 'project_name')
- upload_path = '%(app_path)s/samples/' % env + name + '.sample'
+ upload_path = '%s/%s%s.sample' % (env['app_path'], where, name)
if files.exists(upload_path):
return
print '>>> upload %s template' % name
if files.exists(upload_path):
return
print '>>> upload %s template' % name
def upload_localsettings_sample():
"Fill out localsettings template and upload as a sample."
env.secret_key = get_random_string(50)
def upload_localsettings_sample():
"Fill out localsettings template and upload as a sample."
env.secret_key = get_random_string(50)
- upload_sample('localsettings.py')
+ upload_sample('localsettings.py', where="")
upload_nginx_sample = lambda: upload_sample('nginx')
upload_nginx_sample = lambda: upload_sample('nginx')
path = '%(app_path)s/releases/%(release)s' % dict(app_path = env['app_path'], release = release)
if 'django_root_path' in env:
path = join(path, env['django_root_path'])
path = '%(app_path)s/releases/%(release)s' % dict(app_path = env['app_path'], release = release)
if 'django_root_path' in env:
path = join(path, env['django_root_path'])
- return path
\ No newline at end of file
'%(project_name)s.nowoczesnapolska.org.pl',
)
'%(project_name)s.nowoczesnapolska.org.pl',
)
-PIWIK_URL = 'http://piwik.nowoczesnapolska.org.pl/'
-PIWIK_TOKEN = ''
+PIWIK_URL = '//piwik.nowoczesnapolska.org.pl/nocas/'
+PIWIK_SITE_ID = -1
MEDIA_ROOT = '%(app_path)s/media/'
STATIC_ROOT = '%(app_path)s/static/'
MEDIA_ROOT = '%(app_path)s/media/'
STATIC_ROOT = '%(app_path)s/static/'
- author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
+ author_email='radekczajka@nowoczesnapolska.org.pl',
url = '',
packages=find_packages(),
package_data={
url = '',
packages=find_packages(),
package_data={
'bin/fnpdjango_bootstrap.sh',
],
install_requires=[
'bin/fnpdjango_bootstrap.sh',
],
install_requires=[
'textile',
],
license='LICENSE',
'textile',
],
license='LICENSE',