Setup Instructions
Get it here. On your terminal/cmd, verify that you have Git installed by typing $ git
Get it here. On your terminal/cmd, verify that you have the Python CLI installed by typing $ python
Get it here. Ignore the sections about 'Apache and mod_wsgi' and 'Get your database running' for now. On your terminal/cmd, verify that you have Django installed by typing $ django-admin.py
.
Get it here. On your terminal/cmd, verify that you have Heroku installed by typing $ heroku
.
When someone else makes changes, you need to update the repo before you push your own changes. Run $ git pull
.
When you edit a file, you have to 'stage' these changes. Files that are untracked by Git or have not been 'staged' will not be committed.
- To add all files:
$ git add .
Note that you must be on a top-level directory (you can't add any/../
files. - To add a specific file:
$ git add <filename>
$ git commit -m "Type a meaningful message here
You just commited your changes to your local repo. To get everyone else to see them, run $ git push
.
These are annoting, and should happen infrequently if we're careful. If git tells you to fix merge conflicts, you need to go into the files and manually resolve the conflict by deleting the outdated lines. More info here.
Heroku is magical. There's a small amount of initial setup to get everything running. Our app will run here.
Follow the instructions here. This is a way for you to authenticate to Heroku. This one is kinda tricky, articles on stackoverflow.com help a lot. You then have to register your key on heroku using heroku keys:add (before pushing).
Enter $ heroku login
. You will be asked for your email / password. (I will email these to you).
To deploy the repo to heroku, set up a Heroku remote branch
$ heroku git:remote -a teambarbara
You make some changes. You want to see them on our website. After you commit and push locally, run:
$ git push heroku master
.
Here is a summary of important files
teambarbara/ manage.py # Used to run django comamnds
static/ # DON'T ADD STATIC FILES HERE
templates/ # Add HTML files here
videoconference/ #our app videoconference/ `
urls.py # Route new URLs here
static/ # Add static files here js/ # add .js files css/ # add .css files img/ # add images
All HTML files live in templates/
Javascript/CSS/ img files should be added to the static folder in videoconference
URLs:
www.teambarbara.herokuapp.com/ # main page
Most Django commands are run with manage.py
. This file is inside the main directory. As this is a python file, you need to enter $ python manage.py <command name>
.
You need to run the Django server to preview any of your changes. Run it once, and it automatically updates after any changes.
$ python manage.py runserver
To see the website locally, go to http://127.0.0.1:8000/. If you get an error, you're not running the server.
If you need to add a new CSS/JS file, please add it to the respective folder in teambarbara/videoconference/static
. There is a folder that is deceivingly named static/
in the main root. Don't add any files here.
When you add a new CSS/JS/image file, you need to run $ python manage.py collectstatic
, and enter yes
.
After you correctly add a static file, you can link it to your HTML file. Say you create a static file called foo.js
. To include this file in an HTML doc, add this line:
<script type="text/javascript" src="{{ STATIC_URL }}js/foo.js"></script>
To create a new URL, add a line to urls.py
. A URL consists of a regex and the template (HTML file) to load.