-
Notifications
You must be signed in to change notification settings - Fork 8
Assignments
Read the following link in detail to understand the work has been done and the plans for the future of WebUI team.
https://docs.google.com/document/d/1PSw2Vx8fuQjnxWGf70Zro-8MIPzSK1zYLkr_un_tEBw/edit?usp=sharing
Setup: Install a virtual environment to develop with Django and Heroku.
Note: This is an important habit as a programmer for future reference since the system envirnment can be different and complicated in most cases. E.g. MacOS doesn't give user the re-write authority of some system root files for security sake, which includes initial python version that creates problems when downloading dependencies.
Note: Check the versions of dependencies installed in your environment first. There's no need to reinstall dependency files if yours have been updated to latest version.
(for Linux)
sudo apt-get install
(for MacOS)
Install them one by one e.g. 'pip install django'
- python-dev
- libpq-dev
- python3-pip
- python3-venv
Create venv:
python3 –m venv venv
Start virtualenv:
source venv/bin/activate
Upgrade pip:
(venv)$ pip install --upgrade pip
Install packages:
(venv)$ pip install django
Check Django Version:
(venv)$ django-admin --version
TIP: Get the webapp working locally using a IDE such as Brackets to see the live site before staring Django the part. Remember when implementing the google maps part you need the api key which you can get from here
Once you're finished, the webpage should look similar to this demo
TIP: You can follow this tutorial found on Youtube.
Note: Only the episode 1-3 have the knowledge that would be required to complete the training process. They are really good resources for beginners getting familliar with django web development so watch them carefully.
- Make sure all Python and Django versions are up to date.
- Urls.py is different in Django 1.10.
Basically you will need to create 3 main files.
- /requirements.txt
- /runtime.txt
- /Procfile
Here are some good guides:
-
https://devcenter.heroku.com/articles/getting-started-with-python#introduction
-
https://devcenter.heroku.com/articles/django-app-configuration
Problems occurred in the past:
-
Django App not working and giving me import errors.
- Fix: Check the wgsi file and make sure all dependencies are also installed.
-
Showing lack of environment variables when deploying on Heroku.
- Fix: Ask your team leader for related information.
-
Heroku app was not deploying. Forgot to install whitenoise and caused a error. Errors will prevent you from deploying.
-
Read/watch through the provided resources in details. Patience is vital at the beginning stage.
sample: time-map with additional content
API source: ipstack.com
General Overview:
part of the webUI team responsibility involved delivering products to the front end. These products often relied on API that ease the access to the providers' database. Thus, we use a lot of different APIs that were built in different ways. This is an introduction to you in using an API and deliver it to front end so you may have an exposure to how a Django project is structured.
Minimum Requirements:
- You have done the "Experience Django Project Structure" first assignment.
- display the following data:
ip
,city
,capital
,native
- Continue on the time-map site of the first assignment.
Useful tools: postman API development environment.
the postman is a very useful tool to test the response of an API.
coming soon...
coming soon...
coming soon...
coming soon...
coming soon...