Skip to content

xxxxsars/demo

Repository files navigation

Install ODBC Driver

  1. Install dependencies for PyODBC and tds
$ apt-get install -y tdsodbc unixodbc-dev 
$ apt install unixodbc-bin -y 
$ apt-get clean -y
  1. Edit /etc/odbcinst.ini
echo "[FreeTDS]
[FreeTDS]
Description = FreeTDS unixODBC Driver
Driver = /usr/lib/arm-linux-gnueabihf/odbc/libtdsodbc.so
Setup = /usr/lib/arm-linux-gnueabihf/odbc/libtdsS.so
  1. Install requirements (contains pyodbc)
pip install --no-cache-dir -r requirements.txt

Create systemctl service

  1. Create a new service file.
$ vim /lib/systemd/system/website-demo.service 

[Unit]
Description=Raspberry WebSite Demo
After= network-online.target
 
[Service]
ExecStart=/usr/bin/python3 /home/pi/Desktop/demo/manage.py runserver 0.0.0.0:8000
WorkingDirectory=/home/pi/Desktop/demo
User = nobody
  1. Linked this file to the systemctl path
ln -fs /lib/systemd/system/website-demo.service /etc/systemd/system/website-demo.service
  1. Register service
$ sudo systemctl daemon-reload
$ sudo systemctl restart website-demo.service
$ sudo systemctl enable website-demo.service

Restful API

  1. Documentation

  2. Restful Method:

    • POST - Create
    • GET - Read
    • PATCH - Update
    • DELETE - Delete

form post vs ajax post

  1. Form post sample

  2. Ajax post sample

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors