From 0cb31006e5e122dfea0f138323f81a4729bdc722 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 23 Jun 2016 12:23:37 +0530 Subject: [PATCH] [redesign] website route is evaluated on request, no cold start --- frappe/boot.py | 2 +- frappe/utils/jinja.py | 2 +- frappe/utils/oauth.py | 6 +- frappe/website/context.py | 4 +- frappe/website/doctype/web_form/web_form.py | 4 +- frappe/website/render.py | 66 +++++---- frappe/website/router.py | 127 +++++++++++------- frappe/website/website_generator.py | 2 +- frappe/{templates/pages => www}/404.html | 0 frappe/{templates/pages => www}/404.py | 0 frappe/{templates/pages => www}/__init__.py | 0 frappe/{templates/pages => www}/about.html | 0 frappe/{templates/pages => www}/about.py | 0 .../pages => www}/complete_signup.html | 0 .../pages => www}/complete_signup.py | 0 frappe/{templates/pages => www}/contact.html | 0 frappe/{templates/pages => www}/contact.py | 0 frappe/{templates/pages => www}/desk.html | 0 frappe/{templates/pages => www}/desk.py | 0 .../pages => www}/edit-profile.html | 0 .../{templates/pages => www}/edit_profile.py | 0 frappe/{templates/pages => www}/error.html | 0 frappe/{templates/pages => www}/error.py | 0 frappe/{templates/pages => www}/list.html | 0 frappe/{templates/pages => www}/list.py | 0 frappe/{templates/pages => www}/login.html | 0 frappe/{templates/pages => www}/login.py | 0 frappe/{templates/pages => www}/me.html | 0 frappe/{templates/pages => www}/me.py | 2 +- frappe/{templates/pages => www}/message.html | 4 +- frappe/{templates/pages => www}/message.py | 5 - frappe/{templates/pages => www}/print.html | 0 frappe/{templates/pages => www}/print.py | 0 frappe/{templates/pages => www}/rss.py | 0 frappe/{templates/pages => www}/rss.xml | 0 frappe/{templates/pages => www}/sitemap.py | 4 +- frappe/{templates/pages => www}/sitemap.xml | 0 .../pages => www}/update-password.html | 0 .../pages => www}/update_password.py | 0 .../pages => www}/website_script.js | 0 .../pages => www}/website_script.py | 0 .../pages => www}/website_theme.css | 0 .../{templates/pages => www}/website_theme.py | 0 43 files changed, 131 insertions(+), 97 deletions(-) rename frappe/{templates/pages => www}/404.html (100%) rename frappe/{templates/pages => www}/404.py (100%) rename frappe/{templates/pages => www}/__init__.py (100%) rename frappe/{templates/pages => www}/about.html (100%) rename frappe/{templates/pages => www}/about.py (100%) rename frappe/{templates/pages => www}/complete_signup.html (100%) rename frappe/{templates/pages => www}/complete_signup.py (100%) rename frappe/{templates/pages => www}/contact.html (100%) rename frappe/{templates/pages => www}/contact.py (100%) rename frappe/{templates/pages => www}/desk.html (100%) rename frappe/{templates/pages => www}/desk.py (100%) rename frappe/{templates/pages => www}/edit-profile.html (100%) rename frappe/{templates/pages => www}/edit_profile.py (100%) rename frappe/{templates/pages => www}/error.html (100%) rename frappe/{templates/pages => www}/error.py (100%) rename frappe/{templates/pages => www}/list.html (100%) rename frappe/{templates/pages => www}/list.py (100%) rename frappe/{templates/pages => www}/login.html (100%) rename frappe/{templates/pages => www}/login.py (100%) rename frappe/{templates/pages => www}/me.html (100%) rename frappe/{templates/pages => www}/me.py (89%) rename frappe/{templates/pages => www}/message.html (73%) rename frappe/{templates/pages => www}/message.py (94%) rename frappe/{templates/pages => www}/print.html (100%) rename frappe/{templates/pages => www}/print.py (100%) rename frappe/{templates/pages => www}/rss.py (100%) rename frappe/{templates/pages => www}/rss.xml (100%) rename frappe/{templates/pages => www}/sitemap.py (84%) rename frappe/{templates/pages => www}/sitemap.xml (100%) rename frappe/{templates/pages => www}/update-password.html (100%) rename frappe/{templates/pages => www}/update_password.py (100%) rename frappe/{templates/pages => www}/website_script.js (100%) rename frappe/{templates/pages => www}/website_script.py (100%) rename frappe/{templates/pages => www}/website_theme.css (100%) rename frappe/{templates/pages => www}/website_theme.py (100%) diff --git a/frappe/boot.py b/frappe/boot.py index fe7bd1f556..f2cf2eeedd 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -162,4 +162,4 @@ def load_print(bootinfo, doclist): load_print_css(bootinfo, print_settings) def load_print_css(bootinfo, print_settings): - bootinfo.print_css = frappe.get_attr("frappe.templates.pages.print.get_print_style")(print_settings.print_style or "Modern", for_legacy=True) + bootinfo.print_css = frappe.get_attr("frappe.www.print.get_print_style")(print_settings.print_style or "Modern", for_legacy=True) diff --git a/frappe/utils/jinja.py b/frappe/utils/jinja.py index b3df61701f..430cc2c433 100644 --- a/frappe/utils/jinja.py +++ b/frappe/utils/jinja.py @@ -105,7 +105,7 @@ def get_allowed_functions_for_jenv(): "get_controller": get_controller }, "get_visible_columns": \ - frappe.get_attr("frappe.templates.pages.print.get_visible_columns"), + frappe.get_attr("frappe.www.print.get_visible_columns"), "_": frappe._, "get_shade": get_shade, "scrub": scrub, diff --git a/frappe/utils/oauth.py b/frappe/utils/oauth.py index 12c3e9e40d..ca0d72c12d 100644 --- a/frappe/utils/oauth.py +++ b/frappe/utils/oauth.py @@ -19,7 +19,7 @@ def get_oauth2_providers(): "base_url": "https://www.googleapis.com", }, - "redirect_uri": "/api/method/frappe.templates.pages.login.login_via_google", + "redirect_uri": "/api/method/frappe.www.login.login_via_google", "auth_url_data": { "scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", @@ -38,7 +38,7 @@ def get_oauth2_providers(): "base_url": "https://api.github.com/" }, - "redirect_uri": "/api/method/frappe.templates.pages.login.login_via_github", + "redirect_uri": "/api/method/frappe.www.login.login_via_github", # relative to base_url "api_endpoint": "user" @@ -52,7 +52,7 @@ def get_oauth2_providers(): "base_url": "https://graph.facebook.com" }, - "redirect_uri": "/api/method/frappe.templates.pages.login.login_via_facebook", + "redirect_uri": "/api/method/frappe.www.login.login_via_facebook", "auth_url_data": { "display": "page", diff --git a/frappe/website/context.py b/frappe/website/context.py index d36a67e9f1..2174c4539e 100644 --- a/frappe/website/context.py +++ b/frappe/website/context.py @@ -87,7 +87,7 @@ def build_context(context): def add_sidebar_data(context): from frappe.utils.user import get_fullname_and_avatar - import frappe.templates.pages.list + import frappe.www.list context.my_account_list = [] my_account_list = frappe.get_all('Portal Menu Item', @@ -96,7 +96,7 @@ def add_sidebar_data(context): for item in my_account_list: if item.reference_doctype: try: - item.count = len(frappe.templates.pages.list.get(item.reference_doctype).get('result')) + item.count = len(frappe.www.list.get(item.reference_doctype).get('result')) except frappe.PermissionError: pass diff --git a/frappe/website/doctype/web_form/web_form.py b/frappe/website/doctype/web_form/web_form.py index 7b55ca9bdc..c89c820010 100644 --- a/frappe/website/doctype/web_form/web_form.py +++ b/frappe/website/doctype/web_form/web_form.py @@ -63,7 +63,7 @@ class WebForm(WebsiteGenerator): def get_context(self, context): context.show_sidebar=True - from frappe.templates.pages.list import get_context as get_list_context + from frappe.www.list import get_context as get_list_context frappe.local.form_dict.is_web_form = 1 context.params = frappe.form_dict @@ -267,7 +267,7 @@ def check_webform_perm(doctype, name): return True def get_web_form_list(doctype, txt, filters, limit_start, limit_page_length=20): - from frappe.templates.pages.list import get_list + from frappe.www.list import get_list if not filters: filters = {} diff --git a/frappe/website/render.py b/frappe/website/render.py index ee3cbb279d..448ed9a8c8 100644 --- a/frappe/website/render.py +++ b/frappe/website/render.py @@ -20,40 +20,50 @@ class PageNotFoundError(Exception): pass def render(path, http_status_code=None): """render html page""" path = resolve_path(path.strip("/ ")) + data = None - try: - data = render_page_by_language(path) - except frappe.DoesNotExistError, e: - doctype, name = get_doctype_from_path(path) - if doctype and name: - path = "print" - frappe.local.form_dict.doctype = doctype - frappe.local.form_dict.name = name - elif doctype: - path = "list" - frappe.local.form_dict.doctype = doctype - else: - path = "404" - http_status_code = e.http_status_code + # if in list of already known 404s, send it + if can_cache() and frappe.cache().hget('website_404', path): + data = render_page('404') + http_status_code = 404 + else: try: - data = render_page(path) + data = render_page_by_language(path) + except frappe.DoesNotExistError, e: + doctype, name = get_doctype_from_path(path) + if doctype and name: + path = "print" + frappe.local.form_dict.doctype = doctype + frappe.local.form_dict.name = name + elif doctype: + path = "list" + frappe.local.form_dict.doctype = doctype + else: + # 404s are expensive, cache them! + frappe.cache().hset('website_404', path, True) + data = render_page('404') + http_status_code = 404 + + if not data: + try: + data = render_page(path) + except frappe.PermissionError, e: + data, http_status_code = render_403(e, path) + except frappe.PermissionError, e: data, http_status_code = render_403(e, path) - except frappe.PermissionError, e: - data, http_status_code = render_403(e, path) + except frappe.Redirect, e: + return build_response(path, "", 301, { + "Location": frappe.flags.redirect_location, + "Cache-Control": "no-store, no-cache, must-revalidate" + }) - except frappe.Redirect, e: - return build_response(path, "", 301, { - "Location": frappe.flags.redirect_location, - "Cache-Control": "no-store, no-cache, must-revalidate" - }) - - except Exception: - path = "error" - data = render_page(path) - http_status_code = 500 + except Exception: + path = "error" + data = render_page(path) + http_status_code = 500 data = add_csrf_token(data) @@ -199,7 +209,7 @@ def clear_cache(path=None): if not path: clear_sitemap() frappe.clear_cache("Guest") - frappe.cache().delete_value("_website_pages") + frappe.cache().delete_value("website_404") frappe.cache().delete_value("home_page") for method in frappe.get_hooks("website_clear_cache"): diff --git a/frappe/website/router.py b/frappe/website/router.py index 354a4790e6..9664687b93 100644 --- a/frappe/website/router.py +++ b/frappe/website/router.py @@ -50,61 +50,79 @@ def resolve_route(path): return get_page_context_from_template(path) def get_page_context_from_template(path): - found = filter(lambda p: p.page_name==path, get_pages()) - return found[0] if found else None + '''Return page_info from path''' + for app in frappe.get_installed_apps(): + app_path = frappe.get_app_path(app) + + for start in ('www', 'templates/pages'): + search_path = os.path.join(app_path, start, path) + options = (search_path, search_path + '.html', search_path + '.md', + search_path + '/index.html', search_path + '/index.md') + for o in options: + if os.path.exists(o) and not os.path.isdir(o): + return get_page_info(o, app, app_path=app_path) + + return None def get_page_context_from_doctype(path): - generator_routes = get_page_context_from_doctypes() - if path in generator_routes: - route = generator_routes[path] - return frappe.get_doc(route.get("doctype"), route.get("name")).get_route_context() + page_info = get_page_info_from_doctypes(path) + if page_info: + return frappe.get_doc(page_info.get("doctype"), page_info.get("name")).get_page_info() def clear_sitemap(): delete_page_cache("*") -def get_page_context_from_doctypes(): +def get_all_page_context_from_doctypes(): + '''Get all doctype generated routes (for sitemap.xml)''' routes = frappe.cache().get_value("website_generator_routes") if not routes: - routes = {} - for app in frappe.get_installed_apps(): - for doctype in frappe.get_hooks("website_generators", app_name = app): - condition = "" - route_column_name = "page_name" - controller = get_controller(doctype) - meta = frappe.get_meta(doctype) - - if meta.get_field("parent_website_route"): - route_column_name = """concat(ifnull(parent_website_route, ""), - if(ifnull(parent_website_route, "")="", "", "/"), page_name)""" - - if controller.website.condition_field: - condition ="where {0}=1".format(controller.website.condition_field) - - for r in frappe.db.sql("""select {0} as route, name, modified from `tab{1}` - {2}""".format(route_column_name, doctype, condition), as_dict=True): - routes[r.route] = {"doctype": doctype, "name": r.name, "modified": r.modified} - + routes = get_page_info_from_doctypes() frappe.cache().set_value("website_generator_routes", routes) return routes +def get_page_info_from_doctypes(path=None): + routes = {} + for app in frappe.get_installed_apps(): + for doctype in frappe.get_hooks("website_generators", app_name = app): + condition = "" + values = [] + route_column_name = "page_name" + controller = get_controller(doctype) + meta = frappe.get_meta(doctype) + + if meta.get_field("parent_website_route"): + route_column_name = """concat(ifnull(parent_website_route, ""), + if(ifnull(parent_website_route, "")="", "", "/"), page_name)""" + + if controller.website.condition_field: + condition ="where {0}=1".format(controller.website.condition_field) + + if path: + condition += ' {0} {1}=%s limit 1'.format(('and' if 'where' in condition else 'where'), + route_column_name) + values.append(path) + + for r in frappe.db.sql("""select {0} as route, name, modified from `tab{1}` + {2}""".format(route_column_name, doctype, condition), values=values, as_dict=True): + routes[r.route] = {"doctype": doctype, "name": r.name, "modified": r.modified} + + # just want one path, return it! + if path: + return routes[r.route] + + return routes + def get_pages(): - pages = frappe.cache().get_value("_website_pages") if can_cache() else [] + '''Get all pages. Called for docs / sitemap''' + pages = [] + for app in frappe.get_installed_apps(): + app_path = frappe.get_app_path(app) - if not pages: - pages = [] - for app in frappe.get_installed_apps(): - app_path = frappe.get_app_path(app) - - # old - path = os.path.join(app_path, "templates", "pages") + for start in ('templates/pages', 'www'): + path = os.path.join(app_path, start) pages += get_pages_from_path(path, app, app_path) - # new - path = os.path.join(app_path, "www") - pages += get_pages_from_path(path, app, app_path) - - frappe.cache().set_value("_website_pages", pages) return pages def get_pages_from_path(path, app, app_path): @@ -123,13 +141,22 @@ def get_pages_from_path(path, app, app_path): continue if extn in ("html", "xml", "js", "css", "md"): - pages.append(get_page_info(path, basepath, app, app_path, fname)) + pages.append(get_page_info(path, app, basepath, app_path, fname)) # print frappe.as_json(pages[-1]) return pages -def get_page_info(path, basepath, app, app_path, fname): +def get_page_info(path, app, basepath=None, app_path=None, fname=None): '''Load page info''' + if not fname: + fname = os.path.basename(path) + + if not app_path: + app_path = frappe.get_app_path(app) + + if not basepath: + basepath = os.path.dirname(path) + page_name, extn = fname.rsplit(".", 1) # add website route @@ -140,25 +167,27 @@ def get_page_info(path, basepath, app, app_path, fname): page_info.template = os.path.relpath(os.path.join(basepath, fname), app_path) - if page_info.basename == 'index' and basepath != path: - page_info.basename = '' + if page_info.basename == 'index': + page_info.basename = os.path.dirname(path).strip('.').strip('/') page_info.name = page_info.page_name = os.path.join(os.path.relpath(basepath, path), - page_info.basename).strip('/').strip('.').strip('/') + page_info.basename).strip('.').strip('/') + # controller page_info.controller_path = os.path.join(basepath, page_name.replace("-", "_") + ".py") + if os.path.exists(page_info.controller_path): + controller = app + "." + os.path.relpath(page_info.controller_path, + app_path).replace(os.path.sep, ".")[:-3] + page_info.controller = controller + # get the source page_info.source = get_source(page_info, basepath) - # extract properties from HTML comments if page_info.only_content: + # extract properties from HTML comments load_properties(page_info) - # controller - controller = app + "." + os.path.relpath(page_info.controller_path, - app_path).replace(os.path.sep, ".")[:-3] - page_info.controller = controller return page_info diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index 95fe3cc82e..3d9f92cfbf 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -117,7 +117,7 @@ class WebsiteGenerator(Document): where parent_website_route like %s""".format(self.doctype), (old_route, self.get_route(), now(), frappe.session.user, old_route + "%")) - def get_route_context(self): + def get_page_info(self): route = frappe._dict() route.update({ "doc": self, diff --git a/frappe/templates/pages/404.html b/frappe/www/404.html similarity index 100% rename from frappe/templates/pages/404.html rename to frappe/www/404.html diff --git a/frappe/templates/pages/404.py b/frappe/www/404.py similarity index 100% rename from frappe/templates/pages/404.py rename to frappe/www/404.py diff --git a/frappe/templates/pages/__init__.py b/frappe/www/__init__.py similarity index 100% rename from frappe/templates/pages/__init__.py rename to frappe/www/__init__.py diff --git a/frappe/templates/pages/about.html b/frappe/www/about.html similarity index 100% rename from frappe/templates/pages/about.html rename to frappe/www/about.html diff --git a/frappe/templates/pages/about.py b/frappe/www/about.py similarity index 100% rename from frappe/templates/pages/about.py rename to frappe/www/about.py diff --git a/frappe/templates/pages/complete_signup.html b/frappe/www/complete_signup.html similarity index 100% rename from frappe/templates/pages/complete_signup.html rename to frappe/www/complete_signup.html diff --git a/frappe/templates/pages/complete_signup.py b/frappe/www/complete_signup.py similarity index 100% rename from frappe/templates/pages/complete_signup.py rename to frappe/www/complete_signup.py diff --git a/frappe/templates/pages/contact.html b/frappe/www/contact.html similarity index 100% rename from frappe/templates/pages/contact.html rename to frappe/www/contact.html diff --git a/frappe/templates/pages/contact.py b/frappe/www/contact.py similarity index 100% rename from frappe/templates/pages/contact.py rename to frappe/www/contact.py diff --git a/frappe/templates/pages/desk.html b/frappe/www/desk.html similarity index 100% rename from frappe/templates/pages/desk.html rename to frappe/www/desk.html diff --git a/frappe/templates/pages/desk.py b/frappe/www/desk.py similarity index 100% rename from frappe/templates/pages/desk.py rename to frappe/www/desk.py diff --git a/frappe/templates/pages/edit-profile.html b/frappe/www/edit-profile.html similarity index 100% rename from frappe/templates/pages/edit-profile.html rename to frappe/www/edit-profile.html diff --git a/frappe/templates/pages/edit_profile.py b/frappe/www/edit_profile.py similarity index 100% rename from frappe/templates/pages/edit_profile.py rename to frappe/www/edit_profile.py diff --git a/frappe/templates/pages/error.html b/frappe/www/error.html similarity index 100% rename from frappe/templates/pages/error.html rename to frappe/www/error.html diff --git a/frappe/templates/pages/error.py b/frappe/www/error.py similarity index 100% rename from frappe/templates/pages/error.py rename to frappe/www/error.py diff --git a/frappe/templates/pages/list.html b/frappe/www/list.html similarity index 100% rename from frappe/templates/pages/list.html rename to frappe/www/list.html diff --git a/frappe/templates/pages/list.py b/frappe/www/list.py similarity index 100% rename from frappe/templates/pages/list.py rename to frappe/www/list.py diff --git a/frappe/templates/pages/login.html b/frappe/www/login.html similarity index 100% rename from frappe/templates/pages/login.html rename to frappe/www/login.html diff --git a/frappe/templates/pages/login.py b/frappe/www/login.py similarity index 100% rename from frappe/templates/pages/login.py rename to frappe/www/login.py diff --git a/frappe/templates/pages/me.html b/frappe/www/me.html similarity index 100% rename from frappe/templates/pages/me.html rename to frappe/www/me.html diff --git a/frappe/templates/pages/me.py b/frappe/www/me.py similarity index 89% rename from frappe/templates/pages/me.py rename to frappe/www/me.py index e2677f194f..3d56f672f2 100644 --- a/frappe/templates/pages/me.py +++ b/frappe/www/me.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils.user import get_fullname_and_avatar -import frappe.templates.pages.list +import frappe.www.list no_cache = 1 no_sitemap = 1 diff --git a/frappe/templates/pages/message.html b/frappe/www/message.html similarity index 73% rename from frappe/templates/pages/message.html rename to frappe/www/message.html index 80fbe6f88a..ac5dd07783 100644 --- a/frappe/templates/pages/message.html +++ b/frappe/www/message.html @@ -1,6 +1,6 @@ {% extends "templates/web.html" %} -{% block title %}{{ title }}{% endblock %} +{% block title %}{{ title or _("Message") }}{% endblock %} {% block header %} {% if header is defined -%} @@ -12,7 +12,7 @@
- {{ message }} + {{ message or _("No Message") }}
{% endblock %} diff --git a/frappe/templates/pages/message.py b/frappe/www/message.py similarity index 94% rename from frappe/templates/pages/message.py rename to frappe/www/message.py index cf57904040..262a90582f 100644 --- a/frappe/templates/pages/message.py +++ b/frappe/www/message.py @@ -27,9 +27,4 @@ def get_context(context): if message.get('http_status_code'): frappe.local.response['http_status_code'] = message['http_status_code'] - else: - message_context = { - 'message': '' - } - return message_context diff --git a/frappe/templates/pages/print.html b/frappe/www/print.html similarity index 100% rename from frappe/templates/pages/print.html rename to frappe/www/print.html diff --git a/frappe/templates/pages/print.py b/frappe/www/print.py similarity index 100% rename from frappe/templates/pages/print.py rename to frappe/www/print.py diff --git a/frappe/templates/pages/rss.py b/frappe/www/rss.py similarity index 100% rename from frappe/templates/pages/rss.py rename to frappe/www/rss.py diff --git a/frappe/templates/pages/rss.xml b/frappe/www/rss.xml similarity index 100% rename from frappe/templates/pages/rss.xml rename to frappe/www/rss.xml diff --git a/frappe/templates/pages/sitemap.py b/frappe/www/sitemap.py similarity index 84% rename from frappe/templates/pages/sitemap.py rename to frappe/www/sitemap.py index f4a8281667..66b3da1879 100644 --- a/frappe/templates/pages/sitemap.py +++ b/frappe/www/sitemap.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import urllib import frappe from frappe.utils import get_request_site_address, get_datetime, nowdate -from frappe.website.router import get_pages, get_page_context_from_doctypes +from frappe.website.router import get_pages, get_all_page_context_from_doctypes no_cache = 1 no_sitemap = 1 @@ -23,7 +23,7 @@ def get_context(context): "lastmod": nowdate() }) - for route, data in get_page_context_from_doctypes().iteritems(): + for route, data in get_all_page_context_from_doctypes().iteritems(): links.append({ "loc": urllib.basejoin(host, urllib.quote((route or "").encode("utf-8"))), "lastmod": get_datetime(data.get("modified")).strftime("%Y-%m-%d") diff --git a/frappe/templates/pages/sitemap.xml b/frappe/www/sitemap.xml similarity index 100% rename from frappe/templates/pages/sitemap.xml rename to frappe/www/sitemap.xml diff --git a/frappe/templates/pages/update-password.html b/frappe/www/update-password.html similarity index 100% rename from frappe/templates/pages/update-password.html rename to frappe/www/update-password.html diff --git a/frappe/templates/pages/update_password.py b/frappe/www/update_password.py similarity index 100% rename from frappe/templates/pages/update_password.py rename to frappe/www/update_password.py diff --git a/frappe/templates/pages/website_script.js b/frappe/www/website_script.js similarity index 100% rename from frappe/templates/pages/website_script.js rename to frappe/www/website_script.js diff --git a/frappe/templates/pages/website_script.py b/frappe/www/website_script.py similarity index 100% rename from frappe/templates/pages/website_script.py rename to frappe/www/website_script.py diff --git a/frappe/templates/pages/website_theme.css b/frappe/www/website_theme.css similarity index 100% rename from frappe/templates/pages/website_theme.css rename to frappe/www/website_theme.css diff --git a/frappe/templates/pages/website_theme.py b/frappe/www/website_theme.py similarity index 100% rename from frappe/templates/pages/website_theme.py rename to frappe/www/website_theme.py