-
Notifications
You must be signed in to change notification settings - Fork 1
Running Django on local host
Sorry for latency. The project is organized and tested with MacOS Sierra 10.12, Ubuntu 16.04.1 LTS. I am going to go over step by step to explain how to run the project on local server for MacOS and Ubuntu. For Windows users, well, just don't use Windows.
MacOS: Download
Ubuntu:
apt-get install python3
-
apt-get install python3-pip
(Python Package Index is installed automatically on OS X)
Install Django 1.10.X
MacOS / Ubuntu:
-
pip3 install Django
(Easiest way)
MacOS: Download
You can also install via Homebrew or any way you desire, but make sure mysql command is available in
$PATH
environment variable.
Ubuntu:
apt-get install mysql-server
apt-get install libmysqlclient-dev
mysql_install_db
For now, your MySQL username and password must be the same as defined in SETINGS.py, but it is temporary and going to be configurable. Application is going to be able to get credentials from environment variables up to the next milestone. You can change credentials in SETTINGS.py for now as a workaround, but remember not to commit it.
You can connect to your local MySQL server via command line or any desktop application you want. For Mac users, I recommend Sequel Pro, which is a light-weight application capable of doing everything we will need. There is also a bunch of tools for Ubuntu as well, like MySQL Workbench, phpMyAdmin, etc.
MacOS / Ubuntu:
mysql -u root -p
Enter password:
mysql> CREATE DATABASE eatright;
Install NodeJS
Since we decided to use ReactJS, We will need to use JSX language together with ES6 syntax. Since browsers do not interpret JSX code, we are going to transpile React code into standard JavaScript code and put it in appropriate folders to be served by Django. There is no suitable module in Python for this purpose. So we have to install Babel, which is an awesome transpiler designed specifically for this job and is available on npm. NodeJS will be used for this purpose and will be necessary only in development environment.
Since we already need to use NodeJS, Let's not put our 3rd party libraries into the repository. We will install a bunch of frontend libraries which means much more awesome functionality but also wasted data, so we can define them in the repo, then install them later on with Bower which is the most popular package manager for the web.
MacOS: Download
Ubuntu:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
MacOS / Ubuntu:
-
sudo npm install -g bower
(Install Bower as global package) -
sudo npm install -g babel-cli
(Install Babel as global package)
For the ones who are going to code ReactJS, I strongly advice Atom, a hackable text editor for 21th century. I even use it for Django. It is not only much faster than PyCharm and WebStorm, but also speeds up development process for React dramatically, handling all transpilation process under the hood. If you decide to move to Atom, mandatory packages for our project are the following: linter-flake8, atom-django and the most important one language-babel. If you decide to stick with PyCharm, you will need to use
babel
command with necessary parameters to trinspile JSX into JS.
git clone https://github.com/bounswe/bounswe2016group2.git
cd bounswe2016group2/web
-
npm install
(Install babel presets) -
bower install
(Install frontend libraries) -
pip3 install -r /path/to/project/web/requirements.txt
(Install necessary python modules) -
python3 manage.py migrate
(Create or update the database structure) -
python3 manage.py runserver
(Start server)
Go to http://127.0.0.1:8000 and see if it works
Use API on http://127.0.0.1:8000/api base. Postman is recommended
For detailed information about API, check the documentation
- Project Description
- Project Video
- Themes/Features
- User Stories & Acceptance Criteria
- Personas
- Domain Analysis
- Requirements
- Initial Plan
- Diagrams
- Use Cases
- Peer Reviews
- Mockups
- Test Plan
- User Tests
- Test Web Project
- Meeting 1 - 16.02.2016
- Meeting 2 - 18.02.2016
- Meeting 3 - 3.3.2016
- Meeting 4 - 7.3.2016
- Meeting 5 - 11.3.2016
- Customer Meeting 1 - 28.03.2016
- Meeting 6 - 8.4.2016
- Customer Meeting 1 - 29.9.2016
- Customer Meeting 2 - 06.10.2016
- Meeting 7 - 06.10.2016
- Meeting 8 - 13.10.2016
- Customer Meeting 3 - 27.10.2016
- Meeting 9 - 27.10.2016
- Customer Meeting 4 - 03.11.2016
- Meeting 10 - 03.11.2016
- Meeting 11 - 10.11.2016
- Meeting 12 - 01.12.2016
- Meeting 13 - 08.12.2016
- Customer Meeting 5 - 08.12.2016
- Meeting 14 - 08.12.2016