wlanslovenija / piplmesh Goto Github PK
View Code? Open in Web Editor NEWA social info portal for wireless networks.
Home Page: http://dev.wlan-si.net/wiki/PiplMesh
License: Other
A social info portal for wireless networks.
Home Page: http://dev.wlan-si.net/wiki/PiplMesh
License: Other
Users should be able to link accounts registered directly with Facebook (and other authentication backends), so that they can login in any way and get the same account.
As explained in #61 we will use only MongoDB for database. We also have to migrate session datastore. There is already some support for this in MongoEngine.
Set also message storage to SessionStorage
.
If pushserver is turned off while someone is going offline, his status is not changed. is_online stays True.
Document development (local) installation of PiplMesh. Documentation usually resides in docs
directory and is written using Sphinx.
You can see an example in nodewatcher project.
Current design list of online users could be improved. For example, small (20x20) user images should be displayed next to the usernames, each entry in the list could be of a fixed width and length, with some scrollbar on the right. Whole list should be sorted, or even sortable. Maybe even searchable/filterable (on top a input box when you enter something that only those entries are displayed). Also some additional information could be displayed bellow the username (second text line, both lines are one user entry), like link to the profile page of this user.
Probably correct way to do this is to keep the list of online uses as a list of user objects in JavaScript, keep it current with updates, and simply just render this list on updates into a placeholder.
Blocked by: #63
In Django 1.4 they changed default project layout. Our project should be updated accordingly.
Define REST interface for posts, comments, and attachments. We will probably use Tastypie and its MongoEngine extension django-tastypie-mongoengine, but you can also research other libraries. Tastypie takes care of defining the API, like query and format interface, but we still have to define URL structure. Let it be like:
/api/post/
/api/post/id/
/api/post/id/comment/
/api/post/id/comment/id/
/api/post/id/attachment/
/api/post/id/attachment/id/
IDs in MongoDB are not numerical/sequential values. You will have to play a bit with nested resources.
For now, for API authentication, use Django authentication (so authentication of the Django request). Or even more: simply allow everything.
In the repository there should be .gitignore
file configured so that unwanted files are not tracker or committed by git (by accident). For example, *.pyc
files, .*
files, and env_piplmesh
are very good candidates for files/directories we will probably not want to have in our repository.
Requirements.txt should have lazy signup entry, for easier deploying with pip.
Currently, only updates to the list of online users are done. But initially this list is empty. This is not correct, it should be populated with currently online users.
Initial Django installation with static welcome page. On the top there should be logo on the left and on the right Google search box for users to be able to easily start their searches on Google (they are redirected to Google, we are not doing a custom Google search).
Put Django site in the piplmesh
subdirectory of the repository, and then structure features as Django apps inside (Python submodules). This static page could be in the frontend
app (so the whole name of the app is piplmesh.frontend
). For example, we might get a structure something like:
<repository root>/
docs/
...
piplmesh/
account/
__init__.py
models.py
...
api/
__init__.py
models.py
...
formats/
en/
...
__init__.py
frontend/
static/
piplmesh/
css/
...
js/
...
...
templates/
base.html
header.html
footer.html
home.html
...
tests/
__init__.py
...
__init__.py
models.py
views.py
__init__.py
manage.py
settings.py
urls.py
COPYING
LICENSE
README
requirements.txt
Split templates according to Django best practices (Google that) using template inheritance and define common template blocks.
Define Tastypie document type for MongoEngine.
We will be using Tastypie for REST interface (but if you find some better library, tell). It does not yet have support for MongoEngine but it is possible to define your own data sources. It should be defined similar to official ModelResource
for Django ORM (Django models). For example, it should automatically be able to view schema of the MongoEngine document. Probably you will have to define also new/custom data fields.
Maybe there exist something already on the web. Search. ;-) If not, develop this as an independent project, creating pull request against this repository.
After user logouts, she should be redirected back to the page she came from. Display to the user a message that logout was successful.
Header logo should depend on the language. Currently it is only Slovenian version is displayed no matter which language user has selected.
Implement something like django-lazyuser for MongoDB. So that also temporary users would be in MongoDB. Because we are implementing now everything ourselves, we can use only one user model/object with all needed fields.
I would just change decorator django-lazyuser users into additional middleware which would in practice be very similar, but would automatically be applied to all requests (which is I believe what we want).
Fix django-pushserver's access to response headers in Firefox:
We have some things which are invalid in XHTML. That should be fixed.
Team 4 working on issue 65
Keep translations updated.
After some thought I have decided we will use only MongoDB. To learn how to do everything only with non-relational database. And because we have different authentication backends with different data provided. So we will drop relation database support completely (so we will not use default Django permissions and authentication backends, we will also have to migrate session storage to MongoDB, we will not use site framework anymore). Admin Django app will also not be used anymore.
For MongoDB we will use MongoEngine. There is some documentation how to use it together with Django.
Data we want for the user:
Basic frontend layout from wlan slovenia site.
Open source project needs licensing information so that other users and developers know under which terms they can use and distribute our project. As we are developing a web portal I propose to use AGPL license so that any additions to source code have to be shared even if the program is only run on the server and not distributed. For media content I propose Creative Commons Attribution-ShareAlike license.
You can help yourself with the COPYING
and LICENSE
files of the nodewatcher project.
User should be able to configure her language. This should then be used around the portal for translation, etc., when user is logged in.
Support authentication with and linking to Twitter accounts.
On home page provide a list of currently logged in users. Maintain the list up-to-date also after the page has been opened. Do this using HTTP push for real-time updates.
For now use onbeforeunload
JavaScript event handler to signal the server that user is closing the page (but be careful if the page is opened multiple times).
Use django-pushserver app for HTTP push support.
More our application grows harder it is to know if everything is still working after you change something. For automatic checking if things work, we can use unit tests. Django provides good support for testing and you can simulate web requests and more.
There is never too few tests, so write them. Test every aspect of our application, user registration, login, logout, APIs, ... First tests will be much easier than later (which will involve also JavaScript) so hurry to get the easy ones.
Test both from the client (web request) side and also internal APIs (like calling defined classes/methods/functions).
After user wants to login, and goes to the login page, after login, she should be redirected back to the page she came from. Display to the user a message that login was successful.
Use Facebook button (that blue thing) and not text, so that it is more recognizable.
Define MongoDB model for posts and comments as MongoEngine document types. We will support link, photo and video post types.
Maybe check Facebook model definition for ideas on what all can be there.
Display Google search results inside the portal and not redirect to the Google itself. In this way we can retain users on our portal and later on also integrate our own results from the portal.
Ads provided by Google for user searches should be displayed so that we can monetize that we have a Google search form integrated.
Support OpenID for registering/login of our users. We could try to retrieve also some additional meta/profile data provided by some OpenID providers (like name, surname, e-mail address, ...).
Past search query string should be visible on result page. "See your results" should be visible only on results page. That X on the right is unnecessary. Design the whole search input box as Firefox home search box. We should also have ads on the right side of the results?
We had a very nice CSS file structure, indented in accordance with DOM structure. Currently CSS file is not anymore likes this. It should be made again.
Search query string should be simplified, currently some parameters are passed around which are not necessary as they are constant. Only user parameters should be in query (like search keywords).
Current situation:
When you register (normal, not Facebook) in PiplMesh and then login in -> get picture from Facebook based on username not an e-mail. So when I register it with username "mitar" then I get a picture user "mitar" and don't get picture based on my email.
Fix it that based on user email with use a gravatar services
Gravatar support for our users' avatars. Avatars should be automatically retrieved and displayed.
It is common to include requirements.txt
file which lists all Python requirements of the project so that they can be installed with pip install -r requirements.txt
. File can be created with pip freeze
(inside virtualenv, of course).
Registration form fails when birthday is not set.
We have defined custom LimitedDateTimeField
MongoEngine field type. It takes upper_limit
and lower_limit
arguments. But currently arguments can be only values defined at a definition time and not callables which would allow that limits are evaluated every time the field is validated. Similar to how default is defined in Django.
We need this because limits could change between definition time (Django app is imported) and use time (field is validated).
Support Facebook Connect for registering/login of our users. We could retrieve some additional information about our users. We could also be a bit viral and try to get information about all user's friends so that we can automatically match our users together and connect them also on our portal so that they do not need to find their friends manually again.
Keep all documentation up-to-date!
Currently we show users avatar from Facebook even if user didn't login with Facebook.
Change user avatar, to use gravatar if user isn't loged in with Facebook.
When I get latest code from GitHub and run it, I get next error:
Error importing authentication backend account.backends.FacebookBackend: "No module named account.backends"
In template d:\IPIRI\PiplMesh\piplmesh\frontend\templates\header.html, error at line 29
Error importing authentication backend account.backends.FacebookBackend: "No module named account.backends"
" {% if user.is_authenticated %}"
Create/update template tag for user avatar so that it first tries to get avatar from the user object (like from Facebook or OpenID) and if this fails it tries Gravatar (template tag for the later has already been written, so it should be reused/extended).
When users visit our portal we want to give them opportunity to register and authenticate. Smart idea is to create username automatically and allow them to use some features of the portal (like customization) immediately, and invite them to register to have their preferences and content persistent (and accessible across sessions). One such way is to use django-lazysignup, but you should also research possible other ways to achieve this.
Fix one or more TODO comment(s) found in source code.
Support linking to foursquare accounts. (Later on we can support check-in into foursquare when user connects to our node.)
In Django, usernames (for model-based authentication) are by default case-sensitive. This is really crazy and it would be great to make them insensitive, but case-preserving. (Passwords should still be sensitive, of course.)
When linking will be possible (#76), we should add to option for users to select which user picture they want displayed: Gravatar or Facebook. If user first registered through Facebook, the default should be Facebook, if user first registered directly, then after linking default should change to Facebook if user does not have a Gravatar picture. (Is there a way to test this?)
Blocked by: #76
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.