repl.it
@ElsGuns/

Django Tutorial Project

Python

Starting point for django server

fork
loading
Files
  • main.py
  • main
  • static
  • templates
  • db.sqlite3
  • manage.py
  • Packager files
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
from django.core.management import execute_from_command_line

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")

print('type `manage.py help` for help, or hit enter to start server')

while True:
  cmd = input()

  if not cmd:
    cmd = 'manage.py runserver 0.0.0.0:8000'
    execute_from_command_line(cmd.split())
    
  execute_from_command_line(cmd.split())

  print('type a command, hit enter to start server')