Setting up Helios Voting

212 views
Skip to first unread message

Kodondi shadrack

unread,
Jul 16, 2021, 6:37:44 AM7/16/21
to Helios Voting
Hello members, setting up Helios, kindly help with  clear steps for a newbie  ,which linux distro works well?...i have started by installing virtual box machine.
Thanks.

Warwick McNaughton

unread,
Jul 16, 2021, 2:12:08 PM7/16/21
to helios...@googlegroups.com
Hi 

I have written up a walk-through using Ubuntu here:

It has been a while since I tested it - hope it helps you.

Warwick

On 16/07/2021, at 10:37 PM, Kodondi shadrack <kodondi...@gmail.com> wrote:

Hello members, setting up Helios, kindly help with  clear steps for a newbie  ,which linux distro works well?...i have started by installing virtual box machine.
Thanks.

--
--
Helios Voting Google Group
To post: helios...@googlegroups.com
To unsubscribe: helios-votin...@googlegroups.com
More: http://groups.google.com/group/helios-voting?hl=en

---
You received this message because you are subscribed to the Google Groups "Helios Voting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to helios-votin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/helios-voting/490a5a6d-fa92-46c4-8981-40e9c590eeeen%40googlegroups.com.

Kodondi shadrack

unread,
Jul 16, 2021, 6:34:00 PM7/16/21
to Helios Voting
Thanks for being here for us Warwick,is there an option install for windows environment for this application?

Warwick McNaughton

unread,
Jul 16, 2021, 8:30:24 PM7/16/21
to helios...@googlegroups.com
I have not tried on Windows.  There are really 4 components that have to be set up in Windows:
- Django (should be straightforward: https://docs.djangoproject.com/en/3.2/howto/windows/ )
- celery (once you have python setup you get celery using pip)
- a broker like RabbitMQ (https://www.rabbitmq.com/download.html)

I use VSCode as editor - which, of course, is MS.  It has its own guide for installing python / Django: https://code.visualstudio.com/docs/python/tutorial-django 



Kodondi shadrack

unread,
Jul 17, 2021, 10:07:46 AM7/17/21
to Helios Voting
I appreciate sir, the steps in ubuntu are very clear, and very  precise. Nevertheless, am am stuck at one point.
when trying to run:  
 $python3 manage.py makemigrations,    i get  file error

envi=environ.Env()
NameErrow: environ is not defined
this comes with some frozen import messages eg "<frozen importlib._bootstrap>.........
kindly assist.

Regards

Warwick McNaughton

unread,
Jul 17, 2021, 1:45:42 PM7/17/21
to helios...@googlegroups.com
This seems to be related to the section in the Ubuntu walk-through "safe storage of secrets”.

Check:
- did you install django-environ
- did you write import environ at top of settings.py



Kodondi shadrack

unread,
Jul 17, 2021, 3:38:37 PM7/17/21
to Helios Voting

Very apologetic, forgot to import environ. Almost reaching home. apparently, in your steps you didn't make any reference to how we are going to access the database  we created. Just wondering whether am safe so far.

and also in my last steps of installs, getting error from celery: unrecognised arguments -1 INFO...i used version 4.2.1 as cloned.
on trying to install your version(5.0.0) i get a version error.

Once again, greatly indebted for your favor.

Regards

Warwick McNaughton

unread,
Jul 17, 2021, 3:51:27 PM7/17/21
to helios...@googlegroups.com
No problem.

Django manages your database using the “model”s that are defined in helios.

Makemigrations packages your model data ready for migration and migrate applies the migrations to your database.

For celery use -l rather than -1.  -l INFO is the same as --loglevel INFO

Kodondi shadrack

unread,
Jul 17, 2021, 4:52:19 PM7/17/21
to Helios Voting
What's these connection errors  from celery, cannot connect to amqp:/gu...@127.0.0.1.5672//......with several failed looping connection  attempts
any suggestion Warwick?.....

Warwick McNaughton

unread,
Jul 17, 2021, 5:03:00 PM7/17/21
to helios...@googlegroups.com
amqp is provided by RabbitMQ. When you do "sudo apt install rabbitmq-server” I think it also starts running rabbitmq-server. It looks like it is not running though.
Try running it:
rabbitmq-server

Celery handles workers. These are not needed to just get the helios server up if you want to see if it is working so far. They are necessary though for things like sending emails (all the processes set out in tasks.py).
> To view this discussion on the web visit https://groups.google.com/d/msgid/helios-voting/297a8d5f-7d42-4717-bb71-51ff73e9c4adn%40googlegroups.com.

Kodondi shadrack

unread,
Jul 18, 2021, 3:09:42 AM7/18/21
to Helios Voting

error report-001.jpg

Final stretch seems wanting, I wish i could set a vote today.
Am i supposed to replace these with my authentication scripts(id and secret)  from google authentication?
     DBPWD=xxxx
    GOOGLESECRET=xxxx
    GOOGLEID=xxxx

Warwick McNaughton

unread,
Jul 18, 2021, 3:58:51 AM7/18/21
to helios...@googlegroups.com
The host you are running helios on is not set in settings.py as an allowed host.  Settings.py has a configuration ALLOWED_HOSTS.  Try 
ALLOWED_HOSTS = [127.0.0.1']

The setting is probably set by default as localhost.  I think most systems will recognise 127.0.0.1 as localhost, but this is does not seem to be happening.

There is another setting you might also need to set:
URL_HOST = get_from_env("URL_HOST", "http://127.0.0.1:8000").rstrip("/")

You don’t need to have a separate .env file but it is better practice to use an .env file and .gitignore it if you intend to keep your code on Github.  Otherwise, if you write these secrets directly into settings.py they will be visible on Github.  

In settings.py you should have:
GOOGLE_CLIENT_ID = os.environ['GOOGLEID']
GOOGLE_CLIENT_SECRET = os.environ['GOOGLESECRET]

In your .env file you will have the actual values.  If you are not making your code visible to anyone you could write the values directly into settings.py.

You may not need DBPWD.  This is your database password but you may not need it.

The current database settings are:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'helios',
'CONN_MAX_AGE': 600,
},
}


You may need to add, for example, USER and PASSWORD:


DATABASES = {
 'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'helios',
        'CONN_MAX_AGE': 600,
        'USER': 'warwickmcnaughton',
        'PASSWORD': DBPWD,
                  },
}

Hope this helps.




Kodondi shadrack

unread,
Jul 18, 2021, 6:34:13 AM7/18/21
to Helios Voting
AUTHORIZATION ERROR-001.jpgAUTHORIZATION ERROR-003.jpg
Thanks soo much Warwick,i suppose that's my last error report. Maybe because we changed the IP?  Kindly and briefly talk about other social media logins eg  Facebook. I took much of your valuable time. Long live opensource community.

Warwick McNaughton

unread,
Jul 18, 2021, 1:20:15 PM7/18/21
to helios...@googlegroups.com
In Google change localhost to 127.0.0.1 (or add an additional entry: http://127.0.0.1:8000/auth/after/)

I will change my walk-through.  The last line should not be:
• in a browser go to 127.0.0.1:8000 or localhost:8000

But should be:
• in a browser go to localhost:8000

Otherwise people have to make the changes in settings.py and Google that you had to make.

I have not tried setting up FB etc.


On 18/07/2021, at 10:34 PM, Kodondi shadrack <kodondi...@gmail.com> wrote:

<AUTHORIZATION ERROR-001.jpg><AUTHORIZATION ERROR-003.jpg>
To view this discussion on the web visit https://groups.google.com/d/msgid/helios-voting/e44909cc-49bc-4039-8b7d-19db6999859dn%40googlegroups.com.
<AUTHORIZATION ERROR-001.jpg><AUTHORIZATION ERROR-003.jpg>

Kodondi shadrack

unread,
Jul 18, 2021, 8:58:22 PM7/18/21
to Helios Voting
Thanks all went well, am good to go.....
Reply all
Reply to author
Forward
0 new messages