Go to file
Oliver Marks 9d50b92f40 Fix up user rfid urls 2018-01-15 18:32:19 +00:00
compose Cleanup, and better handling in the cancellation flow more work to come 2017-10-01 23:16:32 +01:00
config Added flag to track completed equipment requests 2018-01-14 18:25:02 +00:00
docs Moved all files up one folder 2017-01-04 18:11:25 +00:00
mhackspace Fix up user rfid urls 2018-01-15 18:32:19 +00:00
requirements Added flag to track completed equipment requests 2018-01-14 18:25:02 +00:00
utility Moved all files up one folder 2017-01-04 18:11:25 +00:00
.drone.yml Fix up existing tests 2017-10-01 11:54:35 +01:00
.gitignore implemented django wiki, created requests page, and added to nav 2017-09-05 20:07:48 +01:00
.travis.yml Added support for Circle CI tests (#16) 2017-01-26 09:03:03 +00:00
CONTRIBUTORS.txt Moved all files up one folder 2017-01-04 18:11:25 +00:00
COPYING Moved all files up one folder 2017-01-04 18:11:25 +00:00
LICENSE Moved all files up one folder 2017-01-04 18:11:25 +00:00
README.org Better users generated in test data. 2017-09-15 14:05:22 +01:00
circle.yml Updated circle config to be Python 3 2017-01-26 13:30:14 +00:00
dev.yml celery integration tasks now working, improved feed image variation rendering 2017-08-22 22:47:44 +01:00
docker-compose.yml celery integration 2017-08-15 07:26:06 +01:00
env.example testing new celery task for auto notifications 2017-09-07 22:03:05 +01:00
live.yml celery integration 2017-08-15 07:26:06 +01:00
manage.py Moved all files up one folder 2017-01-04 18:11:25 +00:00
package.json sass now compiles, cleanup unused files, hooked in sign up form to post to gocardless 2017-02-08 20:32:42 +00:00
pytest.ini Moved all files up one folder 2017-01-04 18:11:25 +00:00
requirements.txt Added support for Circle CI tests (#16) 2017-01-26 09:03:03 +00:00
setup.cfg Moved all files up one folder 2017-01-04 18:11:25 +00:00
stage.yml celery integration 2017-08-15 07:26:06 +01:00

README.org

https://cdn.rawgit.com/maidstone-hackspace/administration/2ede7cb1/images/hackspace-banner.png

Maidstone Hackspace website

https://pyup.io/repos/github/maidstone-hackspace/maidstone-hackspace-website/shield.svg

Repository for the maidstone hackspace website, feel free to fork this site for your own Hackspace.

Requirements

Before getting started make sure you have git, docker and docker-compose installed on your machine. The simplest way to setup this site is to use docker-compose so please install that from this site https://docs.docker.com/engine/installation/ and make sure the quick start guide works https://docs.docker.com/machine/get-started/ then you can use the commands below to test and make changes.

Setup

Steps to get the site running for the first time

First clone the project

To get started checkout the project to your machine, with the command below.

git clone https://github.com/maidstone-hackspace/maidstone-hackspace-website.git

Build your containers to install the sites requirements

Once checked out build your containers locally you only need to do this when first start or if requirements change.

docker-compose -fdev.yml build

Start your new containers containing a database and django

docker-compose -fdev up

Test django is serving pages http://127.0.0.1:8180

Run migrations to setup the database

To run django commands just prefix them with docker-compose -f dev.yml run django

docker-compose -f dev.yml run --rm django python manage.py makemigrations
docker-compose -f dev.yml run --rm django python manage.py migrate

Create the admin user.

Once created you can login at http://127.0.0.1:8180/trustee

docker-compose -f dev.yml run --rm django python manage.py createsuperuser

Generate dummy data

docker-compose -f dev.yml run --rm django python manage.py generate_test_data

Migrations / Managing default data

If you want to export some data you entered into the admin area you can use dumpdata and loaddata to export and import.

docker-compose -fdev.yml run --rm django python manage.py dumpdata feeds > mhackspace/feeds/fixtures/defaults.json
docker-compose -fdev.yml run --rm django python manage.py loaddata mhackspace/feeds/fixtures/defaults.json

Django Commands

docker-compose -fdev.yml run --rm django python manage.py list_subscriptions

Render image variations, if you change the images sizes this will be needed

docker-compose -fdev.yml run --rm django python manage.py rendervariations 'blog.Post.image' --replace

Api

import requests 

url = 'http://127.0.0.1:8180/api/v1/rfidAuth/'
data = {
  'rfid': '4996',
  'device': '7bff6053-77ef-4250-ac11-8a119fd05a0e'
}

# client = RequestsClient()
response = requests.post(
    'http://127.0.0.1:8180/api/v1/rfidAuth/',
    data={'rfid': '238e', 'device': 'e8f27231-8093-4477-8906-e5ae1b12dbd6'})
#requests.get(url)
return response.status_code
200