Skip to content

Commit

Permalink
Modified migration class with atomic = False to allow SQLite migratio…
Browse files Browse the repository at this point in the history
…n to function properly. README updated to include setup and installation.
  • Loading branch information
Geir Tore Ulvik committed Aug 6, 2018
1 parent 8357d58 commit e26e45e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
54 changes: 34 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,57 @@
# mreg
mreg is an API (intended to be as RESTful as possible) for managing DNS.
An associated project for a command line interface using the mreg API is available at:
[mreg-cli](https://github.com/usit-gd/mreg-cli)

## Getting Started



### Prerequisites

What things you need to install the software and how to install them

```
Give examples
```
Fork the project from github.
You need a terminal, `python3`, and access to a package manager that can install the necessary requirements
from `requirements.txt`. We use pip.

### Installing

A step by step series of examples that tell you how to get a development env running

Say what the step will be

When you've got your copy of the mreg directory, setup you virtual environment.
```
Give the example
> python3 -m venv venv
> source venv/bin/activate
```

And repeat

Then install the required packages
```
> pip install -r requirements.txt
```
Perform database migrations
```
> python manage.py migrate
```
Load sample data from fixtures into the now migrated database
```
until finished
> python manage.py loaddata mreg/fixtures/fixtures.json
```
And finally, run the server.
```
> python manage.py runserver
```

End with an example of getting some data out of the system or using it for a little demo
You should now be able to open up a browser and go to http://localhost:8000/hosts/ and see
a list of hosts provided by the sample data. Or, you could perform a GET request to see
the returned data.
```
> curl -X GET http://localhost:8000/hosts/
[{"name":"ns1.uio.no"},{"name":"ns2.uio.no"},{"name":"lucario.uio.no"},{"name":"stewie.uio.no"},{"name":"vepsebol.uio.no"}
```

## Running the tests

Explain how to run the automated tests for this system


## Deployment
To run the tests for the system, simply run
```
> python manage.py test
```


## Built With
Expand Down Expand Up @@ -67,7 +83,6 @@ DATABASES = {
}
```


## Contributing

## Authors
Expand Down Expand Up @@ -119,7 +134,6 @@ This project is licensed under the GPL-3.0 License - see the [LICENSE.md](LICENS




#### Setup av sample-database i postgres (tar utgangspunkt i Fedora og python3)
Trenger pakkene 'postgresql', 'postgresql-server', deretter initialiserer vi
databaseclusteret og bygger sampledatabasen fra samples/sample_data_dump
Expand Down
1 change: 1 addition & 0 deletions mreg/migrations/0009_auto_20180725_1134.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Migration(migrations.Migration):
dependencies = [
('mreg', '0008_auto_20180723_1522'),
]
atomic = False

operations = [
migrations.CreateModel(
Expand Down

0 comments on commit e26e45e

Please sign in to comment.