A quiz building app, built on Django 2.1.5, for APOGEE 2019 at BITS Pilani
- Install pip -
~$ sudo apt-get install python3-pip
- Create the virtualenvironment -
~$ python3 -m venv /path/to/desired/virtual/environment/directory
- Activate the environment -
~$ source /path_of_venv/bin/activate
- Install django -
~$ pip3 install django
- Install pillow and django-allauth -
~$ pip3 install Pillow
~$ pip3 install django-allauth
- Clone this repository in the venv directory. Then navigate to the directory -
~$ cd DVMquizbuilder
- Create a superuser -
~$ python manage.py createsuperuser
- Run the server -
~$ python manage.py runserver
If you are unable to get google login to work, login from the admin panel (relative url - /admin). You can log in using your superuser credentials. Once logged in, redirect back to the main url (127.0.0.1:8000). It will work then.
For social login, we are using django-allauth. Assuming you already have your project credentials set up (if not, get your api credentials here), to setup the api with django do the following -
- Create a superuser and log in to the admin panel.
- Click on Sites. Then click on example.com
- In domain name, replace example.com with 127.0.0.1:8000. Write whatever you want in display name (I prefer DVMquizbuilder) and click save.
- Now go back to the admin panel and click on Social applications. Then click on ADD SOCIAL APPLICATION.
- In Provider, select Google and set the name to "Login" (for simplicity). Paste your client id and client secret in the respective boxes.
- Put "1" in key (I don't know if this is required).
- In Sites, add 127.0.0.1:8000 to chosen sites and click save.
Google login should work well after this.
Note: If you're already logged in in your browser with a single google account, allauth will automatically log you in without asking for google credentials.