master: most up-to-date branch with open registration. Up on http://wearhacks.eleyine.comstable: deployed branch with registration closed. Live on http://montreal.wearhacks.com
$ git clone git@github.com:eleyine/WearHacks-Website.git
$ cd WearHacks-Website
$ chmod u+x setup.sh
# The next two steps are optional but strongly recommended
$ mkvirtualenv wearhacks-website
$ workon wearhacks-website
(wearhacks-website) $ ./setup.shNote: setup.sh will copy example_private_settings.py to private.py. If you are on your local machine in dev mode, there's no need to edit it. However, if you'd like to deploy, please update smf_website/settings/private.py with your sensitive and deployment-specific settings.
Manual install: what's in setup.sh?
If you don't want to use setup.sh
$ mkvirtualenv wearhacks-website
$ workon wearhacks-website
(wearhacks-website) $ pip install -r requirements.txt
(wearhacks-website) $ bower install
(wearhacks-website) $ cp smf_website/settings/example_private_settings.py smf_website/settings/private.py
(wearhacks-website) $ python manage.py makemigrations
(wearhacks-website) $ python manage.py migrate
(wearhacks-website) $ python manage.py generate_registrations 3
(wearhacks-website) $ python manage.py runserverNow, open http://127.0.0.1:8000/.
-
To run on localhost:
$ workon wearhacks-website (wearhacks-website) $ python manage.py runserver
-
By default, you will use the Django settings defined in
wearhacks_settings/settings/dev.py. -
To use production settings defined in
wearhacks_settings/settings/prod.py:(wearhacks-website) $ export APP_ENV=prod (wearhacks-website) $ python manage.py runserver -
You can edit
wearhacks_settings/settings/private.pyto enter sensitive and user-specific settings. All settings inprivate.pywill override those defined indev.pyandprod.py. Seesmf_website/settings/__init__.pyfor more information.
The registration app handles payment via Stripe. To test this feature, edit in your Stripe API keys in your private settings files (smf_website/*private.py).
I wrote a fabric script to automate installation on Digital Ocean droplets using the one-step Django installation. If you are deploying elsewhere, you can have an idea of the steps to take by inspecting server_files/fabfile.py.
Here are the setup instructions if you choose to do it with Digital Ocean.
-
Create a Digital Ocean droplet with a Django installation image
-
Ssh into your droplet to obtain the postgresql database password. It will be displayed in the welcome message.
-
Copy
smf_website/settings/private.pytosmf_website/settings/server_private.pyand uncomment the postgresql settings. Edit in your postgresql password from the step above. -
Make sure you have fabric installed locally. If you ran
setup.sh, you already have it. -
In
smf_website/server_files/, copyfab_config_example.pyand rename it tofab_config.py. Edit in in your deployment host address. -
Then in
server_files, runfab all -
If you'd like a list of fab commands, run
fab -l=======