Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/relative path #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
UIT Version
__pycache__
Binary file modified RISCV/r5pythonversion/db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions RISCV/r5pythonversion/r5pythonversion/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['merloxygen.pythonanywhere.com']
ALLOWED_HOSTS = [] # ['merloxygen.pythonanywhere.com']


# Application definition
Expand Down Expand Up @@ -119,7 +119,7 @@
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = '/home/merloxygen/Merl-UIT-Simulator/RISCV/r5pythonversion/static'
STATIC_ROOT = os.path.join(BASE_DIR,'static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
Expand Down
6 changes: 5 additions & 1 deletion RISCV/r5pythonversion/r5pythonversion/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from . import instructions
from . import Interpreter
from . import InterpreterIM
import os

class Base:
param = {}
Expand Down Expand Up @@ -62,7 +63,10 @@ def home(request):

##### This Is Memory Block START
###When using Online web
file_values=open("/home/merloxygen/Merl-UIT-Simulator/RISCV/r5pythonversion/templates/m.txt","r")
current_directory = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(current_directory, '..', 'templates/m.txt')
# file_path = os.path.join(templates_path, "m.txt")
file_values=open(file_path,"r")
###when using dedicated machine(PC)

# file_values = open("templates\m.txt", "r")
Expand Down