2.0.0 • Published 6 years ago

generator-djangospa v2.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

generator-djangospa

Django single page application for Yeoman

Getting started

Setting up the environment

Create a virtual environment and install django:

$ virtualenv myenv

Activate the environment:

$ . myenv/bin/activate

Install the django single page app generator

$ npm install generator-djangospa -g

Creating a new project

$ yo djangospa

The generator will ask the name of the project, an initial app name, which version of django, theme, licensing and after that it will download all the project dependencies and run gulp to copy files over to proper locations.

Project folder structure

├─┬ app\
│ └─┬ templates\
│   └── app\
│
├── demo\
│
├─┬ source\
│ └── scss\
│
├─┬ static\
│ ├─┬ scripts\
│ │ └── app\
│ │
│ ├─┬ styles\
│ │ └── css\
│ │
│ └── view_templates\
│
└── templates\

Installing the dependencies:

$ cd <name_of_your_project>
$ pip install -r requirements.txt

If you are using pipenv you can run:

$ pipenv install -r requirements.txt

Applying migrations

$ python manage.py makemigrations
$ python manage.py migrate

Creating the admin user

$ python manage.py createsuperuser

Adding intial data

$ python manage.py loaddata fixtures/initdata.json

Starting the site

$ python manage.py runserver

Access your application at http://127.0.0.1:8000

Django REST framework API

Access browsable API at http://127.0.0.1:8000/api

Django admin page

The django admin page is enabled by default and it can be accessed at http://127.0.0.1:8000/admin

Gulp tasks

TaskDescription
copy-stylesCopy all the CSS dependencies to static/styles/css/
copy-scriptsCopy all the JavaScript dependencies to static/scripts/
sassCompile the SCSS files into CSS
sass:watchWatch for changes in the scss files and run the sass task

Copyright and License

Copyright (c) 2015 Daniel Furtado. Code released under the MIT license

Contributors

https://github.com/dfurtado/generator-djangospa/graphs/contributors

2.0.0

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago