Skip to content

Commit a7e7721

Browse files
committed
data from old website + /favicon for nginx
1 parent 7da5e5f commit a7e7721

File tree

6 files changed

+5202
-4
lines changed

6 files changed

+5202
-4
lines changed

cdc.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ todo long run
1010
- button radius
1111
- flake8 compliant (pep8 + other stuff)
1212

13+
#########################################################
14+
# #
15+
# << Premature optimization is the root of all evil. >> #
16+
# #
17+
#########################################################
18+
1319
to do now
14-
- https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
20+
- var|date:'d F Y à H\hi'
1521
- previsualisation des posts
16-
- news / tuto / articles : export pdf (pandoc)
22+
- https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/
1723
- syndication (rss + atom) : https://docs.djangoproject.com/en/dev/ref/contrib/syndication/
24+
- news / tuto / articles : export pdf (pandoc)
1825

1926
to do maybe
2027
- noscript : menu, (logout ok)

loadFixtures.py

100644100755
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
13

24
from os import system
35

4-
fixtures = (
6+
fixtures = ()
7+
"""
58
'auth.yaml',
69
'member.yaml',
710
'publications.yaml',
811
'events.yaml',
912
)
13+
"""
1014

1115
###########
1216
# CLEAN
@@ -32,7 +36,7 @@
3236
print '=> Creating super user ...'
3337
system(
3438
'echo "from django.contrib.auth.models import User; User.objects.create_superuser('
35-
'\'Nodraak\', \'nodraak@mail.fr\', \'mdp\')" | ./manage.py shell'
39+
'\'Nodraak\', \'chardond@ece.fr\', \'mdp\')" | ./manage.py shell'
3640
)
3741
print '=> Done'
3842

@@ -42,3 +46,12 @@
4246
print '=> %s :' % fixture
4347
system('python manage.py loaddata %s' % fixture)
4448
print '=> Done'
49+
50+
print '=> Loading prod stuf (migrate + data from old website'
51+
system('./manage.py migrate')
52+
system('./manage.py loaddata prod/f_auth.yaml')
53+
system('./manage.py loaddata prod/f_member.yaml')
54+
system('./manage.py loaddata prod/f_pub.yaml')
55+
print '=> Done'
56+
57+
print '#####\n# TODO : Creer un profil pour Nodraak\n#####'

prod/deploy.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,32 @@
4040
* `python manage.py clearsessions`
4141
* solr ?
4242

43+
```python
44+
publications = Publication.objects.all()
45+
46+
from __future__ import unicode_literals
47+
from os import system
48+
import sys
49+
50+
for p in publications:
51+
# write to file
52+
tmp_html = open('tmp.html', 'w')
53+
text_html = p.text.encode('utf8')
54+
tmp_html.write(text_html)
55+
tmp_html.flush()
56+
57+
# call pandoc
58+
system('pandoc tmp.html -o tmp.md')
59+
60+
# load from file
61+
tmp_md = open('tmp.md', 'r')
62+
text_md = tmp_md.read().decode('utf8')
63+
p.text = '\n\n'.join((p.text, '```text', text_md, '```'))
64+
p.save()
65+
66+
system('rm tmp.html tmp.md')
67+
```
68+
4369
**Resumé des technos utilisées :**
4470

4571
| Paramètre   | Valeur |

0 commit comments

Comments
 (0)