Python should be installed
Open any newly created folder using vs code or any other IDE. folder name ex: online-code-editor Go to terminal and follow below steps.
- First create virtual environment
python -m venv myenvonline
- To activate venv
.\myenvonline\Scripts\activate
- Install django
pip install django
- To create project
git clone https://github.com/imrosun/online-code-editor-python.git
OR
django-admin startproject onlinecode
Skip if cloned
- To create app inside project
cd onlinecode
python manage.py startapp codeeditor
After this add app {'codeeditor'} inside INSTALLED_APPS on settings.py file
- To run server
python manage.py runserver
- To host on vercel
Step 1: Go to /onlinecode/settings.py Update ALLOWED_HOSTS = ['.vercel.app']
Step 2: Generate requirments.txt using command
pip freeze > requirements.txt
Step 3: Create vercel.json file in app folder or manage.py path