The main idea is to have a web form available for one vote over three smileys in order to know their mood.
Made with:
pip> 8.0python> 3.5
You should install virtualenvwrapper. Then set up goes down to:
$ mkvirtualenv niko -p /usr/bin/python3 -a /w/niko_niko -r devrequirements
$ workon nikoNote: Note adjust path used for mkvirtualenv to your system.
Now you just need to adjust some settings. At the root of the project run:
$ cp niko_niko/settings.py niko_niko/settings_local.pyEdit niko_niko/settings_local.py, at the end, remove:
settings_local_file = os.path.join(BASE_DIR, 'settings_local.py')
if os.path.exists(settings_local_file):
with open(settings_local_file) as local_configuration:
code = compile(local_configuration.read(), local_configuration, "exec")
exec(code)$ pip install -r requirementsEdit niko_niko/settings.py, at the end, remove:
settings_local_file = os.path.join(BASE_DIR, 'settings_local.py')
if os.path.exists(settings_local_file):
with open(settings_local_file) as local_configuration:
code = compile(local_configuration.read(), local_configuration, "exec")
exec(code)Here are the useful settings:
# Base of links in QR codes :)
ALLOWED_HOSTS = ['18.34.88.76:8000']
# Set yourself as admin
ADMINS = (
('Kevin KIN-FOO', '[email protected]'),
)
# Define dev database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/path/to/niko_niko/data/db.sq3', # Path, as we are using sqlite3.
}
}Now create database and enable admin material:
$ python manage.py syncdb
$ python manage.py collectstaticAfter a $ python manage.py runserver 0.0.0.0:8000, you will able to visit http://localhost:8000/.
If you want fill it, try:
$ python manage.py loaddata data/sample.jsonDid you start application with: $ python manage.py runserver 0.0.0.0:8000?
Because default runserver sub-command only works for localhost.