PyConCZ 2016
PyCon CZ is coming back to Brno for it's second edition on 28-30th October 2016.
Contributing
PyCon CZ website is using Python 3.5/Django for the backend, NodeJS/webpack for bundling frontend assets and Postgresql as a database.
Setup dev environment
Using docker
Easiest way is to use docker-compose:
- Add entry to your
/etc/hosts
file.127.0.0.1 lan.pycon.cz
on Linux. On Mac, usedocker-machine ip
to figure out IP of your docker machine. - Run
docker-compose up
- Migrate db
docker-compose run django python manage.py migrate
All three containers should start and you can access development version at http://lan.pycon.cz:8000.
NOTE: If you run docker-compose up
for the first time, it take some time
before PostgreSQL database is created. Django will try to connect to the
non-existing db which results in error message. Don't panic, just wait few
seconds :) After DB is created, you can continue and run migrations without
shutting down docker-compose
.
Manually
Prepare your database: user, password and database name is pyconcz
. Add
127.0.0.1 db
to your /etc/hosts
.
Inside pyconcz_2016
directory,
run following commands to setup project for local development:
mkvirtualenv -p python3.5 pyconcz
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
If you also want to work with styles and javascript, you need to have node.js
.
Inside root directory (the same directory where manage.py
is) run following commands:
npm install
npm start
Now open http://localhost:8000 and you should have development version of website with webpack hot realoaing enabled.
Building
Webpack creates static files with unique filenames (appending file hash). After each production build, you have to commit new files. Don't care about the old ones at the moment.
npm run build
(ordocker-compose run webpack npm run build
when using docker)git add pyconcz_2016/static_build
License
This work is licensed under a MIT