Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation process #2

Open
openoms opened this issue Jul 1, 2020 · 5 comments
Open

Installation process #2

openoms opened this issue Jul 1, 2020 · 5 comments

Comments

@openoms
Copy link
Contributor

openoms commented Jul 1, 2020

Aiming to follow the install process on a clean Debian 10 image.

getting stuck at:

(venv) debian@ip2t:/var/www/sites/site_django_ip2tor/ip2tor_shop$ daphne django_ip2tor.asgi:application --port 8001 --proxy-headers
Traceback (most recent call last):
  File "/var/www/sites/site_django_ip2tor/venv/bin/daphne", line 8, in <module>
    sys.exit(CommandLineInterface.entrypoint())
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/daphne/cli.py", line 191, in entrypoint
    cls().run(sys.argv[1:])
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/daphne/cli.py", line 252, in run
    application = import_by_path(args.application)
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/daphne/utils.py", line 12, in import_by_path
    target = importlib.import_module(module_path)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./django_ip2tor/asgi.py", line 18, in <module>
    django.setup()
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 76, in __getattr__
    self._setup(name)
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 63, in _setup
    self._wrapped = Settings(settings_module)
  File "/var/www/sites/site_django_ip2tor/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 142, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django_ip2tor.settings_prod'

When this file: django_ip2tor.settings_prod supposed to be created?

@openoms openoms changed the title Installation proccess Installation process Jul 1, 2020
@frennkie
Copy link
Owner

frennkie commented Jul 1, 2020

My bad.. I wanted to write docs.. But didn't get to it.
Basically you can create an empty settings_prod.py file and put this in:

from . settings import *
SECRET_KEY = <GENERATED KEY HERE>

The reason for this was to have a way to override Django SECRET_KEY from the one being checked into this repo.

@frennkie
Copy link
Owner

frennkie commented Jul 3, 2020

I managed to add the missing part for the installation on a Bridge Host: https://github.com/frennkie/django-ip2tor#installation-on-a-host

This is really simple and straight forward (as intended).

The Django stuff (especially the settings_prod.py thing) needs some reconsideration.

@frennkie
Copy link
Owner

frennkie commented Jul 6, 2020

Regarding the (secret)/local settings I'm looking at this https://github.com/joke2k/django-environ or this https://github.com/sloria/environs.

I extensively updated the shop installation documentation yesterday.

@frennkie
Copy link
Owner

frennkie commented Jul 6, 2020

Now (dbfe35f) all that is needed is to fill the environment or put a .env file in the root directory.

ToDo: Update docs

@frennkie
Copy link
Owner

frennkie commented Jul 7, 2020

@openoms I decided to use a dedicated user (ip2tor) to run the services and simply install it in the home directory. This is now pretty similar to the way we setup apps on RaspiBlitz. Would be great if you could review/test the current instructions and files for the Shop installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants