Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.1%) to scientific vocabulary
Repository
Django Tutorial
Basic Info
Statistics
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Django Guide
Process
- Activate Virtualenv
- django-admin startproject mysite
- Change settings.py > 1. TIMEZONE = 'Asia/Seoul' > 2. STATICROOT = os.path.join(BASE_DIR, 'static')
- python manage.py migrate
- python manage.py startapp someapp
- Add app to settings.py
Edit models.py
- from django.utils import timezone
- Make class somename(models.Model)
- models have belows : > * ForeignKey > * CharField > * TextField > * UrlField > * DateTimeField ```python from django.db import models from django.utils import timezone import ast
Create your models here.
class Hi(models.Model): author = models.ForeignKey('auth.User') title = models.CharField(maxlength=10) body = models.TextField(null=True, blank=True) createddate = models.DateTimeField( default=timezone.now ) published_date = models.DateTimeField( null=True, blank=True )
def publish(self): self.published_date = timezone.now self.save def __str__(self): return self.title```
python manage.py makemigrations someapp
python manage.py migrate someapp
Edit admin.py
- (In VS Code, install djaneiro)
- from .models import *
- Typing adminview and tab! ```python from django.contrib import admin from .models import *
class HiAdmin(admin.ModelAdmin): ''' Admin View for Hi ''' listdisplay = ('title', 'body', 'author', 'publisheddate') listfilter = ('title', 'author') searchfields = ('title', 'author') listperpage = 25
admin.site.register(Hi, HiAdmin) ```
python manage.py createsuperuser
python manage.py runserver
Server : python manage.py collectstatic
Edit urls.py (mysite)
** Regex ** * ^ : Start * $ : End * \d : Number * () : Save part of pattern ```python from django.conf.urls import include, url from django.contrib import admin
admin.site.sitetitle = "Yonsei HEP-COSMO Admin Page" admin.site.siteheader = "Yonsei HEP-COSMO Admin Page"
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include('HEP_COSMO.urls')), ] ```
Edit urls.py (someapp)
- from . import views
- Add urlpatterns ```python from django.conf.urls import url from . import views
urlpatterns = [ url(r'^$', views.home, name='index'), url(r'^index', views.home, name='index'), url(r'^members', views.members, name='members'), url(r'^publish', views.publish, name='publish'), url(r'^research', views.research, name='research'), url(r'^calendar', views.calendar, name='calendar'), url(r'^finedust', views.finedust, name='finedust'), url(r'^link', views.link, name='link'), url(r'^arxiv', views.arxiv, name='arxiv'), url(r'contact', views.contact, name='contact'), ] ```
Edit views.py (render : request -> html)
```python from django.shortcuts import render from .models import *
Create your views here.
def home(request): return render(request, 'HEP/index.html', {})
def members(request): persons = People.objects.order_by('index') temp = [] for person in persons: temp.append(person.position) positions = [] [positions.append(position) for position in temp if position not in positions] return render(request, 'HEP/members.html', {'persons': persons, 'positions': positions}) ```
mkdir templates, mkdir templates/app, touch html
Edit html ({% block content %})
```html {% load staticfiles %}
<title>Yonsei HEP-COSMO</title> <!-- Bootstrap core CSS --> <link href="{% static 'css/bootstrap.css' %}" rel="stylesheet"> <link href="{% static 'css/image-effects.css' %}" rel="stylesheet"> <link href="{% static 'css/custom-styles.css' %}" rel="stylesheet"> <link href="{% static 'css/font-awesome.css' %}" rel="stylesheet"> <link href="{% static 'css/font-awesome-ie7.css' %}" rel="stylesheet"> <!-- Favicon --> <link rel="shortcut icon" href="{% static 'favicon.ico' %}" />```
html <div class="container"> <div class="row"> <div class="col-md-12 col-sm-12"> <div class="blist"> {% for diffyear in yearlist %} <div class="ruler"></div> <ul> <li><a href="#">{{ diffyear }}</a></li> </ul> <div class="dlist"> <ul> {% for article in articles %} {% if article.year == diffyear %} <li> {{ article.people }}, 「<span><i>{{ article.title }}</i></span>」 {% if article.journal != None %} <a href="{{ article.hyperlink }}" target="_blank">{{ article.journal }}</a> {% endif %} <a href="{{ article.arxivlink }}" target="_blank">{{ article.arxiv }}</a> </li> {% endif %} {% endfor %} </ul> </div> {% endfor %} <br /> <div class="ruler"></div> <p> You can find the full list from InspireHEP [<a href="https://goo.gl/AS6UKo" target="_blank">here</a>] </p> </div> </div> </div> </div>
- mkdir static, mkdir css, touch css
Owner
- Name: Tae-Geun Kim
- Login: Axect
- Kind: user
- Location: Seoul, South Korea
- Company: Yonsei Univ.
- Website: https://axect.github.io
- Repositories: 21
- Profile: https://github.com/Axect
Ph.D student of particle physics & Rustacean
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0