Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ __pycache__
.coverage*
coverage.xml
htmlcov
freemusicninja.sqlite
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Free Music Ninja API
Requirements
------------

This project requires `Python 3`_ and `PostgreSQL`_:
This project requires `Python 3`_ and `lxml`_:

.. code-block:: bash

$ sudo apt-get install python3-dev libpq-dev postgresql postgresql-contrib
$ sudo apt-get install python3-dev libxml2-dev libxslt1-dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we list these postgres requirements somewhere for deployment documentation/information? Just a thought.



Installation
Expand Down Expand Up @@ -52,7 +52,7 @@ This project uses environment variables for configuration.
4. ``SECRET_KEY``: `Secret key`_ for cryptographic signing
5. ``DATABASE_URL``: URL for database connection (see `database URL schema`_)

If you don't want to setup Postgres, set ``DATABASE_URL`` to ``sqlite:///freemusicninja.db``
If you want to setup Postgres, set ``DATABASE_URL`` to ``postgres://postgres:postgres@localhost/freemusicninja``


Database Migrations
Expand Down Expand Up @@ -114,7 +114,7 @@ There is a deploy task in the Fabric file. Unfortunately Fabric currently requi
.. _database url schema: https://github.com/kennethreitz/dj-database-url#url-schema
.. _freemusicarchive api: http://freemusicarchive.org/api/
.. _jamendo api: https://developer.jamendo.com/
.. _postgresql: https://www.python.org/downloads/
.. _python 3: https://www.python.org/downloads/
.. _lxml: http://lxml.de/
.. _secret key: https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-SECRET_KEY
.. _the echo nest api: https://developer.echonest.com/
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ machine:

dependencies:
override:
- pip install -U -r dev-requirements.txt coveralls codecov:
- pip install -U -r dev-requirements.txt -r prod-requirements.txt coveralls codecov:
timeout: 60

deployment:
Expand Down
2 changes: 1 addition & 1 deletion fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("pip3 install -r requirements.txt")
sudo("pip3 install -r requirements.txt -r prod-requirements.txt")
sudo("python3 manage.py collectstatic --noinput")
sudo("python3 manage.py migrate --noinput", user='django')
run("rm -f {deploy_path}".format(deploy_path=env.deploy_path))
Expand Down
2 changes: 1 addition & 1 deletion freemusicninja/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

DATABASES = {
'default': dj_database_url.config(
default='postgres://postgres:postgres@localhost/freemusicninja'
default='sqlite:///freemusicninja.sqlite'
),
}

Expand Down
1 change: 1 addition & 0 deletions prod-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
psycopg2==2.5.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer to add a -r requirements.txt line here instead of listing two requirements files in the pip install.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requirements can only be specified once, even if they don't conflict. If I add the general requirements here, it will prevent this requirement file from being combined in the same install command as dev-requirements.txt.

What we could do is have a folder with the different types of requirements, and these top-level files would just combine them.

Edit: What I meant is specific package requirements can only be specified once, you can use multiple requirement files in the same installation command as I've done in both the CI and deploy configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to support prod-requirements.txt and dev-requirements.txt in the same command.

The convention of importing a base requirements file seems to be very common. It's the way Two Scoops does it: https://github.com/twoscoops/django-twoscoops-project/blob/develop/requirements/production.txt

I haven't seen the convention of splitting requirements and installing multiple requirements at once. It's possible I overlooked it somewhere though.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ django-model-utils==2.2.0
djangorestframework==3.0.1
iron-celery==0.4.3
lxml==3.4.1
psycopg2==2.5.4
purl==1.0
raven==5.1.1
requests==2.4.3