Frappe Framework Course
Server Side Scripting Introduction
Eby Mathew
Sep 5, 2022

In this lesson we will see the introduction to server side scripting and run our first server side script using Python. This lesson will also help you understand the server side events

Questions
frappe import error in server script
Suresh Parvathareddy
6 months ago
Post
Dismiss

import frappe

from frappe.model.document import Document


class ServersideScripting(Document):

       def validate(self):

               frappe.throw("hello")


when I try to run this script from serverside scripting it throws the following error:

import frappe

Traceback (most recent call last):

 File "/opt/bench/frappe-bench/apps/frappe/frappe/programming_module/doctype/serverside_scripting/serverside_scripting.py", line 5, in <module>

   from frappe.model.document import Document

ModuleNotFoundError: No module named 'frappe.model'


Where as the model exist in frappe at the following path /opt/bench/frappe-bench/apps/frappe/frappe


import frappe

from frappe.model.document import Document


class ServersideScripting(Document):

       def validate(self):

               frappe.throw("hello")


when I try to run this script from serverside scripting it throws the following error:

import frappe

Traceback (most recent call last):

 File "/opt/bench/frappe-bench/apps/frappe/frappe/programming_module/doctype/serverside_scripting/serverside_scripting.py", line 5, in <module>

   from frappe.model.document import Document

ModuleNotFoundError: No module named 'frappe.model'


Where as the model exist in frappe at the following path /opt/bench/frappe-bench/apps/frappe/frappe


Want to discuss?
Post it here, our mentors will help you out.
How to install education module
Raja Kushal
1 year ago
Post
Dismiss
Student login system in education module
Student login system in education module
Want to discuss?
Post it here, our mentors will help you out.