https://github.com/michael98liu/grevocabulary
https://github.com/michael98liu/grevocabulary
django large-scale
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michael98liu/grevocabulary
- Owner: Michael98Liu
- Created: 2018-12-01T01:09:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-16T02:31:37.000Z (over 7 years ago)
- Last Synced: 2025-10-09T10:16:52.600Z (8 months ago)
- Topics: django, large-scale
- Language: Python
- Size: 197 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Setup
## Install and Use Virtual Environment
Set up a virtualenv for python to install later dependencies:
```
$ pip3 install virtualenv
$ python3 -m virtualenv venv
$ source venv/bin/activate
```
## Install Dependencies
```
$ pip3 install -r requirements.txt
```
To run the Django on a cloud instance, add the public IP to `ALLOWED_HOSTS` list in the file `GREvocabulary/settings.py`
## To set up MySQL database (on debian)
First, install mysql-server:
```
$ sudo apt-get -y install mysql-server
```
Install mysqlclient for python:
```
$ sudo apt -y install default-libmysqlclient-dev
```
Finally, create the db user and database for this project:
```
$ sudo mysql -u root
$ create database GRE;
$ GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'pass';
$ exit
```
(These are the credentials put in settings.py, so no need to change them for development)
To migrate the data model defined in models.py to mysql:
```
$ python3 manage.py makemigrations GRE
$ python3 manage.py migrate
```
## Create an user
A user is created automatically as you run the server. Credentials are as following:
Username: `yair`
Password: `1234`
To create a superuser,
```
$ python3 manage.py createsuperuser --username=nyuad
```
## Populate database with vocabulary
```
$ python3 populate_db.py
```
# Notes
- A good [turorial](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django) on Django from Mozilla.