Start by matching your runtime to ServerNet Python hosting. Django and Flask can use WSGI. If you need WebSockets, SSE, persistent Celery workers, a different database or full OS control, compare an hourly VPS. This guide does not deploy a customer service: adapt project names, paths and environments to your own account.
1. Write down the runtime requirements before choosing a plan
Identify compatible Python and package versions, application count, RAM, file storage and MySQL/MariaDB needs. Packages requiring system libraries or compilation may meet shared-hosting restrictions. Ask about the specific dependency before ordering. A framework name alone does not establish capacity or a fixed user count.
2. Use the same virtual environment for installation and execution
Install the reviewed project requirements into the selected Python environment. The command-line interpreter and web app must agree. A successful pip install in another environment will not resolve a web import error. Keep database passwords, keys and environment files outside public paths and the repository.
python -m pip install -r requirements.txt
python -m pip checkRun these commands from your project directory in its active environment. Use a test project and database first; keep a recovery path before changing dependencies on a live application.
3. Give Flask a small health endpoint
The following example is app.py. Use the hosting platform’s WSGI execution path for production. The development server and flask run are not a production deployment.
from flask import Flask, jsonify
app = Flask(__name__)
@app.get("/healthz")
def healthz():
return jsonify(status="ok"), 200If your module is app.py and the configured entry point is application, the WSGI startup file can contain the following. Match the file name and entry point to the actual application settings:
from app import app as applicationThe /healthz route only checks that this example can respond. It does not verify database access or your business workflow.
4. Use the Django project’s WSGI application
In a conventional Django project, the project package’s wsgi.py defines application. Replace myproject with the real package name and make sure Python can import it.
from myproject.wsgi import applicationPrepare production settings with DEBUG=False, ALLOWED_HOSTS restricted to your domains and a private SECRET_KEY. Run check --deploy with the project’s production settings and review the warnings. Back up the database and plan recovery before running schema migrations.
python manage.py check --deploy
5. Accept the deployment using separate checks
- Verify the domain’s HTTPS certificate and a correct response from the public application.
- Load a static asset, such as CSS, from its final URL. An unstyled page is not complete acceptance.
- Exercise a synthetic operation against a test database; healthz alone does not test the database.
- Restart the application and repeat the checks. Retain the previous version for recovery.
Diagnose a 500 error separately from static files and response time
- ModuleNotFoundError: compare the environment, package name and import path.
- WSGI startup error: check the startup file and application variable against the account settings.
- Database error: check the host, permissions and driver compatibility locally; never post the password in a ticket.
- HTTP 200 but missing styling: inspect the static URL and its response.
- Slow or interrupted response: record the time, path and sanitized error; check external APIs and long work performed inside a request.
When is a VPS a better fit?
For persistent processes, unsupported protocols or system-level control, compare an hourly VPS and its management responsibilities. Model computation on a graphics card uses the separate hourly GPU service, with its own application and access limits. For a conventional WSGI web app, compare current Python hosting plans by resources and conditions.
Technical references: Flask production deployment and the Django deployment checklist. Use the documentation matching your installed framework version.
Comments 0
No comments yet — be the first!