Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axelpale/minimal-django-file-upload-example
Source code for an example app at http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example
https://github.com/axelpale/minimal-django-file-upload-example
Last synced: about 17 hours ago
JSON representation
Source code for an example app at http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example
- Host: GitHub
- URL: https://github.com/axelpale/minimal-django-file-upload-example
- Owner: axelpale
- Created: 2012-07-12T11:25:25.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-07-22T23:15:11.000Z (over 4 years ago)
- Last Synced: 2024-11-06T03:48:02.308Z (8 days ago)
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 599
- Watchers: 30
- Forks: 242
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
minimal-django-file-upload-example
==================================Project contains source code that was made originally for the [Django file upload example at StackOverflow](http://stackoverflow.com/questions/5871730/need-a-minimal-django-file-upload-example).
The goal with minimal-django-file-upload-example is to demonstrate and teach how file uploading is done with Django. Because of the academic nature of the project all the extra functionality is left out. Otherwise you would have hard time to guess what is important and what is not.
The following Django versions are supported:
- [Django 3.0](https://docs.djangoproject.com/en/dev/releases/3.0/) | [source](../../tree/master/src/for_django_3-0).
- [Django 2.0.2](https://docs.djangoproject.com/en/2.0/releases/2.0.2/) | [source](../../tree/master/src/for_django_2-0/myproject).
- [Django 1.9](https://docs.djangoproject.com/en/dev/releases/1.9/) | [source](../../tree/master/src/for_django_1-9/myproject).
- [Django 1.8](https://docs.djangoproject.com/en/dev/releases/1.8/) | [source](../../tree/master/src/for_django_1-8/myproject).
- [Django 1.7](https://docs.djangoproject.com/en/dev/releases/1.7/) | [source](../../tree/master/src/for_django_1-7/myproject).
- [Django 1.6](https://docs.djangoproject.com/en/dev/releases/1.6/) | [source](../../tree/master/src/for_django_1-6/myproject).
- [Django 1.5](https://docs.djangoproject.com/en/dev/releases/1.5/) | [source](../../tree/master/src/for_django_1-5/myproject).
- [Django 1.4](https://docs.djangoproject.com/en/dev/releases/1.4/) | [source](../../tree/master/src/for_django_1-4/myproject).
- [Django 1.3](https://docs.djangoproject.com/en/dev/releases/1.3/) | [source](../../tree/master/src/for_django_1-3/myproject).Usage (Django 3.0)
------------------
[Django 3.0 supports Python 3.6, 3.7, and 3.8.](https://docs.djangoproject.com/en/dev/releases/3.0/#python-compatibility) Using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) is highly recommended although not strictly required.$ git clone https://github.com/axelpale/minimal-django-file-upload-example.git
$ cd minimal-django-file-upload-example
$ cd src/for_django_3-0
$ pip install -r requirements.txt (only if you don't have Django 3.0 installed)
$ python manage.py migrate
$ python manage.py runserverUsage (Django 2.0.2)
------------------
First ensure you have Django 2.0.2 installed. Then:$ git clone https://github.com/axelpale/minimal-django-file-upload-example.git
$ cd minimal-django-file-upload-example
$ cd src/for_django_2-0/myproject
$ python manage.py makemigrations
$ python manage.py migrate --run-syncdb
$ python manage.py runserverUsage (Django 1.9)
------------------
First ensure you have Django 1.9 installed. Then:$ git clone https://github.com/axelpale/minimal-django-file-upload-example.git
$ cd minimal-django-file-upload-example
$ cd src/for_django_1-9/myproject
$ python manage.py migrate
$ python manage.py runserverDifferences between code for Django 1.7 and 1.8
-----------------------------------------------
- settings.py: New TEMPLATE settings. See [upgrading instructions](https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/) for details.
- settings.py: reverted to the default directory for db.sqlite3 database and media dir.
- urls.py: Added explicit RedirectView permanent argument: `RedirectView.as_view(url='/myapp/list/', permanent=True))`Differences between code for Django 1.6 and 1.7
-----------------------------------------------
- use `./manage.py migrate` instead of `./manage.py syncdb`Differences between code for Django 1.5 and 1.6
-----------------------------------------------
- myapp/urls.py: changed the line `from django.conf.urls.defaults import patterns, url` to `from django.conf.urls import patterns, url`Differences between code for Django 1.4 and 1.5
-----------------------------------------------
- urls.py: Django 1.5 recommends RedirectView to be used instead of django.views.generic.simple.redirect_to. See [RedirectView](https://docs.djangoproject.com/en/1.5/ref/class-based-views/base/#redirectview) for details.
- list.html: url template tag requires view names to be double quoted. See [Django 1.5 release note overview](https://docs.djangoproject.com/en/dev/releases/1.5/#overview) for details.Differences between code for Django 1.3 and 1.4
-----------------------------------------------
- Directory hierachy follows Django's defaults. For example manage.py has risen one level up.
- Due to hierarchy change absolute package paths are now more recommended and therefore used. Look INSTALLED_APPS in settings.py for example.
- Little more comments
- More encoding definitions # -*- coding: utf-8 -*-
- Database renamed to database.sqlite3