python:dev-mode
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| python:dev-mode [2024/10/02 07:33] – kirtisingh | python:dev-mode [2024/10/02 07:52] (current) – kirtisingh | ||
|---|---|---|---|
| Line 132: | Line 132: | ||
| + | **Generic Python App** | ||
| + | < | ||
| + | mkdir generic-project | ||
| + | cd geneic-project | ||
| + | python3 -m venv .venv | ||
| + | source .venv/ | ||
| + | </ | ||
| + | Running the last command with activate the virtual environment, | ||
| + | < | ||
| + | pip install gunicorn | ||
| + | </ | ||
| + | Here is a small hello world example of our generic app | ||
| + | Below code is saved to hello.py | ||
| + | |||
| + | < | ||
| + | def app(environ, | ||
| + | data = b" | ||
| + | start_response(" | ||
| + | (" | ||
| + | (" | ||
| + | ]) | ||
| + | return iter([data]) | ||
| + | </ | ||
| + | |||
| + | Now to fire our flash app, we use gunicorn | ||
| + | |||
| + | < | ||
| + | gunicorn -b 0.0.0.0: | ||
| + | </ | ||
| + | |||
| + | To run it in background, we append & to the above command | ||
| + | |||
| + | < | ||
| + | gunicorn -b 0.0.0.0: | ||
| + | </ | ||
| + | |||
| + | To exit virtual environment use the command | ||
| + | < | ||
| + | deactivate | ||
| + | </ | ||
| + | \\ | ||
| + | **With this our SSH Console aspect of our python project is covered. Now we will link our app to our VHost/ | ||
| + | |||
| + | |||
| + | **Step 6 :** Log into N99panel and click on ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | **Step 7 :** Now click on ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | **Step 8 :** Now further click on 'Map a Python Dev Port' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | **Step 9 :** Fill the form with the requisite details | ||
| + | |||
| + | {{: | ||
| + | |||
| + | With these above mentioned steps, you can showcase your python apps to the world very easily. | ||
python/dev-mode.1727854422.txt.gz · Last modified: 2024/10/02 07:33 by kirtisingh
