admin working

This commit is contained in:
Sharad Ahlawat 2020-03-07 23:37:23 -08:00
parent e3b7308b8b
commit 29051da8e1
10 changed files with 73 additions and 1 deletions

15
.idea/deployment.xml Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="auto">
<serverData>
<paths name="auto">
<serverdata>
<mappings>
<mapping deploy="/data/portfolio" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RGraphicsSettings">
<option name="height" value="1200" />
<option name="resolution" value="75" />
<option name="version" value="1" />
<option name="width" value="1920" />
</component>
</project>

10
.idea/rpackages.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RPackageService">
<option name="enabledRepositoryUrls">
<list>
<option value="@CRAN@" />
</list>
</option>
</component>
</project>

Binary file not shown.

View File

@ -1,3 +1,7 @@
from django.contrib import admin
# Register your models here.
from .models import Job
admin.site.register(Job)

View File

@ -0,0 +1,22 @@
# Generated by Django 3.0.3 on 2020-03-08 07:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Job',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(upload_to='images/')),
('summary', models.CharField(max_length=200)),
],
),
]

View File

@ -1,3 +1,8 @@
from django.db import models
# Create your models here.
class Job(models.Model):
image = models.ImageField(upload_to='images/')
summary = models.CharField(max_length=200)

BIN
media/images/cloud1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -37,6 +37,8 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog.apps.BlogConfig',
'jobs.apps.JobsConfig',
]
MIDDLEWARE = [
@ -119,3 +121,6 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

View File

@ -15,7 +15,9 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)