Code Monkey home page Code Monkey logo

django-bio-blog's Introduction

Django Biography Blog

Get start

if you have make:

make Makefile
make Makefile activate
make MAkefile migrate

else

virtualenv venv
echo 'Bash'
echo 'venv/bin/activate'
echo 'Windows'
venv\Script\activate

pip install requirements
cd bioblog
python manage.py migrate
python manage.py runserver

Description

Biography Blog with authentication and contact form. Modificated admin panel.

Topics

- Biography
- Admin-panel
- Class-Based-Views

Main page

alt text

Example

class WomenCategory(DataMixin, ListView):
	model = Women
	template_name = 'women/index.html'
	context_object_name = 'posts'
	# При отсутсвие каких - либо записей -> 404
	allow_empty = False

	def get_queryset(self):
		return Women.objects.filter(
				cat__slug=self.kwargs['cat_slug'],
				is_published = True).select_related('cat')

	def get_context_data(self, *, object_list=None, **kwargs):
		context = super().get_context_data(**kwargs)
		# context['title'] = 'Категория - ' + str(context['posts'][0].cat)
		# context['menu'] = menu
		# context['cat_selected'] = context['posts'][0].cat_id
		c = Category.objects.get(slug = self.kwargs['cat_slug'])
		c_def = self.get_user_context(
			title='Категория - ' + str(c.name), 
			cat_selected=c.pk
		)
		return dict(list(context.items()) + list(c_def.items()))

django-bio-blog's People

Contributors

david2261 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.