GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devassistant/dapi: DevAssistant Package Index

This repository was archived by the owner on Nov 12, 2019. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

348 Commits
348 Commits

Folders and files

NameName
Last commit message
Last commit date
.openshift
.openshift
 
 
wsgi
wsgi
 
 
.gitignore
.gitignore
 
 
COPYING
COPYING
 
 
README.md
README.md
 
 
requirements-local.txt
requirements-local.txt
 
 
setup.py
setup.py
 
 
wsgi.py
wsgi.py
 
 

Repository files navigation

Dapi on OpenShift

This is Dapi - the DevAssistant Package Index.

It's Django app running on OpenShift using Python 2.7 and PostgreSQL 9.2 cartridges.

Running on localhost

If you want to run this on localhost for testing a development, follow those steps:

  1. Install python, pip, virtualenv and sqlite3 (in case you don't have it already)
  2. Clone the repo
  3. Open shell in the repo and run:
virtualenv venv
. venv/bin/activate
pip install -r requirements-local.txt
cd wsgi/
python manage.py syncdb --noinput
python manage.py migrate
python manage.py schemamigration dapi --initial
python manage.py migrate dapi
mkdir upload
echo GITHUB-API-ID > github # see section Github tokens
echo GITHUB-API-SECRET >> github
python manage.py runserver

Keep the shell opened. Go to the URL that runserver tells you to go to, log in with Fedora or Github. Go back to the shell. Exit the server with Ctrl+C.

To make you an administrator:

python manage.py shell << EOM
from django.contrib.auth.models import User
u = User.objects.get(pk=1)
u.is_superuser = True
u.is_staff = True
u.save()
EOM

Use python manage.py runserver to run again. To deactivate your virtualenv environment, run deactivate.

To run the app next time, just open a shell in the cloned repo and run:

. venv/bin/activate
python wsgi/manage.py runserver

Deploying

If you want to deploy this on OpenShift, follow those steps:

  1. Create Python 2.7 app on OpenShift (via web or rhc)
  2. Add PostgreSQL cartridge (via web or rhc)
  3. Clone this repository
  4. git remote add upstream -m master OPENSHIFT-GIT-URL # something like ssh://[email protected]/~/git/app.git/
  5. Don't forget to update settings.py with your e-mail address, ALLOWED_HOSTS and SITE_URL.
  6. git push openshift devel:master - replace devel with your local branch if necessary
  7. ssh to the OpenShift app and run the following:
cd app-root/repo/wsgi/
python manage.py syncdb --noinput
python manage.py migrate
python manage.py schemamigration dapi --initial
python manage.py migrate dapi
cp -r dapi/migrations ${OPENSHIFT_DATA_DIR}
mkdir ${OPENSHIFT_DATA_DIR}upload
echo GITHUB-API-ID > ${OPENSHIFT_DATA_DIR}github # see section Github tokens
echo GITHUB-API-SECRET >> ${OPENSHIFT_DATA_DIR}github

Keep the ssh shell opened. Go to http://website.url/, log in with Fedora or Github. Go back to ssh shell.

To make you an administrator:

python manage.py shell << EOM
from django.contrib.auth.models import User
u = User.objects.get(pk=1) # or use (username=<username>) to be sure
u.is_superuser = True
u.is_staff = True
u.save()
EOM

Github tokens

Create a Github app as described in python-socail-auth docs.

Save Client ID and Client Secret to a simple plaintext file (first line ID, second line secret) and save it as github. On localhost, save the file to wsgi/, on Openshift, save the file to $OPENSHIFT_DATA_DIR. Use different key/secret combo for localhost and for Openshift. In the above doc those keys are referenced with GITHUB-API-ID and GITHUB-API-SECRET.

About

DevAssistant Package Index

dapi.devassistant.org/

Resources

Readme
AGPL-3.0 license
Activity
Custom properties

Stars

2 stars

Watchers

2 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.