A resource for solving problems in computational physics using Python, covering many topics in physics.
-
Clone this repository:
git clone https://github.com/numfys/numfys.git -
Change from production to development settings: This step will be removed in the future, by using environment variables.
# manage.py Change - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "numfys.devel") to + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "numfys.production")# numfys/wsgi.py Change -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "numfys.devel") to +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "numfys.production")# static/css/nbstyle.css Change -<link rel="stylesheet" type="text/css" href="/static/css/code_style.css" /> to +<link rel="stylesheet" type="text/css" href="https://www.numfys.net/static/css/code_style.css" /> -
Create and activate a new virtual environment:
virtualenv -p /usr/bin/python3 venv source venv/bin/activate -
Use pip to install the necessary packages and dependencies from
requirements.txt, by running:pip3 install -r requirements.txtNB! The installation depends on the libraries
libmysqlclientandlibjpeg. These are found in the following apt packages:libmysqlclient-devandlibjpeg8-dev. In some distributions, such as Arch, the SQL-libraries are found inmariadb-libsinstead oflibmysqlclient-dev. -
Set up the
SQLitedatabase by running the commands:./manage.py makemigrations notebook ./manage.py migrate -
Now it's time to run the Django development server. In the directory containing
manage.py, run:./manage.py runserver -
To manage the website content, create a superuser and log in at 127.0.0.1:8000/admin:
./manage.py createsuperuser
Didn't work? Send us a message explaining what error message you got.
A project of the Department of Physics at NTNU, supported by Norgesuniversitetet.
The content of this project itself is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License, and the underlying source code used to format and display that content is licensed under a Modified License.