Update gevent to 1.2.2 |
||
---|---|---|
compose | ||
config | ||
docs | ||
mhackspace | ||
requirements | ||
utility | ||
.drone.yml | ||
.gitignore | ||
.travis.yml | ||
CONTRIBUTORS.txt | ||
COPYING | ||
LICENSE | ||
README.org | ||
circle.yml | ||
dev.yml | ||
docker-compose.yml | ||
env.example | ||
live.yml | ||
manage.py | ||
package.json | ||
pytest.ini | ||
requirements.txt | ||
setup.cfg | ||
stage.yml |
README.org
Maidstone Hackspace website
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/admin
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