Giter VIP home page Giter VIP logo

superbook2's Introduction

SuperBook

SuperBook is a social network for superheroes built with Python using the Django Web Framework. This is an example project accompanying the book "Django Design Patterns and Best Practices" by Arun Ravindran.

Local Installation

Git clone to a local directory:

git clone https://github.com/DjangoPatternsBook/superbook2.git

Install pipenv system-wide or locally but outside a virtualenv. Alternatively, follow these commands:

$ pip install -U pip
$ pip install pipenv

Now go to the project directory and install the dependencies:

$ cd superbook2
$ pipenv install --dev

Now you need to enter the pipenv shell:

$ pipenv shell

Run the project:

$ cd src
$ python manage.py migrate
$ python manage.py loaddata initial-fixture.json
$ python manage.py runserver

Open your browser and visit http://127.0.0.1:8000/ (or the URL shown in the last command). If you performed loaddata, then you can login using the username: "admin" and password: "admin".

Deployment to Heroku

Enter project root and run the following commands:

$ heroku create superbook-demo
$ heroku addons:create heroku-postgresql:hobby-dev
$ heroku config:set DJANGO_SETTINGS_MODULE=superbook.settings.production
$ git push heroku master

superbook2's People

Contributors

arocks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

superbook2's Issues

Install all dependencies for project superbook2 (including dev) fails

Hi Arun et. al. and thanks for your DjangoPatternsBook and code.

I have the book and would like to follow along with the code, but I think I found a bug because it's failing for me right at the starting line on two different computers using different python environments, so I don't think it's my environment that's causing the problem.

From the book section Starting the project:

First, clone the example project from GitHub:

$ git clone https://github.com/DjangoPatternsBook/superbook2.git

Next, install pipenv system-wide [this is what I did, using brew on MacOS and using dnf on Fedora 32] or locally, but outside a virtualenv as recommended in pipenv installation documents. Alternatively, follow these commands [I did not do this]:

   $ pip install -U pip
   $ pip install pipenv

Now go to the project directory and install the dependencies:

   $ cd superbook2
   $ pipenv install --dev

This is where it fails for me with the message:

[pipenv.exceptions.InstallError]: ['Looking in indexes: https://pypi.python.org/simple', 'Collecting markupsafe==1.0', '  Using cached MarkupSafe-1.0.tar.gz (14 kB)']
[pipenv.exceptions.InstallError]: ['ERROR: Command errored out with exit status 1:', '     command: /home/alpha/.local/share/virtualenvs/superbook2-HNnQDu9M/bin/python3 -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/tmp/pip-install-5kl59pd3/markupsafe/setup.py\'"\'"\'; __file__=\'"\'"\'/tmp/pip-install-5kl59pd3/markupsafe/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' egg_info --egg-base /tmp/pip-pip-egg-info-bk6ldht4', '         cwd: /tmp/pip-install-5kl59pd3/markupsafe/', '    Complete output (5 lines):', '    Traceback (most recent call last):', '      File "<string>", line 1, in <module>', '      File "/tmp/pip-install-5kl59pd3/markupsafe/setup.py", line 6, in <module>', '        from setuptools import setup, Extension, Feature', "    ImportError: cannot import name 'Feature' from 'setuptools' (/home/alpha/.local/share/virtualenvs/superbook2-HNnQDu9M/lib/python3.8/site-packages/setuptools/__init__.py)", '    ----------------------------------------', 'ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.']
ERROR: ERROR: Package installation failed...

So on a newly installed Fedora 32 machine, I did only:

$ sudo dnf install git
$ sudo dnf install pipenv
$ git clone https://github.com/DjangoPatternsBook/superbook2.git
$ cd superbook2
$ pipenv install --dev

and I think this same (or similar) sequence of commands will fail similarly in other python environments.
$ pipenv --support output attached as a file.
pipenv__support_fedora32.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.