https://github.com/chaht01/sciencenewsresearch-back
  
  
     
    https://github.com/chaht01/sciencenewsresearch-back
  
        Last synced: 5 months ago 
        JSON representation
    
- Host: GitHub
 - URL: https://github.com/chaht01/sciencenewsresearch-back
 - Owner: chaht01
 - Created: 2018-07-30T11:47:03.000Z (over 7 years ago)
 - Default Branch: master
 - Last Pushed: 2022-12-08T00:45:58.000Z (almost 3 years ago)
 - Last Synced: 2024-09-16T04:01:17.056Z (about 1 year ago)
 - Language: Python
 - Size: 4.12 MB
 - Stars: 0
 - Watchers: 3
 - Forks: 1
 - Open Issues: 13
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
README
          > How to deploy?
You just commit and push your code to `deploy` branch.
But be careful not to commit and merge your database and setting file (db.sqlite3, cq_backend/settings.py)
If you don't know how to do that precisely, just do like below
In case in your own branch,
```
    git add .
    git reset HEAD db.sqlite3
    git reset HEAD cq_backend/settings.py
    git commit -m "your commit message"
    
    git checkout deploy
    git merge  --no-ff
    git push origin deploy
```
After that, login to server using 
```
    ssh -i  ubuntu@ec2-13-209-74-251.ap-northeast-2.compute.amazonaws.com
    cd /srv/ScienceNewsResearch-back
```
command on your terminal. You can download name.pem if you are authorized user of above server. 
And then, just pull remote origin/deploy source by 
```
    git pull
```
> What if I change my model or make some migrations?
If you change your model and migrate correctly, there must be some new files in `cq/migrations`. 
It means that after you pull source code from remote, you also should apply migrations to server's database.
So after pull source with above command, 
```
    source /srv/ScienceNewsResearch-back/v2env/bin/activate
    cd /srv/ScienceNewsResearch-back/
    python manage.py migrate
```