Skip to content

Commit

Permalink
data from old website + /favicon for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodraak committed Oct 31, 2014
1 parent 7da5e5f commit a7e7721
Show file tree
Hide file tree
Showing 6 changed files with 5,202 additions and 4 deletions.
11 changes: 9 additions & 2 deletions cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ todo long run
- button radius
- flake8 compliant (pep8 + other stuff)

#########################################################
# #
# << Premature optimization is the root of all evil. >> #
# #
#########################################################

to do now
- https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
- var|date:'d F Y à H\hi'
- previsualisation des posts
- news / tuto / articles : export pdf (pandoc)
- https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
- syndication (rss + atom) : https://docs.djangoproject.com/en/dev/ref/contrib/syndication/
- news / tuto / articles : export pdf (pandoc)

to do maybe
- noscript : menu, (logout ok)
Expand Down
17 changes: 15 additions & 2 deletions loadFixtures.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from os import system

fixtures = (
fixtures = ()
"""
'auth.yaml',
'member.yaml',
'publications.yaml',
'events.yaml',
)
"""

###########
# CLEAN
Expand All @@ -32,7 +36,7 @@
print '=> Creating super user ...'
system(
'echo "from django.contrib.auth.models import User; User.objects.create_superuser('
'\'Nodraak\', \'nodraak@mail.fr\', \'mdp\')" | ./manage.py shell'
'\'Nodraak\', \'chardond@ece.fr\', \'mdp\')" | ./manage.py shell'
)
print '=> Done'

Expand All @@ -42,3 +46,12 @@
print '=> %s :' % fixture
system('python manage.py loaddata %s' % fixture)
print '=> Done'

print '=> Loading prod stuf (migrate + data from old website'
system('./manage.py migrate')
system('./manage.py loaddata prod/f_auth.yaml')
system('./manage.py loaddata prod/f_member.yaml')
system('./manage.py loaddata prod/f_pub.yaml')
print '=> Done'

print '#####\n# TODO : Creer un profil pour Nodraak\n#####'
26 changes: 26 additions & 0 deletions prod/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@
* `python manage.py clearsessions`
* solr ?

```python
publications = Publication.objects.all()

from __future__ import unicode_literals
from os import system
import sys

for p in publications:
# write to file
tmp_html = open('tmp.html', 'w')
text_html = p.text.encode('utf8')
tmp_html.write(text_html)
tmp_html.flush()

# call pandoc
system('pandoc tmp.html -o tmp.md')

# load from file
tmp_md = open('tmp.md', 'r')
text_md = tmp_md.read().decode('utf8')
p.text = '\n\n'.join((p.text, '```text', text_md, '```'))
p.save()

system('rm tmp.html tmp.md')
```

**Resumé des technos utilisées :**

| Paramètre   | Valeur |
Expand Down
Loading

0 comments on commit a7e7721

Please sign in to comment.