해결됨: django를 vps로 배포

VPS(가상 사설 서버)에 Django를 배포할 때의 주요 문제는 리소스를 많이 사용할 수 있다는 것입니다. Django가 제대로 실행되기 위해서는 많은 메모리와 CPU 리소스가 필요하기 때문입니다.

I have a problem with my Django project. I'm trying to deploy it on my VPS, but I can't get it to work.
This is the error that I get:
<code>    Traceback (most recent call last):
  File "/home/myuser/.local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/myuser/.local/lib/python3.6/site-packages/django/utils/deprecation.py", line 93, in __call__
    response = self.get_response(request)
  File "/home/myuser/.local/lib//python3.6//site-packages//django//core//handlers//base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/myuser/.local//python3.6//site-packages///django///core///handlers///base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  ...

  File "/usr / local / lib / python3 . 6 / site - packages / django / core / management / base . py " , line 371 , in execute     output = self . handle ( * args , ** options )   File "./manage . py" , line 72 , in handle     execute_from_command _line ( sys . argv )   File "/usr // local // lib // python3 . 6 // site - packages /// django /// core /// management /// __init__ . py " , line 363 , in execute _from _command _line utility . execute ()   File "/usr // local // lib // python3 . 6 // site - packages /// django /// core /// management /// __init__ . py " , line 355 , in execute self . fetch _command ( subcommand ). run _from _argv ( self . argv )   File "/usr // local // lib // python3 . 6 // site - packages /// django /// core /// management /** init**" , line 206 , in fetch _command klass = load _command class ( appname ) KeyError : 'demo' [ 04 : 19 : 10 web1 : 1805 ] [ WSGI ] Error getting traceback from worker process : &lt; type 'exceptions' &gt;: 'module' object has no attribute 'wsgi' [ 04 : 19 : 10 web1 : 1805 ] [ WSGI ] Traceback from worker process &lt; type 'exceptions' &gt;: 'module' object has no attribute 'wsgi' [ 04 : 19 : 10 web1 : 1805 ] [ WSGI ] Traceback from worker process &lt; type 'exceptions' &gt;: 'module' object has no attribute 'wsgi'. wsgi application 1 init failed ; not restarting ...</code>

코드가 VPS에 Django 프로젝트를 배포하려고 시도하지만 오류가 발생합니다. 오류는 'wsgi' 응용 프로그램이 올바르게 초기화되지 않는다는 것입니다.

VPS란?

VPS는 가상 사설 서버입니다. 자신의 웹 사이트 또는 응용 프로그램을 실행할 수 있도록 하는 일종의 서버입니다.

Django를 위한 최고의 VPS

Django 프로젝트의 특정 요구 사항에 따라 다르므로 이 질문에 대한 확실한 답은 없습니다. 그러나 Django VPS 공급자에 대한 인기 있는 선택에는 Heroku, Amazon Web Services(AWS) 및 Google Cloud Platform(GCP)이 있습니다. 각각 고유한 강점과 약점이 있으므로 특정 프로젝트에 가장 적합한 것을 신중하게 고려하는 것이 중요합니다.

Django VPS 공급자를 선택할 때 고려해야 할 몇 가지 주요 요소는 다음과 같습니다.

1. 운영 체제: 대부분의 Django VPS 공급자는 다양한 운영 체제를 제공하므로 프로젝트 요구 사항과 일치하는 것을 선택하는 것이 중요합니다. 예를 들어 GCP는 Linux와 Windows를 모두 지원하고 AWS는 Windows와 Linux 옵션을 모두 제공합니다.

2. CPU 및 메모리: Django VPS에는 프로젝트 요구 사항을 처리하기에 충분한 CPU 성능과 메모리가 있어야 합니다. 예를 들어 GCP는 AWS보다 더 강력한 CPU와 더 큰 메모리 풀을 제공하는 반면, AWS는 더 낮은 성능의 CPU를 제공하지만 더 넉넉한 메모리 할당을 제공합니다.

3. 보안: 강력한 보안 조치를 갖춘 공급자를 선택하는 것이 중요합니다. 예를 들어 GCP는 암호화된 데이터 저장소 및 이중 인증(2FA)을 통한 사용자 인증과 같은 강력한 보안 기능을 제공합니다. AWS는 일부 보안 기능도 제공하지만 일부 프로젝트에는 적합하지 않을 수 있습니다.

관련 게시물:

코멘트 남김